)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"745c465da040f987cb5c7631f9fe33ba1afb1760","unresolved":true,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Loki searches in two layers: the first one is the streams. Each stream"},{"line_number":10,"context_line":"is uniquely identified by a set of attributes. Before this patch,"},{"line_number":11,"context_line":"this attributes are just what the user passes in the \"stream\" parameter,"},{"line_number":12,"context_line":"or {service\u003d\"cloudkitty\"} by default."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"This patch adds a project_id\u003d\"aaa-bbb-ccc-ddd\" field to the stream,"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"b25439c5_d5266306","line":11,"range":{"start_line":11,"start_character":0,"end_line":11,"end_character":4},"updated":"2025-12-22 14:21:45.000000000","message":"these","commit_id":"56fcc4c9d89b684d74aefe188ed25a4b00f6070b"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"3e12ae8c1d00c0148e821f92919315e113335eb3","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Loki searches in two layers: the first one is the streams. Each stream"},{"line_number":10,"context_line":"is uniquely identified by a set of attributes. Before this patch,"},{"line_number":11,"context_line":"this attributes are just what the user passes in the \"stream\" parameter,"},{"line_number":12,"context_line":"or {service\u003d\"cloudkitty\"} by default."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"This patch adds a project_id\u003d\"aaa-bbb-ccc-ddd\" field to the stream,"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"a8d8a170_0986b1a3","line":11,"range":{"start_line":11,"start_character":0,"end_line":11,"end_character":4},"in_reply_to":"b25439c5_d5266306","updated":"2026-01-05 14:20:08.000000000","message":"Done","commit_id":"56fcc4c9d89b684d74aefe188ed25a4b00f6070b"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"78443df78d1808097c44ba611be0612625942c7a","unresolved":true,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Loki searches in two layers: the first one is the streams. Each stream"},{"line_number":10,"context_line":"is uniquely identified by a set of attributes. Before this patch,"},{"line_number":11,"context_line":"these attributes are just what the user passes in the \"stream\" parameter, or {service\u003d\"cloudkitty\"} by default."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This patch adds a project_id\u003d\"aaa-bbb-ccc-ddd\" field to the stream,"},{"line_number":14,"context_line":"effectively creating one stream per project. As the most common use"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"d861f9fa_eaa5131b","line":11,"range":{"start_line":11,"start_character":0,"end_line":11,"end_character":111},"updated":"2025-12-22 14:27:41.000000000","message":"Please wrap lines at 72 characters.","commit_id":"6474bb9ff52ffca87d05b6c8b6a3e7c00af8a9f7"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"3e12ae8c1d00c0148e821f92919315e113335eb3","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Loki searches in two layers: the first one is the streams. Each stream"},{"line_number":10,"context_line":"is uniquely identified by a set of attributes. Before this patch,"},{"line_number":11,"context_line":"these attributes are just what the user passes in the \"stream\" parameter, or {service\u003d\"cloudkitty\"} by default."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This patch adds a project_id\u003d\"aaa-bbb-ccc-ddd\" field to the stream,"},{"line_number":14,"context_line":"effectively creating one stream per project. As the most common use"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"73a3f713_7f614efb","line":11,"range":{"start_line":11,"start_character":0,"end_line":11,"end_character":111},"in_reply_to":"d861f9fa_eaa5131b","updated":"2026-01-05 14:20:08.000000000","message":"Done","commit_id":"6474bb9ff52ffca87d05b6c8b6a3e7c00af8a9f7"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"c227449073cb518427afdbef2f4898fb7e1605f6","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"d3069d2c_5b559c96","updated":"2025-11-24 14:11:48.000000000","message":"Hello Juan, \nThanks for the patch. Can you rebase it?","commit_id":"e03b833890f60492ebcc6e392822bde55bf26771"},{"author":{"_account_id":4264,"name":"Matthias Runge","email":"mrunge@redhat.com","username":"mrunge"},"change_message_id":"893b96dee0673982ae428d9dd7b16f6805a002f0","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"fed487b0_c21fcf74","updated":"2025-11-10 10:26:06.000000000","message":"Juan, would you be able to fix the pep8 issues?","commit_id":"e03b833890f60492ebcc6e392822bde55bf26771"},{"author":{"_account_id":32968,"name":"Juan Larriba","email":"jlarriba@redhat.com","username":"jlarriba"},"change_message_id":"cbc109a85eb5309c6c155fdf4b78162b4a60a401","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"a7f1750f_c940ec2e","in_reply_to":"d3069d2c_5b559c96","updated":"2025-11-24 16:55:32.000000000","message":"Yes, I will or sure.","commit_id":"e03b833890f60492ebcc6e392822bde55bf26771"},{"author":{"_account_id":32968,"name":"Juan Larriba","email":"jlarriba@redhat.com","username":"jlarriba"},"change_message_id":"0eb3e3b0b49f801aaf6b41c33dbbe2143f8554d9","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"bd94bd42_33129f22","in_reply_to":"fed487b0_c21fcf74","updated":"2025-11-10 10:47:17.000000000","message":"This patch conflicts with https://review.opendev.org/c/openstack/cloudkitty/+/961609. I will have to rework it when the other one is merged, I will be fixing the pep8 errors during that needed rework.","commit_id":"e03b833890f60492ebcc6e392822bde55bf26771"},{"author":{"_account_id":30695,"name":"Pedro Henrique Pereira Martins","email":"phpm13@gmail.com","username":"pedrohpmartins"},"change_message_id":"eba521107e4616943e99f9a44750836b4799629f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"4c4aa03f_977cfd86","updated":"2025-12-03 13:47:53.000000000","message":"Hi Juan Larriba, thanks for your patch 😊, I have a few considerations. But the overall is good to me.","commit_id":"005dd4eb01bc9873d869590fbda5cacb4c60379f"},{"author":{"_account_id":32968,"name":"Juan Larriba","email":"jlarriba@redhat.com","username":"jlarriba"},"change_message_id":"ebdedbd97990a91c01dec8eedf3eda2f04e56c67","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"22fac13f_d46476da","updated":"2025-12-02 14:50:30.000000000","message":"recheck","commit_id":"005dd4eb01bc9873d869590fbda5cacb4c60379f"},{"author":{"_account_id":32968,"name":"Juan Larriba","email":"jlarriba@redhat.com","username":"jlarriba"},"change_message_id":"75ff620113d319c72b2076f3fc9d0efd8e138140","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"3deeff18_52d48745","updated":"2025-12-03 08:28:49.000000000","message":"recheck","commit_id":"005dd4eb01bc9873d869590fbda5cacb4c60379f"},{"author":{"_account_id":32968,"name":"Juan Larriba","email":"jlarriba@redhat.com","username":"jlarriba"},"change_message_id":"6f88eddc3557c9edc52517d145b66c012a870120","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"2938c8af_536d1b13","in_reply_to":"4c4aa03f_977cfd86","updated":"2025-12-03 14:17:35.000000000","message":"thank you for your kind review!","commit_id":"005dd4eb01bc9873d869590fbda5cacb4c60379f"},{"author":{"_account_id":30695,"name":"Pedro Henrique Pereira Martins","email":"phpm13@gmail.com","username":"pedrohpmartins"},"change_message_id":"2ca364f785d193902bb714bf3c1e5440747a5ddb","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"fd4fcda0_bd182fe3","updated":"2025-12-04 11:10:51.000000000","message":"Thanks Juan Larriba 😊","commit_id":"56fcc4c9d89b684d74aefe188ed25a4b00f6070b"}],"cloudkitty/storage/v2/loki/client.py":[{"author":{"_account_id":30695,"name":"Pedro Henrique Pereira Martins","email":"phpm13@gmail.com","username":"pedrohpmartins"},"change_message_id":"eba521107e4616943e99f9a44750836b4799629f","unresolved":true,"context_lines":[{"line_number":50,"context_line":"        for project_id, values in batch.items():"},{"line_number":51,"context_line":"            # Combine base stream labels with project_id"},{"line_number":52,"context_line":"            stream_labels \u003d self._stream_labels.copy()"},{"line_number":53,"context_line":"            stream_labels[\u0027project_id\u0027] \u003d project_id"},{"line_number":54,"context_line":"            streams.append({"},{"line_number":55,"context_line":"                \"stream\": stream_labels,"},{"line_number":56,"context_line":"                \"values\": values"}],"source_content_type":"text/x-python","patch_set":3,"id":"662f09da_665e7611","line":53,"updated":"2025-12-03 13:47:53.000000000","message":"I would not add the project_id label if it is an \u0027unknown\u0027 project_id, it could leave people thinking that the datas with \"unknown\" project_id have some kind of relation among them. And as we can list the labels from an organization in loki, it would be visible for users.","commit_id":"005dd4eb01bc9873d869590fbda5cacb4c60379f"},{"author":{"_account_id":30695,"name":"Pedro Henrique Pereira Martins","email":"phpm13@gmail.com","username":"pedrohpmartins"},"change_message_id":"2ad2e332c53c70ce5f60b9574df2d9aa775d9e09","unresolved":true,"context_lines":[{"line_number":50,"context_line":"        for project_id, values in batch.items():"},{"line_number":51,"context_line":"            # Combine base stream labels with project_id"},{"line_number":52,"context_line":"            stream_labels \u003d self._stream_labels.copy()"},{"line_number":53,"context_line":"            stream_labels[\u0027project_id\u0027] \u003d project_id"},{"line_number":54,"context_line":"            streams.append({"},{"line_number":55,"context_line":"                \"stream\": stream_labels,"},{"line_number":56,"context_line":"                \"values\": values"}],"source_content_type":"text/x-python","patch_set":3,"id":"7cc2f0c3_18463178","line":53,"in_reply_to":"33b93e99_49cbeb79","updated":"2025-12-03 15:35:06.000000000","message":"It is just to avoid confusion. When I list all the `project_id` label values (loki allow us to do it), I expect that all listed values are valid ones. It could leave some unaware operator thinking that there is a project in OpenStack with ID\u003d\"unknown\".","commit_id":"005dd4eb01bc9873d869590fbda5cacb4c60379f"},{"author":{"_account_id":32968,"name":"Juan Larriba","email":"jlarriba@redhat.com","username":"jlarriba"},"change_message_id":"6f88eddc3557c9edc52517d145b66c012a870120","unresolved":true,"context_lines":[{"line_number":50,"context_line":"        for project_id, values in batch.items():"},{"line_number":51,"context_line":"            # Combine base stream labels with project_id"},{"line_number":52,"context_line":"            stream_labels \u003d self._stream_labels.copy()"},{"line_number":53,"context_line":"            stream_labels[\u0027project_id\u0027] \u003d project_id"},{"line_number":54,"context_line":"            streams.append({"},{"line_number":55,"context_line":"                \"stream\": stream_labels,"},{"line_number":56,"context_line":"                \"values\": values"}],"source_content_type":"text/x-python","patch_set":3,"id":"33b93e99_49cbeb79","line":53,"in_reply_to":"662f09da_665e7611","updated":"2025-12-03 14:17:35.000000000","message":"Great observation. I thought about this myself too. The thing is if we check here that if project_id is \"unknown\" and then we do not add a project_id stream label, all the dataframes with that unknown project_id will be stored under a common stream too, which will be just {service: \"cloudkitty\"} an nothing else.\n\nWould that be overly different from storing all the \"unknowns\" under a {service: \"cloudkitty\", project_id: \"unknown\"} stream?","commit_id":"005dd4eb01bc9873d869590fbda5cacb4c60379f"},{"author":{"_account_id":32968,"name":"Juan Larriba","email":"jlarriba@redhat.com","username":"jlarriba"},"change_message_id":"8ca0573dfb0b09eb3b9238398a2a93f06e67d616","unresolved":true,"context_lines":[{"line_number":50,"context_line":"        for project_id, values in batch.items():"},{"line_number":51,"context_line":"            # Combine base stream labels with project_id"},{"line_number":52,"context_line":"            stream_labels \u003d self._stream_labels.copy()"},{"line_number":53,"context_line":"            stream_labels[\u0027project_id\u0027] \u003d project_id"},{"line_number":54,"context_line":"            streams.append({"},{"line_number":55,"context_line":"                \"stream\": stream_labels,"},{"line_number":56,"context_line":"                \"values\": values"}],"source_content_type":"text/x-python","patch_set":3,"id":"cb3670ad_2aa2858d","line":53,"in_reply_to":"7cc2f0c3_18463178","updated":"2025-12-04 09:45:46.000000000","message":"Yeah, you have a point. I have modified the code to ditch the \"unknown\" project_id and replace it with the more appropiate \"None\" to avoid any further issues and added a check that if the project_id is None, there is no project_id stream.\n\nAll the data coming with a projectid will be stored under a generic {service: \"cloudkitty\"} stream, which you have convinced me it will be less confusing for the user.","commit_id":"005dd4eb01bc9873d869590fbda5cacb4c60379f"},{"author":{"_account_id":32968,"name":"Juan Larriba","email":"jlarriba@redhat.com","username":"jlarriba"},"change_message_id":"bacb41a2a20893277d82bf068bead1c419273ec6","unresolved":true,"context_lines":[{"line_number":50,"context_line":"        for project_id, values in batch.items():"},{"line_number":51,"context_line":"            # Combine base stream labels with project_id"},{"line_number":52,"context_line":"            stream_labels \u003d self._stream_labels.copy()"},{"line_number":53,"context_line":"            stream_labels[\u0027project_id\u0027] \u003d project_id"},{"line_number":54,"context_line":"            streams.append({"},{"line_number":55,"context_line":"                \"stream\": stream_labels,"},{"line_number":56,"context_line":"                \"values\": values"}],"source_content_type":"text/x-python","patch_set":3,"id":"34297d0b_95d7b5be","line":53,"in_reply_to":"cb3670ad_2aa2858d","updated":"2025-12-04 09:47:17.000000000","message":"I also added a new test case for when the project_id is empty in the datapoint.","commit_id":"005dd4eb01bc9873d869590fbda5cacb4c60379f"},{"author":{"_account_id":30695,"name":"Pedro Henrique Pereira Martins","email":"phpm13@gmail.com","username":"pedrohpmartins"},"change_message_id":"eba521107e4616943e99f9a44750836b4799629f","unresolved":true,"context_lines":[{"line_number":265,"context_line":"        timestamp_ns \u003d int(end.timestamp() * 1_000_000_000)"},{"line_number":266,"context_line":"        timestamp \u003d str(timestamp_ns)"},{"line_number":267,"context_line":""},{"line_number":268,"context_line":"        # Extract project_id from point.groupby"},{"line_number":269,"context_line":"        project_id \u003d point.groupby.get(\u0027project_id\u0027, \u0027unknown\u0027)"},{"line_number":270,"context_line":""},{"line_number":271,"context_line":"        data \u003d {"}],"source_content_type":"text/x-python","patch_set":3,"id":"54361735_0ad097d6","line":268,"updated":"2025-12-03 13:47:53.000000000","message":"In InfluxDB driver, the groupby items are tags, which are like indexes, which improve the queries speed when using them, I thought loki could work like it, would not be better to use all the groupby items as stream labels instead of only project_id? Any query filtering by any group item (not only project_id), would have a performance improvement. What do you think?","commit_id":"005dd4eb01bc9873d869590fbda5cacb4c60379f"},{"author":{"_account_id":32968,"name":"Juan Larriba","email":"jlarriba@redhat.com","username":"jlarriba"},"change_message_id":"6f88eddc3557c9edc52517d145b66c012a870120","unresolved":true,"context_lines":[{"line_number":265,"context_line":"        timestamp_ns \u003d int(end.timestamp() * 1_000_000_000)"},{"line_number":266,"context_line":"        timestamp \u003d str(timestamp_ns)"},{"line_number":267,"context_line":""},{"line_number":268,"context_line":"        # Extract project_id from point.groupby"},{"line_number":269,"context_line":"        project_id \u003d point.groupby.get(\u0027project_id\u0027, \u0027unknown\u0027)"},{"line_number":270,"context_line":""},{"line_number":271,"context_line":"        data \u003d {"}],"source_content_type":"text/x-python","patch_set":3,"id":"db47bfb9_61e7d1a4","line":268,"in_reply_to":"54361735_0ad097d6","updated":"2025-12-03 14:17:35.000000000","message":"It is a very good suggestion, but the streams is not the place where Loki stores these kind of indexable fields. Creating one stream per each possible combination of possible groupby values would create too much atomization and then Loki will need to spend more time aggregating whenever the metrics need to be aggregated.\n\nI believe that the project_id is the \"basic\" aggregation operation, as it is what most tenants will want to see. Moreover, the Python CLI automatically adds groupby project_id to every single query it does.\n\nThe mechanism that Loki has to provide indexing of the data we are searching for is called structured_metadata. That would achieve what you are proposing: extract actual indexable metadata from the raw JSON to improve any groupby operation, not having to go straight to JSON search. \n\nCurrently the usage of structured_metadata is on the roadmap, but I have not yet contributed it because it has implications in the future for future Loki updates that I want to have more clear.","commit_id":"005dd4eb01bc9873d869590fbda5cacb4c60379f"},{"author":{"_account_id":30695,"name":"Pedro Henrique Pereira Martins","email":"phpm13@gmail.com","username":"pedrohpmartins"},"change_message_id":"2ad2e332c53c70ce5f60b9574df2d9aa775d9e09","unresolved":false,"context_lines":[{"line_number":265,"context_line":"        timestamp_ns \u003d int(end.timestamp() * 1_000_000_000)"},{"line_number":266,"context_line":"        timestamp \u003d str(timestamp_ns)"},{"line_number":267,"context_line":""},{"line_number":268,"context_line":"        # Extract project_id from point.groupby"},{"line_number":269,"context_line":"        project_id \u003d point.groupby.get(\u0027project_id\u0027, \u0027unknown\u0027)"},{"line_number":270,"context_line":""},{"line_number":271,"context_line":"        data \u003d {"}],"source_content_type":"text/x-python","patch_set":3,"id":"6721becb_10b5365a","line":268,"in_reply_to":"db47bfb9_61e7d1a4","updated":"2025-12-03 15:35:06.000000000","message":"Cool, So the idea is to use only the project_id to improve the queries but in next releases implement the use of structured metadata to also improve queries with the other group by items. I see no problem with that.","commit_id":"005dd4eb01bc9873d869590fbda5cacb4c60379f"}]}
