)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"4989466b1ec549e33967c4452a1d2ad9e9f9029a","unresolved":true,"context_lines":[{"line_number":10,"context_line":"samples from the exporter Prometheus data to avoid them to"},{"line_number":11,"context_line":"become stale."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"As unregistering a collector is a very cheap action (del from"},{"line_number":14,"context_line":"a dict), we are unregistering every collector on each polling"},{"line_number":15,"context_line":"cycle, thus guaranteeing that the only metrics exposed after"},{"line_number":16,"context_line":"every polling cycle are the only valid ones and purging"},{"line_number":17,"context_line":"the stale metrics."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: I92dc47a9260630df6c4e94f6d79b4601d79a6b59"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"cc693005_f52bff02","line":17,"range":{"start_line":13,"start_character":0,"end_line":17,"end_character":18},"updated":"2024-12-25 04:49:20.000000000","message":"While I agree this is the easiest solution, I wonder if we should consider the case that prometheus read metrics while some of the meterics are being registered.","commit_id":"386f0993e9b7856ebef487ec483da1348967af10"},{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"48dc95a324c9a88a97ef4e0e80216d3c4bea4582","unresolved":true,"context_lines":[{"line_number":10,"context_line":"samples from the exporter Prometheus data to avoid them to"},{"line_number":11,"context_line":"become stale."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"As unregistering a collector is a very cheap action (del from"},{"line_number":14,"context_line":"a dict), we are unregistering every collector on each polling"},{"line_number":15,"context_line":"cycle, thus guaranteeing that the only metrics exposed after"},{"line_number":16,"context_line":"every polling cycle are the only valid ones and purging"},{"line_number":17,"context_line":"the stale metrics."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: I92dc47a9260630df6c4e94f6d79b4601d79a6b59"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"ba9e03e2_bb50836f","line":17,"range":{"start_line":13,"start_character":0,"end_line":17,"end_character":18},"in_reply_to":"a0284664_989ccdb3","updated":"2025-01-10 13:16:47.000000000","message":"It sounds correct theoretically, but I\u0027m more concerned with how often that \"metric loss\" may occur. We may need to run some actual workload in real deployments to know that, though.","commit_id":"386f0993e9b7856ebef487ec483da1348967af10"},{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"1d2a3c5d4991955da51ba06f557325e75ff1bf6d","unresolved":false,"context_lines":[{"line_number":10,"context_line":"samples from the exporter Prometheus data to avoid them to"},{"line_number":11,"context_line":"become stale."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"As unregistering a collector is a very cheap action (del from"},{"line_number":14,"context_line":"a dict), we are unregistering every collector on each polling"},{"line_number":15,"context_line":"cycle, thus guaranteeing that the only metrics exposed after"},{"line_number":16,"context_line":"every polling cycle are the only valid ones and purging"},{"line_number":17,"context_line":"the stale metrics."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: I92dc47a9260630df6c4e94f6d79b4601d79a6b59"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"5c637359_7fcb806b","line":17,"range":{"start_line":13,"start_character":0,"end_line":17,"end_character":18},"in_reply_to":"ba9e03e2_bb50836f","updated":"2025-01-10 13:18:14.000000000","message":"Done","commit_id":"386f0993e9b7856ebef487ec483da1348967af10"},{"author":{"_account_id":32968,"name":"Juan Larriba","email":"jlarriba@redhat.com","username":"jlarriba"},"change_message_id":"0e258fd5bda390cbe9b808fda050ba169d40bcdd","unresolved":true,"context_lines":[{"line_number":10,"context_line":"samples from the exporter Prometheus data to avoid them to"},{"line_number":11,"context_line":"become stale."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"As unregistering a collector is a very cheap action (del from"},{"line_number":14,"context_line":"a dict), we are unregistering every collector on each polling"},{"line_number":15,"context_line":"cycle, thus guaranteeing that the only metrics exposed after"},{"line_number":16,"context_line":"every polling cycle are the only valid ones and purging"},{"line_number":17,"context_line":"the stale metrics."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: I92dc47a9260630df6c4e94f6d79b4601d79a6b59"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"a0284664_989ccdb3","line":17,"range":{"start_line":13,"start_character":0,"end_line":17,"end_character":18},"in_reply_to":"cc693005_f52bff02","updated":"2025-01-07 10:30:29.000000000","message":"If it scrapes when some metrics have been deregistered and not yet registered, that scrape will bring one less metric to Prometheus, but this is usually not a big deal as after a short while, Prometheus will scrape again bringing in all the metrics. I wouldn\u0027t consider this an issue.","commit_id":"386f0993e9b7856ebef487ec483da1348967af10"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":32968,"name":"Juan Larriba","email":"jlarriba@redhat.com","username":"jlarriba"},"change_message_id":"a3387140da626d38b27f817cf7d4269c46d84391","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"dfed2194_10b159ca","updated":"2024-12-02 14:11:07.000000000","message":"Ubuntu was upgraded from Jammy to Noble and there is some error with the connectivity between an external system and the sg-core container. This needs some work on the CI to work.","commit_id":"386f0993e9b7856ebef487ec483da1348967af10"},{"author":{"_account_id":32968,"name":"Juan Larriba","email":"jlarriba@redhat.com","username":"jlarriba"},"change_message_id":"b0667da3a4c9b7b84ed09688f726e5c9dfc07c15","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"1c8ff75c_598897e2","updated":"2024-12-02 12:48:03.000000000","message":"recheck","commit_id":"386f0993e9b7856ebef487ec483da1348967af10"},{"author":{"_account_id":32968,"name":"Juan Larriba","email":"jlarriba@redhat.com","username":"jlarriba"},"change_message_id":"fedf52e66c7fc53896d3a8c987e6357cb4b3b63d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"a0a0016e_c28230e3","updated":"2024-12-17 10:04:19.000000000","message":"recheck","commit_id":"386f0993e9b7856ebef487ec483da1348967af10"},{"author":{"_account_id":32968,"name":"Juan Larriba","email":"jlarriba@redhat.com","username":"jlarriba"},"change_message_id":"13a1b9d67aa121d3fc30fe310148a1e35be9a532","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"f36dbbf5_3c7a825c","updated":"2024-12-02 08:24:30.000000000","message":"recheck","commit_id":"386f0993e9b7856ebef487ec483da1348967af10"},{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"82003c46e80d9aaa2cb7e43b92ea9f3fe86534f6","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":8,"id":"2effb7c0_41fb3b65","updated":"2025-01-14 13:57:25.000000000","message":"I\u0027ll leave my +2 here, but will keep this open for the other reviewers now to make sure that the current limitation is acceptable. If this has been kept open without additional feedback for some time then I\u0027ll vote my +A.","commit_id":"da794dc4f4421ef5f4e245b8e7fc84a500b910e4"},{"author":{"_account_id":4264,"name":"Matthias Runge","email":"mrunge@redhat.com","username":"mrunge"},"change_message_id":"9149f3f789675d0a7029eee16eef5841efa271b2","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":8,"id":"213168db_c081c5cc","updated":"2025-01-14 16:05:43.000000000","message":"The diff of what Takashi added looks to me so small, and it looks like we are all in agreement. Let\u0027s get this merged. Thank you very much!","commit_id":"da794dc4f4421ef5f4e245b8e7fc84a500b910e4"}],"ceilometer/polling/prom_exporter.py":[{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"4989466b1ec549e33967c4452a1d2ad9e9f9029a","unresolved":true,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"def collect_metrics(samples):"},{"line_number":29,"context_line":"    if samples:"},{"line_number":30,"context_line":"        name \u003d \"ceilometer_\" + samples[0][\u0027counter_name\u0027].replace(\u0027.\u0027, \u0027_\u0027)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"        metric \u003d CEILOMETER_REGISTRY._names_to_collectors.get(name, None)"},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"7f8aadac_35642168","line":30,"range":{"start_line":30,"start_character":31,"end_line":30,"end_character":38},"updated":"2024-12-25 04:49:20.000000000","message":"I wonder if we can safely assume that all samples in single batch has the same counter_name ?","commit_id":"386f0993e9b7856ebef487ec483da1348967af10"},{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"ccd50f2af4244a759c06e66e180e56c2a4ca8859","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"def collect_metrics(samples):"},{"line_number":29,"context_line":"    if samples:"},{"line_number":30,"context_line":"        name \u003d \"ceilometer_\" + samples[0][\u0027counter_name\u0027].replace(\u0027.\u0027, \u0027_\u0027)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"        metric \u003d CEILOMETER_REGISTRY._names_to_collectors.get(name, None)"},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"72622522_efec9287","line":30,"range":{"start_line":30,"start_character":31,"end_line":30,"end_character":38},"in_reply_to":"200a157a_20b071d1","updated":"2025-01-13 10:13:33.000000000","message":"Done","commit_id":"386f0993e9b7856ebef487ec483da1348967af10"},{"author":{"_account_id":32968,"name":"Juan Larriba","email":"jlarriba@redhat.com","username":"jlarriba"},"change_message_id":"21299339f980e0013d4c6fb42e4186ad95f888c6","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"def collect_metrics(samples):"},{"line_number":29,"context_line":"    if samples:"},{"line_number":30,"context_line":"        name \u003d \"ceilometer_\" + samples[0][\u0027counter_name\u0027].replace(\u0027.\u0027, \u0027_\u0027)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"        metric \u003d CEILOMETER_REGISTRY._names_to_collectors.get(name, None)"},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"f17d3890_39240319","line":30,"range":{"start_line":30,"start_character":31,"end_line":30,"end_character":38},"in_reply_to":"24829a0c_ca522c6f","updated":"2025-01-14 12:01:14.000000000","message":"Would the patch be ready for a +2?","commit_id":"386f0993e9b7856ebef487ec483da1348967af10"},{"author":{"_account_id":32968,"name":"Juan Larriba","email":"jlarriba@redhat.com","username":"jlarriba"},"change_message_id":"e859bef907290afb6c2c6f49e1f3f20fe25797cf","unresolved":true,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"def collect_metrics(samples):"},{"line_number":29,"context_line":"    if samples:"},{"line_number":30,"context_line":"        name \u003d \"ceilometer_\" + samples[0][\u0027counter_name\u0027].replace(\u0027.\u0027, \u0027_\u0027)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"        metric \u003d CEILOMETER_REGISTRY._names_to_collectors.get(name, None)"},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"f6cfbf2b_868c6d3e","line":30,"range":{"start_line":30,"start_character":31,"end_line":30,"end_character":38},"in_reply_to":"45dcf89e_5550e55a","updated":"2025-01-10 13:35:18.000000000","message":"We could tackle this with two different approaches:\n\n1.- Ignore the batch_size when prometheus exporter is enabled\n2.- Document that if prometheus exporter is enabled, the user needs to configure his batch_size to a number that is greater than the maximum number of VMs he could have.\n\nWith option 1, we take away the issue but we could make the user run into memory issues in big environments. With option 2, a misconfiguration from the user could make metrics get lost, but he will be fully aware of the increase of memory consumption.\n\nMy choice would be to go with option 2, so the user knows what is happening, WDYT?","commit_id":"386f0993e9b7856ebef487ec483da1348967af10"},{"author":{"_account_id":32968,"name":"Juan Larriba","email":"jlarriba@redhat.com","username":"jlarriba"},"change_message_id":"538719ad0b8d8e6500f9b6ebd5197d6b511a1b0f","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"def collect_metrics(samples):"},{"line_number":29,"context_line":"    if samples:"},{"line_number":30,"context_line":"        name \u003d \"ceilometer_\" + samples[0][\u0027counter_name\u0027].replace(\u0027.\u0027, \u0027_\u0027)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"        metric \u003d CEILOMETER_REGISTRY._names_to_collectors.get(name, None)"},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"24829a0c_ca522c6f","line":30,"range":{"start_line":30,"start_character":31,"end_line":30,"end_character":38},"in_reply_to":"72622522_efec9287","updated":"2025-01-13 13:25:02.000000000","message":"Thank you!","commit_id":"386f0993e9b7856ebef487ec483da1348967af10"},{"author":{"_account_id":32968,"name":"Juan Larriba","email":"jlarriba@redhat.com","username":"jlarriba"},"change_message_id":"0e258fd5bda390cbe9b808fda050ba169d40bcdd","unresolved":true,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"def collect_metrics(samples):"},{"line_number":29,"context_line":"    if samples:"},{"line_number":30,"context_line":"        name \u003d \"ceilometer_\" + samples[0][\u0027counter_name\u0027].replace(\u0027.\u0027, \u0027_\u0027)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"        metric \u003d CEILOMETER_REGISTRY._names_to_collectors.get(name, None)"},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"96a48fc9_5e547ebb","line":30,"range":{"start_line":30,"start_character":31,"end_line":30,"end_character":38},"in_reply_to":"7f8aadac_35642168","updated":"2025-01-07 10:30:29.000000000","message":"I believe that we can safely assume so, because that is how Ceilometer works. It polls, and create an array of samples per \"counter_name\". The collect_metrics method is called once per \"meter\", which is the one setting the counter_name parameter in the sample. \n\nThat meter retrieves a number of samples (normally one, but it could be more) that are passed as an argument.\n\nSo, as far as I have seen on my tests, all the samples that come here always share the same counter_name. For a different counter_name, a new  call to collect_metrics with different argument is performed.","commit_id":"386f0993e9b7856ebef487ec483da1348967af10"},{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"48dc95a324c9a88a97ef4e0e80216d3c4bea4582","unresolved":true,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"def collect_metrics(samples):"},{"line_number":29,"context_line":"    if samples:"},{"line_number":30,"context_line":"        name \u003d \"ceilometer_\" + samples[0][\u0027counter_name\u0027].replace(\u0027.\u0027, \u0027_\u0027)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"        metric \u003d CEILOMETER_REGISTRY._names_to_collectors.get(name, None)"},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"45dcf89e_5550e55a","line":30,"range":{"start_line":30,"start_character":31,"end_line":30,"end_character":38},"in_reply_to":"96a48fc9_5e547ebb","updated":"2025-01-10 13:16:47.000000000","message":"OK I went through the existing pollsters and confirmed that behavior.\n\nHowever that may bring a different problem. Currently ceilometer has batch mechanism and split samples into some groups according to batch_size (50 by default). So if there are more than 50 samples (whicn means there are more than 50 resources such as virtual machines read by a single pollster) then collect_metrics can be called multiple times with different sets of samples.\n\nSee https://github.com/openstack/ceilometer/blob/c5e59317b144b7d176fe0832d83e18ae45766656/ceilometer/polling/manager.py#L287 .\n\nWe may need a mechanism to support \"unlimited\" batch size, though it may increase memory consumption in large environments.","commit_id":"386f0993e9b7856ebef487ec483da1348967af10"},{"author":{"_account_id":4264,"name":"Matthias Runge","email":"mrunge@redhat.com","username":"mrunge"},"change_message_id":"8c1d173521b9dc0e854760fd2dde7aaa02384ff4","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"def collect_metrics(samples):"},{"line_number":29,"context_line":"    if samples:"},{"line_number":30,"context_line":"        name \u003d \"ceilometer_\" + samples[0][\u0027counter_name\u0027].replace(\u0027.\u0027, \u0027_\u0027)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"        metric \u003d CEILOMETER_REGISTRY._names_to_collectors.get(name, None)"},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"f885d35c_15d57f31","line":30,"range":{"start_line":30,"start_character":31,"end_line":30,"end_character":38},"in_reply_to":"f17d3890_39240319","updated":"2025-01-14 13:16:13.000000000","message":"Takashi had a good amount of contributions on this patch now, and he wouldn\u0027t vote on own patches ;-)","commit_id":"386f0993e9b7856ebef487ec483da1348967af10"},{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"b34be668dcfc109072a544dba321735ac15a18ed","unresolved":true,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"def collect_metrics(samples):"},{"line_number":29,"context_line":"    if samples:"},{"line_number":30,"context_line":"        name \u003d \"ceilometer_\" + samples[0][\u0027counter_name\u0027].replace(\u0027.\u0027, \u0027_\u0027)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"        metric \u003d CEILOMETER_REGISTRY._names_to_collectors.get(name, None)"},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"200a157a_20b071d1","line":30,"range":{"start_line":30,"start_character":31,"end_line":30,"end_character":38},"in_reply_to":"f6cfbf2b_868c6d3e","updated":"2025-01-13 09:56:25.000000000","message":"Yeah documenting that requirement is the minimum but good starting point. As I mentioned we can probably support \"unlimited\" batch as well but that can be done in a separate work.","commit_id":"386f0993e9b7856ebef487ec483da1348967af10"}]}
