)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":true,"context_lines":[{"line_number":11,"context_line":"Include two config options:"},{"line_number":12,"context_line":"  - log_statsd_label_mode, which specifies which label format to use"},{"line_number":13,"context_line":"  - log_statsd_emit_legacy, which dictates whether to emit both labeled"},{"line_number":14,"context_line":"    and old-style metrics dotted metrics"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I115ffb1dc601652a979895d7944e011b951a91c1"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"f5a32b84_0b2e46b3","line":14,"updated":"2024-03-14 19:39:51.000000000","message":"consider rewording; I don\u0027t think this option should effect \"both\" so much as only if legacy metrics are emited at all; which probably is not something we need ops to be able to change (until we\u0027ve instrumented more of the code base).  But it may be useful to add now for testing/dev.","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"bc0b49ef784ef3e3456d7d2accb0167c16d999f8","unresolved":false,"context_lines":[{"line_number":11,"context_line":"Include two config options:"},{"line_number":12,"context_line":"  - log_statsd_label_mode, which specifies which label format to use"},{"line_number":13,"context_line":"  - log_statsd_emit_legacy, which dictates whether to emit both labeled"},{"line_number":14,"context_line":"    and old-style metrics dotted metrics"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I115ffb1dc601652a979895d7944e011b951a91c1"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"16fd5f8d_d25c9065","line":14,"in_reply_to":"f5a32b84_0b2e46b3","updated":"2024-03-21 19:59:32.000000000","message":"Acknowledged","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":true,"context_lines":[{"line_number":12,"context_line":"  - log_statsd_label_mode, which specifies which label format to use"},{"line_number":13,"context_line":"  - log_statsd_emit_legacy, which dictates whether to emit both labeled"},{"line_number":14,"context_line":"    and old-style metrics dotted metrics"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I115ffb1dc601652a979895d7944e011b951a91c1"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"db509e35_7cf8ab9b","line":15,"updated":"2024-03-14 19:39:51.000000000","message":"I think this change also adds some new userlabel config options that might should get called out.","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"bc0b49ef784ef3e3456d7d2accb0167c16d999f8","unresolved":false,"context_lines":[{"line_number":12,"context_line":"  - log_statsd_label_mode, which specifies which label format to use"},{"line_number":13,"context_line":"  - log_statsd_emit_legacy, which dictates whether to emit both labeled"},{"line_number":14,"context_line":"    and old-style metrics dotted metrics"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I115ffb1dc601652a979895d7944e011b951a91c1"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"1175bc8f_40533344","line":15,"in_reply_to":"db509e35_7cf8ab9b","updated":"2024-03-21 19:59:32.000000000","message":"Acknowledged","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"11e44436167bd0af814619080ea7811c1533ae9f","unresolved":true,"context_lines":[{"line_number":11,"context_line":"Include three config options:"},{"line_number":12,"context_line":"  - log_statsd_label_mode, which specifies which label format to use"},{"line_number":13,"context_line":"  - log_statsd_emit_legacy, which dictates whether to emit old-style"},{"line_number":14,"context_line":"    metrics dotted metrics"},{"line_number":15,"context_line":"  - statsd_userlabel_\u003cname\u003e \u003d \u003cvalue\u003e, which supports user defined"},{"line_number":16,"context_line":"    labels with label format"},{"line_number":17,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":22,"id":"315cc3a9_f765e547","line":14,"updated":"2024-06-25 18:40:03.000000000","message":"i thought we were going to remove the `log_*` prefix from new options?","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"a0a734b73158987742caf8c9a22a24a947c1df42","unresolved":false,"context_lines":[{"line_number":11,"context_line":"Include three config options:"},{"line_number":12,"context_line":"  - log_statsd_label_mode, which specifies which label format to use"},{"line_number":13,"context_line":"  - log_statsd_emit_legacy, which dictates whether to emit old-style"},{"line_number":14,"context_line":"    metrics dotted metrics"},{"line_number":15,"context_line":"  - statsd_userlabel_\u003cname\u003e \u003d \u003cvalue\u003e, which supports user defined"},{"line_number":16,"context_line":"    labels with label format"},{"line_number":17,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":22,"id":"035a78ef_ded0371e","line":14,"in_reply_to":"315cc3a9_f765e547","updated":"2024-07-02 15:34:51.000000000","message":"Acknowledged","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"11e44436167bd0af814619080ea7811c1533ae9f","unresolved":true,"context_lines":[{"line_number":13,"context_line":"  - log_statsd_emit_legacy, which dictates whether to emit old-style"},{"line_number":14,"context_line":"    metrics dotted metrics"},{"line_number":15,"context_line":"  - statsd_userlabel_\u003cname\u003e \u003d \u003cvalue\u003e, which supports user defined"},{"line_number":16,"context_line":"    labels with label format"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: I115ffb1dc601652a979895d7944e011b951a91c1"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":22,"id":"0bec8dca_30c2390f","line":16,"updated":"2024-06-25 18:40:03.000000000","message":"there\u0027s no \"quoting\" - IIUC we restrict the user label keys and values to a single ascii \"word\" by looking for non-conforming values with regex.","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"a0a734b73158987742caf8c9a22a24a947c1df42","unresolved":false,"context_lines":[{"line_number":13,"context_line":"  - log_statsd_emit_legacy, which dictates whether to emit old-style"},{"line_number":14,"context_line":"    metrics dotted metrics"},{"line_number":15,"context_line":"  - statsd_userlabel_\u003cname\u003e \u003d \u003cvalue\u003e, which supports user defined"},{"line_number":16,"context_line":"    labels with label format"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: I115ffb1dc601652a979895d7944e011b951a91c1"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":22,"id":"9e0c9111_8958ffd7","line":16,"in_reply_to":"0bec8dca_30c2390f","updated":"2024-07-02 15:34:51.000000000","message":"Acknowledged","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"9a07b6cea740d0198eab982cf07267a13b560f12","unresolved":true,"context_lines":[{"line_number":14,"context_line":"    metrics dotted metrics"},{"line_number":15,"context_line":"  - statsd_userlabel_\u003cname\u003e \u003d \u003cvalue\u003e, which supports user defined"},{"line_number":16,"context_line":"    labels with label format"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: I115ffb1dc601652a979895d7944e011b951a91c1"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":22,"id":"7ecd5ac4_18f156eb","line":17,"updated":"2024-07-15 20:33:09.000000000","message":"Yan should have co-author line here","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"aa3d6fb7c80733c1ca9e5b515a39d00acec91c79","unresolved":false,"context_lines":[{"line_number":14,"context_line":"    metrics dotted metrics"},{"line_number":15,"context_line":"  - statsd_userlabel_\u003cname\u003e \u003d \u003cvalue\u003e, which supports user defined"},{"line_number":16,"context_line":"    labels with label format"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: I115ffb1dc601652a979895d7944e011b951a91c1"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":22,"id":"6ae72f6f_c132d093","line":17,"in_reply_to":"7ecd5ac4_18f156eb","updated":"2024-07-19 16:33:39.000000000","message":"Acknowledged","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ff3be5e397da876afc37db5f8e895e7e70e55734","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"a35eb637_376b977c","updated":"2024-02-22 16:04:46.000000000","message":"looks like a great start!  keep trying to polish up those pep8 warnings","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"4cb297a7_e8f5fc84","updated":"2024-03-14 19:39:51.000000000","message":"I think there\u0027s some new config options that should be better documented and better tested.\n\nI have some feedback on the ParsedThingConfig pattern I\u0027d like you to seriously consider.\n\nI think the functionality of the labels kwarg and label_mode functions is probably correct; but we may yet want to interate slightly on the implementation.\n\nI think there\u0027s no clear concensus on how to handle metrics names and the various prefixes and how that relates to log_name; but I do have a better understanding the current state of affairs thanks to this code going and kicking up the dust and turning over rocks.  I\u0027m confident we can build towards the concensus we want around a design we can be confident will satisfiy ops and we\u0027ll be happy to maintain - but it\u0027ll probably take a few more rounds of iteration/discussion.","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"c74705f3992929fb36f3a2d6bbbe87f57ba888f9","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"64976eb8_80f834cb","updated":"2024-03-19 22:53:38.000000000","message":"Just an inital look, loading up what\u0027s happening in label metrics land before I dig too deep 😊","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"6eeef183a57026449905c8cef525d621b0fd1d0b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"c755781f_56347218","updated":"2024-03-15 18:41:19.000000000","message":"couple of notes from today\u0027s sync discussion","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"4a5d69443a658c97f8dc12b57814767548d767e9","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":8,"id":"fe50dac1_e2f6aa70","updated":"2024-03-26 19:25:55.000000000","message":"OK, the more we push toward having labeled/legacy metrics be effectively two different APIs with separate (but overlapping) config options, the more I\u0027m on-board with this kind of an approach.\n\nI\u0027m still a little nervous about what the longer arc looks like; in my mind, it\u0027ll look like\n\n1. we get code that can write legacy metrics and some labeled metrics\n2. we enable labeled metrics in our clusters, keeping legacy metrics enabled\n3. we work with SRE to get graphs updated to reference labeled metrics, adding more and more labeled metrics as needed\n4. we turn off legacy metrics in our clusters\n5. we change swift\u0027s defaults: legacy metrics are off by default and operators are pushed to select a labeled format\n6. we deprecate legacy metrics\n7. we remove legacy metrics\n\nand I had assumed that somewhere before step 4 or 5 or so, we\u0027d want to have some assurance that all of the legacy metrics have labeled equivalents. Verifying that\u0027s the case for https://review.opendev.org/c/openstack/swift/+/910648/1/swift/common/middleware/proxy_logging.py is tedious, but I suppose not *so* difficult. Having the single call site gave us a place that we could **enforce** that later, though, if we wanted, and ensure we catch any metrics that were added by patches that were written before labeled metrics but merged after them.\n\nBut maybe it\u0027s a faulty assumption anyway -- maybe there are legacy metrics we simply don\u0027t want or need, and we\u0027d be better off just dropping them. I just want to make sure it\u0027s a conscious decision.","commit_id":"1e67567fda21b3f1197765b0f5963e6f3f3d4bc0"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4d8a78ba141d68242de96ecbace01b63a7b570cf","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":19,"id":"b7c23038_ab7e09d7","updated":"2024-06-12 20:56:37.000000000","message":"we probably don\u0027t want to try and push openstack requirements to specifically require enum34 - it\u0027s only needed for super old pythons\n\nenum34 is not in the global requirements:\n\nhttps://opendev.org/openstack/requirements/src/branch/master/global-requirements.txt\n\nwe discussed and we\u0027re going to \"just\" remove it from requirements and see how it goes - we think in all environments (py2 tests, prod) that we care about the enum34 dependency is already dragged in \"accidently\" by pykmip","commit_id":"f26b113d76c0bf78117364e932353628095f0aee"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"11e44436167bd0af814619080ea7811c1533ae9f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":22,"id":"7bfa26cb_e5af56a9","updated":"2024-06-25 18:40:03.000000000","message":"This seems to work!  The new `labels\u003d` kwarg is totaly adative, so any existing users/callers of statsd_client should continue to work without any changes... except...\n\nI\u0027m not sure how I feel about the return signature of ALL the public statsd_client methods changing; maybe no actual caller ever had any reason to look at \"bytes\" return value outside of tests?\n\nI feel like we\u0027re changing the rv mostly to satisfy the test method helper that wants to keep sending metrics until they\u0027re recieved... so that it can learn that in some cases they will NEVER be sent/recieved (i.e. `emit_legcy\u003dFalse, lables\u003dNone`) so that we can then use it to assert the metrics aren\u0027t sent?  Feels like the tail wagging the dog.\n\nI feel like the new tests added to test_statsd_client are heavily focused on the logger setup and delegation:\n\n```\n(vagrant-swift-all-in-one) clayg@banana:~/Workspace/vagrant-swift-all-in-one/swift$ git show test/unit/common/test_statsd_client.py | grep \"def test_\"\n+    def test_delegate_methods_with_labels_and_legacy_disabled(self):\n+    def test_delegate_methods_emitting_legacy_only(self):\n+    def test_delegate_methods_with_invalid_label_mode(self):\n+    def test_delegate_methods_with_labels_no_tail_prefix(self):\n+    def test_delegate_methods_with_labels_and_prefix_dogstatsd(self):\n+    def test_delegate_methods_with_labels_and_prefix_graphite(self):\n+    def test_delegate_methods_with_labels_and_prefix_influxdb(self):\n+    def test_delegate_methods_with_labels_and_prefix_librato(self):\n+    def test_delegate_methods_with_labels_and_prefix_signalfx(self):\n```\n\nshouldn\u0027t they just call get_statsd_client with the various label modes and assert the formats?  It would seem like there could be a single test (in test_utils?) that verifies the get_logger method creates an object with the appropriate \"delegate to statsd_client methods\" behavior.  I think it would be nice to see some tests of the new line format(s) with sample rate tacked on...\n\nHave you already tried adding the new py2 enum dependency to py2-constraints.txt?\n\nI don\u0027t see any tests for user_labels?  The behavior WRT the ascii/regex seems like it would be very useful to demonstrate in tests.  I\u0027m a wrong about this one I might feel differently about carrying; but the statsd api change also gives me pause and I\u0027m hoping it might be unnecessary because it\u0027d be a BIG relief and much simpler to merge/carry if this change was ONLY an *addative* API change.","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"49971256edaffded3fbbe4bceb93c03bb66306e2","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":27,"id":"ae2813ff_1d75468e","updated":"2024-07-12 12:28:17.000000000","message":"I\u0027m not convinced (yet) by the toggling of labeled vs legacy being via the ``labels`` arg. It\u0027s not very explicit and it requires that the labels arg MUST be truthy for any non-legacy metric to emit.\n\nI do realise there may not be a perfectly elegant way to introduce the labeled form alongside the legacy, but IIUC we are going to be leaving the legacy call sites as they are and then adding new calls (with a labels arg). So we could just have callers use a different StatsdClient instance the new labeled metrics, and that way make a very clear distinction between the legacy and the labeled handlers?","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"474b43c2919ab5c747f903a3b18acd91f3d5f768","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":27,"id":"b68c0fe8_948d67f5","updated":"2024-07-11 16:18:36.000000000","message":"recheck","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"9a07b6cea740d0198eab982cf07267a13b560f12","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":28,"id":"6d74d111_0f2548a2","updated":"2024-07-15 20:33:09.000000000","message":"I had some unpublished draft comments.","commit_id":"137ce227de8bd03e2493e8e4689975fade1c993d"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"e83e4e4599c665eb2ef2b9c6ef7f9755151af0c3","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":28,"id":"6dffd2ed_8c458cc8","updated":"2024-07-15 21:44:38.000000000","message":"Lot of good comments!\n\nI don\u0027t see any good reasaon we wouldn\u0027t want `statsd_userlabel_xyz` to be `statsd_user_label_xyz`\n\nI think failing to emit stats with empty labels is kind of bug, but maybe wouldn\u0027t have actually been that impactful since 1) we aren\u0027t going to turn of emit_legacy 2) we are going to always pass in some labels - still robustness principle of least surprises suggests it should be fixed [1]\n\nThe bigger issue for me is the restriction that prevents using a user label for `hostname \u003d my.host.name`; I wrote a failing test [1]\n\n1. 924183: sq: fix a bug | https://review.opendev.org/c/openstack/swift/+/924183","commit_id":"137ce227de8bd03e2493e8e4689975fade1c993d"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"6c73dd8c1e232f1daf1102296162d639e8c85583","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":28,"id":"c369a66f_d3e6f6f6","updated":"2024-07-15 19:02:11.000000000","message":"Seems safe enough to carry. The `statsd_userlabel_` vs `statsd_user_label_` question Alistair brought up could make it a little tricky for SRE later if we change it, but even then there\u0027s a way to move forward (before upgrade, make sure you\u0027ve got configs with both listed).","commit_id":"137ce227de8bd03e2493e8e4689975fade1c993d"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"db4cdb44d3c2884ebb34f429f9877dc8ff6a51ee","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":31,"id":"ed994c07_0e0b22b9","updated":"2024-07-25 15:33:35.000000000","message":"The two-class approach seem to work out ok, but it would be nice to see how it plays out in the follow on proxy_logging patch\n\nI left a suggestion to avoid bounding up and down the class hierarchy in ``_send``","commit_id":"3fbd8360649a58083520130dd6b4b2dec06265b3"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"de7842f1679ae7a04326f70c810d4ae7ed08dd8d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":33,"id":"d43acdd1_7e2df32a","updated":"2024-08-07 02:06:50.000000000","message":"Maybe no real blockers, but there is some questions inline and a slight concern about documentation.","commit_id":"d561dd39936fe17009f2eeb834e2b6599ffa0dfb"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"6ac3cbb6d8f23856c52301241b3ffdf2ecbc2123","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":33,"id":"2e2415a2_9a24cf83","updated":"2024-08-02 23:11:28.000000000","message":"this isn\u0027t used until the next patch - it doesn\u0027t seem to do any harm to the existing working metrics; I\u0027m comfortable enough with this for now.","commit_id":"d561dd39936fe17009f2eeb834e2b6599ffa0dfb"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f99f24954e7eb6d38088d94fded3c44a1329255d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":43,"id":"3ec13bf8_7cdda70e","updated":"2025-03-05 21:01:06.000000000","message":"like I was way down in\n\n```\n[Service]\nExecStart\u003d/usr/local/bin/statsd_exporter \\\n  --web.listen-address\u003d\":910%i\" \\\n  --statsd.listen-udp\u003d\":912%i\" \\\n  --statsd.listen-tcp\u003d\"\" \\\n  --log.level\u003d\"debug\" \\\n  --statsd.mapping-config\u003d\"/etc/prometheus/statsd_mapping.yaml\"\n```\n\nplaying with `nc -u 127.0.0.1 9120`\n\n```\nMar 05 20:46:04 saio statsd_exporter[20242]: ts\u003d2025-03-05T20:46:04.307Z caller\u003dlistener.go:97 level\u003ddebug msg\u003d\"Incoming line\" proto\u003dudp line\u003dasdf\nMar 05 20:46:04 saio statsd_exporter[20242]: ts\u003d2025-03-05T20:46:04.307Z caller\u003dline.go:214 level\u003ddebug msg\u003d\"Bad line from StatsD\" line\u003dasdf\n```\n\nbefore I finally realized: ok, i must not have this configured correctly.","commit_id":"c9da7202cff70a2b3d8ad15e79dc83c76f00cb60"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"ca8a986d5442eaa683a72b98e62de37e241ed16e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":46,"id":"a5d55ca4_f4666a54","updated":"2025-03-21 15:23:29.000000000","message":"The API seems to have been serving us well.\n\nMost of my comments are cleanup/style. I\u0027ve left a bunch of suggestions here https://review.opendev.org/c/openstack/swift/+/945228\n\nI\u0027m not sure what to do about the docs being forward-looking in this patch which doesn\u0027t actually use the API.\n\nI\u0027d like to invest a little more in organising the tests - they seem to already be a bit jumbled on master, so maybe some pre-factoring is needed first.","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"b08838abde9daf9270d067d77fcff08bb0a4d087","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":48,"id":"04f6e1bb_559757cb","updated":"2025-03-25 10:35:27.000000000","message":"clearing Done comments","commit_id":"99a195fe9cbef9cfcdeafd57e8e9310c02afbc89"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"d336860735ebb739a79033e92980f4384386857f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":49,"id":"ac37a439_8b86d0c4","updated":"2025-03-25 14:34:35.000000000","message":"A few more squash suggestions here https://review.opendev.org/c/openstack/swift/+/945463\n\nQuestions still remaining:\n* do we log the label mode at debug or info?\n* how do we handle the docs which make forward looking statements?\n* do we really need/want to ship support for all the mode? including signalfx which sounds obsolete?","commit_id":"d0047a8fe3f8eb702758de2d1773ba28c8c291e8"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"db7e391c83c2237e7ea7e270b0c6ebaf44bdd0c4","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":49,"id":"6b7406e7_e6296c88","updated":"2025-03-25 14:58:24.000000000","message":"I used this script https://paste.openstack.org/show/bubghPZjlrX9WwLJex46/ to emit labeled metrics to statsd exporter so that I could check the format was ok. All LGTM.\n\nnote: statsd exporter will log Malformed metrics at debug level e.g. \n\n```\nmsg\u003d\"Malformed name tag\" tag\u003dx component\u003dx\n```","commit_id":"d0047a8fe3f8eb702758de2d1773ba28c8c291e8"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"f944c1528b90a81d5e50a61169d8e03e97ea1223","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":49,"id":"a15000f0_b4e50bb2","in_reply_to":"6b7406e7_e6296c88","updated":"2025-03-25 15:01:18.000000000","message":"output from statsd exporter logging captured here https://paste.openstack.org/show/bO1qyDsTXfjjFSSW6U0w/","commit_id":"d0047a8fe3f8eb702758de2d1773ba28c8c291e8"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"f7324ad673d9a026405530d2e681e2682156992b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":52,"id":"bbdc96c2_baa7b980","updated":"2025-04-03 14:11:35.000000000","message":"added another test her https://review.opendev.org/c/openstack/swift/+/946257","commit_id":"b2b3f36512e52b7e810d40ad2b6f9b7bb0bff0ce"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0155681cc6e8a683f86ea18f95ff366b92da2532","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":53,"id":"2f929b5c_3d2d8eb7","updated":"2025-04-03 21:19:45.000000000","message":"Tests are looking better, but there\u0027s no coverage for the sample rate in labeled metrics and IIRC we\u0027d had a bug there during development of this client - I would like to put up a patch to close that before this merges, but I\u0027m out of time and it\u0027s probably fine.\n\nI don\u0027t like that the new metrics/labels docs are only reachable as a node in the admin_guide next to metrics/all - maybe we could figure out a better way to organize them from the toc in doc/source/index.rst - some docs are better than none.\n\nI don\u0027t care for the class based staticmethod dispatch; but it works.\n\nSome of the example config prose could be different, but I think it\u0027s sufficient.","commit_id":"7e5235894b4f590024d572f64ab0b3ba2b02c68b"},{"author":{"_account_id":35790,"name":"Shreeya Deshpande","email":"shreeyad@nvidia.com","username":"shreeyad"},"change_message_id":"ba56d2b747219968612618e46f692bdbd6ecfbb2","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":53,"id":"4c67ec05_cef663a0","updated":"2025-04-03 18:50:46.000000000","message":"recheck","commit_id":"7e5235894b4f590024d572f64ab0b3ba2b02c68b"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"995fdade1da8d47044fb80ab0d74d123b9e134ea","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":53,"id":"1fb80792_4412b294","updated":"2025-04-03 22:44:52.000000000","message":"turns out it\u0027s NBD - not only are there already tests for the default_sample_rate w/ labeled metrics and we never use the sample_rate kwarg - there was also no bugs.\n\nAFAICT something like:\n\n946310: tests: LabeledStatsdClient sample_rate kwarg | https://review.opendev.org/c/openstack/swift/+/946310\n\nshould be totally optional","commit_id":"7e5235894b4f590024d572f64ab0b3ba2b02c68b"}],"doc/source/metrics/labels.rst":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ff3be5e397da876afc37db5f8e895e7e70e55734","unresolved":true,"context_lines":[{"line_number":37,"context_line":"   Label Name       Meaning"},{"line_number":38,"context_line":"   ---------------- ----------------------------------------------------------"},{"line_number":39,"context_line":"   ``log_name``     The configured ``log_name`` for the code emitting the"},{"line_number":40,"context_line":"                    metric. Commonly ``proxy-server``, ``object-server``, etc."},{"line_number":41,"context_line":"   ``account``      The quoted account name associated with the metric."},{"line_number":42,"context_line":"   ``container``    The quoted container name associated with the metric."},{"line_number":43,"context_line":"   ``policy_index`` The storage policy index associated with the metric."}],"source_content_type":"text/x-rst","patch_set":1,"id":"808b007f_f4155cf4","line":40,"updated":"2024-02-22 16:04:46.000000000","message":"maybe add a note about tail_prefix?  I don\u0027t really understand how those config options interact with this label","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"b88b14f58de391e903bd8cb3bbc903924ac45ce2","unresolved":false,"context_lines":[{"line_number":37,"context_line":"   Label Name       Meaning"},{"line_number":38,"context_line":"   ---------------- ----------------------------------------------------------"},{"line_number":39,"context_line":"   ``log_name``     The configured ``log_name`` for the code emitting the"},{"line_number":40,"context_line":"                    metric. Commonly ``proxy-server``, ``object-server``, etc."},{"line_number":41,"context_line":"   ``account``      The quoted account name associated with the metric."},{"line_number":42,"context_line":"   ``container``    The quoted container name associated with the metric."},{"line_number":43,"context_line":"   ``policy_index`` The storage policy index associated with the metric."}],"source_content_type":"text/x-rst","patch_set":1,"id":"7e73feae_7dd99a7f","line":40,"in_reply_to":"808b007f_f4155cf4","updated":"2024-02-23 15:59:39.000000000","message":"Acknowledged","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"c74705f3992929fb36f3a2d6bbbe87f57ba888f9","unresolved":true,"context_lines":[{"line_number":1,"context_line":":orphan:"},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"Labeled Metrics"},{"line_number":4,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":5,"id":"8881f192_3dfe126c","line":1,"updated":"2024-03-19 22:53:38.000000000","message":"Firstly, should this be orphaned doc, or should we link it to the main index page.. or is the plan to initally have it orphaned and then we\u0027ll link it once the feature is ready?","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"50170394e9a2eab07d7c82825159949e3f510ddd","unresolved":false,"context_lines":[{"line_number":1,"context_line":":orphan:"},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"Labeled Metrics"},{"line_number":4,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":5,"id":"d2c2db9a_912967e2","line":1,"in_reply_to":"3cca5992_4a150918","updated":"2024-03-22 19:59:56.000000000","message":"Acknowledged","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"bc0b49ef784ef3e3456d7d2accb0167c16d999f8","unresolved":true,"context_lines":[{"line_number":1,"context_line":":orphan:"},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"Labeled Metrics"},{"line_number":4,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":5,"id":"3cca5992_4a150918","line":1,"in_reply_to":"8881f192_3dfe126c","updated":"2024-03-21 19:59:32.000000000","message":"Should be linked to the index page once the feature is ready","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":true,"context_lines":[{"line_number":63,"context_line":"   ``server_type``  The backend server type the proxy is communicating with."},{"line_number":64,"context_line":"                    Some possible values: ``account``, ``container``,"},{"line_number":65,"context_line":"                    ``object``, ``memcache``."},{"line_number":66,"context_line":"   \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":5,"id":"0ec0eb4a_9e17a122","line":66,"updated":"2024-03-14 19:39:51.000000000","message":"these are great; kudos!\n\nAt this point they\u0027re somewhat aspirational tho - right?  It may make more sense to document these labels when we add them in the proxy-logging patch?","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"bc0b49ef784ef3e3456d7d2accb0167c16d999f8","unresolved":true,"context_lines":[{"line_number":63,"context_line":"   ``server_type``  The backend server type the proxy is communicating with."},{"line_number":64,"context_line":"                    Some possible values: ``account``, ``container``,"},{"line_number":65,"context_line":"                    ``object``, ``memcache``."},{"line_number":66,"context_line":"   \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":5,"id":"8aec3141_41bbbde6","line":66,"in_reply_to":"0ec0eb4a_9e17a122","updated":"2024-03-21 19:59:32.000000000","message":"Good point. Should move these to proxy-logging patch.","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"50170394e9a2eab07d7c82825159949e3f510ddd","unresolved":false,"context_lines":[{"line_number":63,"context_line":"   ``server_type``  The backend server type the proxy is communicating with."},{"line_number":64,"context_line":"                    Some possible values: ``account``, ``container``,"},{"line_number":65,"context_line":"                    ``object``, ``memcache``."},{"line_number":66,"context_line":"   \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":5,"id":"f7d364de_36e294cc","line":66,"in_reply_to":"8aec3141_41bbbde6","updated":"2024-03-22 19:59:56.000000000","message":"Acknowledged","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"49971256edaffded3fbbe4bceb93c03bb66306e2","unresolved":true,"context_lines":[{"line_number":15,"context_line":"- ``signalfx``"},{"line_number":16,"context_line":"- ``graphite``"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":".. note::"},{"line_number":19,"context_line":"   Labeled metrics are still an experimental feature. Metric names and labels"},{"line_number":20,"context_line":"   may be subject to change as we explore the space."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":".. warning::"},{"line_number":23,"context_line":"   Enabling labeled metrics will likely cause a dramatic increase in the number"},{"line_number":24,"context_line":"   of distinct metrics time series. Ensure your metrics pipeline is prepared."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Here, we will try to enumerate a number of common labels and their meanings,"},{"line_number":27,"context_line":"which may be used when building graphs or relabeling metrics."},{"line_number":28,"context_line":""}],"source_content_type":"text/x-rst","patch_set":27,"id":"fdebfe6a_901f17d2","line":25,"range":{"start_line":18,"start_character":0,"end_line":25,"end_character":0},"updated":"2024-07-12 12:28:17.000000000","message":"I would suggest moving these to the top pf the section i.e. line 6","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"aa3d6fb7c80733c1ca9e5b515a39d00acec91c79","unresolved":false,"context_lines":[{"line_number":15,"context_line":"- ``signalfx``"},{"line_number":16,"context_line":"- ``graphite``"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":".. note::"},{"line_number":19,"context_line":"   Labeled metrics are still an experimental feature. Metric names and labels"},{"line_number":20,"context_line":"   may be subject to change as we explore the space."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":".. warning::"},{"line_number":23,"context_line":"   Enabling labeled metrics will likely cause a dramatic increase in the number"},{"line_number":24,"context_line":"   of distinct metrics time series. Ensure your metrics pipeline is prepared."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Here, we will try to enumerate a number of common labels and their meanings,"},{"line_number":27,"context_line":"which may be used when building graphs or relabeling metrics."},{"line_number":28,"context_line":""}],"source_content_type":"text/x-rst","patch_set":27,"id":"3a25adba_c01fbf0f","line":25,"range":{"start_line":18,"start_character":0,"end_line":25,"end_character":0},"in_reply_to":"fdebfe6a_901f17d2","updated":"2024-07-19 16:33:39.000000000","message":"Acknowledged","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"db4cdb44d3c2884ebb34f429f9877dc8ff6a51ee","unresolved":false,"context_lines":[{"line_number":15,"context_line":"- ``signalfx``"},{"line_number":16,"context_line":"- ``graphite``"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":".. note::"},{"line_number":19,"context_line":"   Labeled metrics are still an experimental feature. Metric names and labels"},{"line_number":20,"context_line":"   may be subject to change as we explore the space."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":".. warning::"},{"line_number":23,"context_line":"   Enabling labeled metrics will likely cause a dramatic increase in the number"},{"line_number":24,"context_line":"   of distinct metrics time series. Ensure your metrics pipeline is prepared."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Here, we will try to enumerate a number of common labels and their meanings,"},{"line_number":27,"context_line":"which may be used when building graphs or relabeling metrics."},{"line_number":28,"context_line":""}],"source_content_type":"text/x-rst","patch_set":27,"id":"cff683ef_5a6b3152","line":25,"range":{"start_line":18,"start_character":0,"end_line":25,"end_character":0},"in_reply_to":"fdebfe6a_901f17d2","updated":"2024-07-25 15:33:35.000000000","message":"Done","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"de7842f1679ae7a04326f70c810d4ae7ed08dd8d","unresolved":true,"context_lines":[{"line_number":48,"context_line":""},{"line_number":49,"context_line":"Note that metrics should *not* be labeled with ``object`` names -- the"},{"line_number":50,"context_line":"cardinality of objects is expected to be so high as to be problematic."},{"line_number":51,"context_line":"Some operators may even need to drop ``container`` labels to keep metric"},{"line_number":52,"context_line":"cardinalities reasonable."},{"line_number":53,"context_line":""}],"source_content_type":"text/x-rst","patch_set":33,"id":"7d455b0a_a3de3ab9","line":51,"range":{"start_line":51,"start_character":39,"end_line":51,"end_character":48},"updated":"2024-08-07 02:06:50.000000000","message":"How easy is it to drop these container labels, is it something that can be done in the swift configuration or something that needs to happen at metric collection?\n\nEDIT: Looking at the patch, should this really exist here, this patch is getting the labelled statsd client setup, not really intergrating it into swift.. that comes in a follow up patch right?","commit_id":"d561dd39936fe17009f2eeb834e2b6599ffa0dfb"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"5a4ec86f9501e46cd834db332031f2027a15c924","unresolved":false,"context_lines":[{"line_number":48,"context_line":""},{"line_number":49,"context_line":"Note that metrics should *not* be labeled with ``object`` names -- the"},{"line_number":50,"context_line":"cardinality of objects is expected to be so high as to be problematic."},{"line_number":51,"context_line":"Some operators may even need to drop ``container`` labels to keep metric"},{"line_number":52,"context_line":"cardinalities reasonable."},{"line_number":53,"context_line":""}],"source_content_type":"text/x-rst","patch_set":33,"id":"73604ecd_43c69e14","line":51,"range":{"start_line":51,"start_character":39,"end_line":51,"end_character":48},"in_reply_to":"7d455b0a_a3de3ab9","updated":"2024-09-05 15:33:20.000000000","message":"Not aware if could be done in swift config, but could happen at metric collection, for example using otel processor/metricstransformprocessor to aggregate away the \u0027container\u0027 label\n\nThis patch is for common labeled metrics API support, the follow up patch is actually for proxy-logging only","commit_id":"d561dd39936fe17009f2eeb834e2b6599ffa0dfb"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"ca8a986d5442eaa683a72b98e62de37e241ed16e","unresolved":true,"context_lines":[{"line_number":27,"context_line":"which may be used when building graphs or relabeling metrics."},{"line_number":28,"context_line":""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"Common Labels"},{"line_number":31,"context_line":"-------------"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":".. table::"}],"source_content_type":"text/x-rst","patch_set":46,"id":"0bc9e0b6_9cabc130","line":30,"updated":"2025-03-21 15:23:29.000000000","message":"I think this is useful, but with this patch there are not yet any common labels ;) or is this to be taken as prescriptive i.e. this is what we *will* use in appropriate contexts?","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"c6bffda0a663def0d97886a1de8e3b97c4514299","unresolved":false,"context_lines":[{"line_number":27,"context_line":"which may be used when building graphs or relabeling metrics."},{"line_number":28,"context_line":""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"Common Labels"},{"line_number":31,"context_line":"-------------"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":".. table::"}],"source_content_type":"text/x-rst","patch_set":46,"id":"f608f63a_eb99e0af","line":30,"in_reply_to":"0bc9e0b6_9cabc130","updated":"2025-03-26 09:09:35.000000000","message":"Done","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"ca8a986d5442eaa683a72b98e62de37e241ed16e","unresolved":true,"context_lines":[{"line_number":36,"context_line":"   \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":37,"context_line":"   Label Name       Meaning"},{"line_number":38,"context_line":"   ---------------- ----------------------------------------------------------"},{"line_number":39,"context_line":"   ``log_name``     The configured ``log_name`` for the code emitting the"},{"line_number":40,"context_line":"                    metric. Commonly ``proxy-server``, ``object-server``, etc."},{"line_number":41,"context_line":"   ``account``      The quoted account name associated with the metric."},{"line_number":42,"context_line":"   ``container``    The quoted container name associated with the metric."}],"source_content_type":"text/x-rst","patch_set":46,"id":"ae867f09_e45a84e7","line":39,"range":{"start_line":39,"start_character":4,"end_line":39,"end_character":15},"updated":"2025-03-21 15:23:29.000000000","message":"I don\u0027t see this on proxy_logging metrics","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"c6bffda0a663def0d97886a1de8e3b97c4514299","unresolved":false,"context_lines":[{"line_number":36,"context_line":"   \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":37,"context_line":"   Label Name       Meaning"},{"line_number":38,"context_line":"   ---------------- ----------------------------------------------------------"},{"line_number":39,"context_line":"   ``log_name``     The configured ``log_name`` for the code emitting the"},{"line_number":40,"context_line":"                    metric. Commonly ``proxy-server``, ``object-server``, etc."},{"line_number":41,"context_line":"   ``account``      The quoted account name associated with the metric."},{"line_number":42,"context_line":"   ``container``    The quoted container name associated with the metric."}],"source_content_type":"text/x-rst","patch_set":46,"id":"89a00de2_b2640afa","line":39,"range":{"start_line":39,"start_character":4,"end_line":39,"end_character":15},"in_reply_to":"ae867f09_e45a84e7","updated":"2025-03-26 09:09:35.000000000","message":"Done","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"ca8a986d5442eaa683a72b98e62de37e241ed16e","unresolved":true,"context_lines":[{"line_number":41,"context_line":"   ``account``      The quoted account name associated with the metric."},{"line_number":42,"context_line":"   ``container``    The quoted container name associated with the metric."},{"line_number":43,"context_line":"   ``policy_index`` The storage policy index associated with the metric."},{"line_number":44,"context_line":"   ``device``       The device name associated with the metric. This will"},{"line_number":45,"context_line":"                    likely be most useful if device names are unique"},{"line_number":46,"context_line":"                    throughout the cluster."},{"line_number":47,"context_line":"   \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":46,"id":"413b0ad8_9dc549e0","line":44,"range":{"start_line":44,"start_character":5,"end_line":44,"end_character":11},"updated":"2025-03-21 15:23:29.000000000","message":"I wouldn\u0027t expect to see this on proxy logging metrics","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"dfe995f216edbb0c8cfdf4e5914ca52cc5f1a8b1","unresolved":true,"context_lines":[{"line_number":41,"context_line":"   ``account``      The quoted account name associated with the metric."},{"line_number":42,"context_line":"   ``container``    The quoted container name associated with the metric."},{"line_number":43,"context_line":"   ``policy_index`` The storage policy index associated with the metric."},{"line_number":44,"context_line":"   ``device``       The device name associated with the metric. This will"},{"line_number":45,"context_line":"                    likely be most useful if device names are unique"},{"line_number":46,"context_line":"                    throughout the cluster."},{"line_number":47,"context_line":"   \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":46,"id":"d47faa2f_77dc766f","line":44,"range":{"start_line":44,"start_character":5,"end_line":44,"end_character":11},"in_reply_to":"413b0ad8_9dc549e0","updated":"2025-03-25 15:57:08.000000000","message":"actually, do we expect this label to be used at all given the potential large cardinality of devices?","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"c6bffda0a663def0d97886a1de8e3b97c4514299","unresolved":false,"context_lines":[{"line_number":41,"context_line":"   ``account``      The quoted account name associated with the metric."},{"line_number":42,"context_line":"   ``container``    The quoted container name associated with the metric."},{"line_number":43,"context_line":"   ``policy_index`` The storage policy index associated with the metric."},{"line_number":44,"context_line":"   ``device``       The device name associated with the metric. This will"},{"line_number":45,"context_line":"                    likely be most useful if device names are unique"},{"line_number":46,"context_line":"                    throughout the cluster."},{"line_number":47,"context_line":"   \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":46,"id":"c5f85021_450d7233","line":44,"range":{"start_line":44,"start_character":5,"end_line":44,"end_character":11},"in_reply_to":"d47faa2f_77dc766f","updated":"2025-03-26 09:09:35.000000000","message":"Done","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"dfe995f216edbb0c8cfdf4e5914ca52cc5f1a8b1","unresolved":true,"context_lines":[{"line_number":1,"context_line":":orphan:"},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"Labeled Metrics"},{"line_number":4,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":49,"id":"57329d2d_03162d36","line":1,"updated":"2025-03-25 15:57:08.000000000","message":"what does this tag mean??\n\npossibly related question - do we need to add this doc to an index?","commit_id":"d0047a8fe3f8eb702758de2d1773ba28c8c291e8"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"c6bffda0a663def0d97886a1de8e3b97c4514299","unresolved":false,"context_lines":[{"line_number":1,"context_line":":orphan:"},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"Labeled Metrics"},{"line_number":4,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":49,"id":"5a295cda_bc8529ce","line":1,"in_reply_to":"57329d2d_03162d36","updated":"2025-03-26 09:09:35.000000000","message":"this doc is now referenced from the admin guide","commit_id":"d0047a8fe3f8eb702758de2d1773ba28c8c291e8"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"dfe995f216edbb0c8cfdf4e5914ca52cc5f1a8b1","unresolved":true,"context_lines":[{"line_number":5,"context_line":""},{"line_number":6,"context_line":".. note::"},{"line_number":7,"context_line":"   Labeled metrics are still an experimental feature. Metric names and labels"},{"line_number":8,"context_line":"   may be subject to change as we explore the space."},{"line_number":9,"context_line":""},{"line_number":10,"context_line":".. warning::"},{"line_number":11,"context_line":"   Enabling labeled metrics will likely cause a dramatic increase in the number"}],"source_content_type":"text/x-rst","patch_set":49,"id":"4bb5021e_c79e6073","line":8,"updated":"2025-03-25 15:57:08.000000000","message":"we could add a note here that those of us experimenting with this are using dogstatsd\n\nand/or somewhere guide an op towards a good choice","commit_id":"d0047a8fe3f8eb702758de2d1773ba28c8c291e8"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0155681cc6e8a683f86ea18f95ff366b92da2532","unresolved":true,"context_lines":[{"line_number":5,"context_line":""},{"line_number":6,"context_line":".. note::"},{"line_number":7,"context_line":"   Labeled metrics are still an experimental feature. Metric names and labels"},{"line_number":8,"context_line":"   may be subject to change as we explore the space."},{"line_number":9,"context_line":""},{"line_number":10,"context_line":".. warning::"},{"line_number":11,"context_line":"   Enabling labeled metrics will likely cause a dramatic increase in the number"}],"source_content_type":"text/x-rst","patch_set":49,"id":"9cfd5b28_e01b94cd","line":8,"in_reply_to":"4bb5021e_c79e6073","updated":"2025-04-03 21:19:45.000000000","message":"this would probably still be a good idea to include, but could be done in a follow-up these docs as written seem complete and correct to me.","commit_id":"d0047a8fe3f8eb702758de2d1773ba28c8c291e8"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"620a85e6187559b9776648a0542cf6b86799ff24","unresolved":true,"context_lines":[{"line_number":1,"context_line":":orphan:"},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"Labeled Metrics"},{"line_number":4,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":50,"id":"118bc646_3dbe8860","line":1,"range":{"start_line":1,"start_character":0,"end_line":1,"end_character":8},"updated":"2025-03-26 15:09:53.000000000","message":"TIL, if I remove this metadata I see\n\n```\n% sphinx-build -W -b html doc/source doc/build/html\n\n...\n\nWarning, treated as error:\n/Users/acoles/0dev/openstack/swift/doc/source/metrics/labels.rst:document isn\u0027t included in any toctree\n```","commit_id":"3e01094a9b5a82c8aaa6a9bc7e16a18cb1a65f51"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0155681cc6e8a683f86ea18f95ff366b92da2532","unresolved":true,"context_lines":[{"line_number":1,"context_line":":orphan:"},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"Labeled Metrics"},{"line_number":4,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":50,"id":"5e552c8e_fae1f039","line":1,"range":{"start_line":1,"start_character":0,"end_line":1,"end_character":8},"in_reply_to":"118bc646_3dbe8860","updated":"2025-04-03 21:19:45.000000000","message":"great!  let\u0027s remove it and add it to the TOC next to the legacy metrics?","commit_id":"3e01094a9b5a82c8aaa6a9bc7e16a18cb1a65f51"}],"etc/proxy-server.conf-sample":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ff3be5e397da876afc37db5f8e895e7e70e55734","unresolved":true,"context_lines":[{"line_number":83,"context_line":"# format. In transitioning to explicitly-labeled metrics (see above), you may"},{"line_number":84,"context_line":"# want to emit *both* labeled and legacy metrics while you update graphs to"},{"line_number":85,"context_line":"# point to the new metric names; to do that set this option to True."},{"line_number":86,"context_line":"# Defaults to True if log_statsd_label_mode is \"disabled\", False otherwise."},{"line_number":87,"context_line":"# log_statsd_emit_legacy \u003d"},{"line_number":88,"context_line":"#"},{"line_number":89,"context_line":"# List of origin hosts that are allowed for CORS requests in addition to what"}],"source_content_type":"application/octet-stream","patch_set":1,"id":"6ac8579d_13aca842","line":86,"updated":"2024-02-22 16:04:46.000000000","message":"I think \"False otherwise\" is the wrong default.  If we plan a phased roll-out we\u0027ll have people enable the new tagged metrics well before we\u0027ve instrumented the whole of the code base with the new labeled metrics.\n\nI think the ability to disable legacy metrics is more of a \"down the road\" sort of feature: \"you can get everything you need and more from lableled metrics; why even continue to emit the old format you\u0027re not using\"\n\n    # now that swift is fully instrumented with labeled metrics, if you\u0027re\n    # configured log_statsd_label_mode you may want to turn off legacy statsd\n    disable_legacy_statsd \u003d True","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"b88b14f58de391e903bd8cb3bbc903924ac45ce2","unresolved":true,"context_lines":[{"line_number":83,"context_line":"# format. In transitioning to explicitly-labeled metrics (see above), you may"},{"line_number":84,"context_line":"# want to emit *both* labeled and legacy metrics while you update graphs to"},{"line_number":85,"context_line":"# point to the new metric names; to do that set this option to True."},{"line_number":86,"context_line":"# Defaults to True if log_statsd_label_mode is \"disabled\", False otherwise."},{"line_number":87,"context_line":"# log_statsd_emit_legacy \u003d"},{"line_number":88,"context_line":"#"},{"line_number":89,"context_line":"# List of origin hosts that are allowed for CORS requests in addition to what"}],"source_content_type":"application/octet-stream","patch_set":1,"id":"71f595ac_c20c68ef","line":86,"in_reply_to":"6ac8579d_13aca842","updated":"2024-02-23 15:59:39.000000000","message":"Agreed. Updating this to be an independant config parameter","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":false,"context_lines":[{"line_number":83,"context_line":"# format. In transitioning to explicitly-labeled metrics (see above), you may"},{"line_number":84,"context_line":"# want to emit *both* labeled and legacy metrics while you update graphs to"},{"line_number":85,"context_line":"# point to the new metric names; to do that set this option to True."},{"line_number":86,"context_line":"# Defaults to True if log_statsd_label_mode is \"disabled\", False otherwise."},{"line_number":87,"context_line":"# log_statsd_emit_legacy \u003d"},{"line_number":88,"context_line":"#"},{"line_number":89,"context_line":"# List of origin hosts that are allowed for CORS requests in addition to what"}],"source_content_type":"application/octet-stream","patch_set":1,"id":"bd23935e_bfd4a29a","line":86,"in_reply_to":"71f595ac_c20c68ef","updated":"2024-03-14 19:39:51.000000000","message":"Done","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":true,"context_lines":[{"line_number":41,"context_line":"# expiring_objects_account_name \u003d expiring_objects"},{"line_number":42,"context_line":"#"},{"line_number":43,"context_line":"# You can specify default log routing here if you want:"},{"line_number":44,"context_line":"# log_name \u003d swift"},{"line_number":45,"context_line":"# log_facility \u003d LOG_LOCAL0"},{"line_number":46,"context_line":"# log_level \u003d INFO"},{"line_number":47,"context_line":"# log_headers \u003d false"}],"source_content_type":"application/octet-stream","patch_set":5,"id":"4c00f5da_b7a95fb3","line":44,"updated":"2024-03-14 19:39:51.000000000","message":"I wonder how often it\u0027s the case already that ops manipulates this value hoping to effect the legacy format metric names?  I think generally people don\u0027t configure this value and accept the defaults - it\u0027s possible the coupling between an app/deamon default log_name and it\u0027s default metric name\u0027s is not well understood or might even cause some confusion.\n\nI hope that as we move into the labled metric world we find a better way to make the actual *name* of an emitted metric when looking at instrumented code path more obvious to both maintainers and ops.","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"50170394e9a2eab07d7c82825159949e3f510ddd","unresolved":false,"context_lines":[{"line_number":41,"context_line":"# expiring_objects_account_name \u003d expiring_objects"},{"line_number":42,"context_line":"#"},{"line_number":43,"context_line":"# You can specify default log routing here if you want:"},{"line_number":44,"context_line":"# log_name \u003d swift"},{"line_number":45,"context_line":"# log_facility \u003d LOG_LOCAL0"},{"line_number":46,"context_line":"# log_level \u003d INFO"},{"line_number":47,"context_line":"# log_headers \u003d false"}],"source_content_type":"application/octet-stream","patch_set":5,"id":"2a733138_575ea5f8","line":44,"in_reply_to":"2aa2e706_fe2e46b2","updated":"2024-03-22 19:59:56.000000000","message":"Acknowledged","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"bc0b49ef784ef3e3456d7d2accb0167c16d999f8","unresolved":true,"context_lines":[{"line_number":41,"context_line":"# expiring_objects_account_name \u003d expiring_objects"},{"line_number":42,"context_line":"#"},{"line_number":43,"context_line":"# You can specify default log routing here if you want:"},{"line_number":44,"context_line":"# log_name \u003d swift"},{"line_number":45,"context_line":"# log_facility \u003d LOG_LOCAL0"},{"line_number":46,"context_line":"# log_level \u003d INFO"},{"line_number":47,"context_line":"# log_headers \u003d false"}],"source_content_type":"application/octet-stream","patch_set":5,"id":"2aa2e706_fe2e46b2","line":44,"in_reply_to":"4c00f5da_b7a95fb3","updated":"2024-03-21 19:59:32.000000000","message":"log_name config is used as: default for log_route if that is not in config; default for statsd_tail_prefix if that is not specified in code; server_type in proxy-logging.\nIndeed people generally don\u0027t configure this value, which the code would use the app section name in config or \u0027swift\u0027 as default.","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"c74705f3992929fb36f3a2d6bbbe87f57ba888f9","unresolved":true,"context_lines":[{"line_number":72,"context_line":"# log_statsd_metric_prefix \u003d"},{"line_number":73,"context_line":"#"},{"line_number":74,"context_line":"# Statsd metrics may include labeling information in a variety of formats."},{"line_number":75,"context_line":"# Available options: disabled, dogstatsd, graphite, influxdb, librato, signalfx"},{"line_number":76,"context_line":"# See also: https://github.com/prometheus/statsd_exporter#tagging-extensions"},{"line_number":77,"context_line":"# Note that enabling labels will likely increase the number of time series"},{"line_number":78,"context_line":"# stored, as more labels may be exposed than may be found in metric name when"}],"source_content_type":"application/octet-stream","patch_set":5,"id":"01ed7fe4_8ce06320","line":75,"updated":"2024-03-19 22:53:38.000000000","message":"Is this where one day we\u0027ll have otel in this list?","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"bc0b49ef784ef3e3456d7d2accb0167c16d999f8","unresolved":true,"context_lines":[{"line_number":72,"context_line":"# log_statsd_metric_prefix \u003d"},{"line_number":73,"context_line":"#"},{"line_number":74,"context_line":"# Statsd metrics may include labeling information in a variety of formats."},{"line_number":75,"context_line":"# Available options: disabled, dogstatsd, graphite, influxdb, librato, signalfx"},{"line_number":76,"context_line":"# See also: https://github.com/prometheus/statsd_exporter#tagging-extensions"},{"line_number":77,"context_line":"# Note that enabling labels will likely increase the number of time series"},{"line_number":78,"context_line":"# stored, as more labels may be exposed than may be found in metric name when"}],"source_content_type":"application/octet-stream","patch_set":5,"id":"a3542fcb_83d6b2ad","line":75,"in_reply_to":"01ed7fe4_8ce06320","updated":"2024-03-21 19:59:32.000000000","message":"Indeed we should have otel support at some point. Although not sure if it\u0027s to this list, as current understanding is that otel statsd receiver seems to interpret one or any of these existing tag formats.","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"79ca9dcffb3129da088dec924c2466b33c25710b","unresolved":true,"context_lines":[{"line_number":72,"context_line":"# log_statsd_metric_prefix \u003d"},{"line_number":73,"context_line":"#"},{"line_number":74,"context_line":"# Statsd metrics may include labeling information in a variety of formats."},{"line_number":75,"context_line":"# Available options: disabled, dogstatsd, graphite, influxdb, librato, signalfx"},{"line_number":76,"context_line":"# See also: https://github.com/prometheus/statsd_exporter#tagging-extensions"},{"line_number":77,"context_line":"# Note that enabling labels will likely increase the number of time series"},{"line_number":78,"context_line":"# stored, as more labels may be exposed than may be found in metric name when"}],"source_content_type":"application/octet-stream","patch_set":5,"id":"da44bff8_c596d722","line":75,"in_reply_to":"97d6efcc_6df9367a","updated":"2024-04-05 15:33:20.000000000","message":"Thanks for pointing out dogstatsd support in otel statsd receiver, Tim. Agreed we should call out that in otel support document somewhere once we have it","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"4a5d69443a658c97f8dc12b57814767548d767e9","unresolved":true,"context_lines":[{"line_number":72,"context_line":"# log_statsd_metric_prefix \u003d"},{"line_number":73,"context_line":"#"},{"line_number":74,"context_line":"# Statsd metrics may include labeling information in a variety of formats."},{"line_number":75,"context_line":"# Available options: disabled, dogstatsd, graphite, influxdb, librato, signalfx"},{"line_number":76,"context_line":"# See also: https://github.com/prometheus/statsd_exporter#tagging-extensions"},{"line_number":77,"context_line":"# Note that enabling labels will likely increase the number of time series"},{"line_number":78,"context_line":"# stored, as more labels may be exposed than may be found in metric name when"}],"source_content_type":"application/octet-stream","patch_set":5,"id":"97d6efcc_6df9367a","line":75,"in_reply_to":"a3542fcb_83d6b2ad","updated":"2024-03-26 19:25:55.000000000","message":"Today, we can send metrics to OTel\u0027s statsd receiver with tags using `dogstatsd` -- support for it was included [in the original implementation](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/290). Actually, that might be worth calling out somewhere... I\u0027m torn about whether to say that here in the sample conf or somewhere in the docs tree, though.\n\nLonger term, we\u0027ll presumably want to include some gRPC client to push stats directly and natively, so we can target `opentelemetry-collector` instead of requiring `opentelemetry-collector-contrib`, but I don\u0027t think we\u0027ve got a particular timeline in mind yet for getting there.","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"ec8ecaccd38283b3be5deaedfb4ac65db7dcdc88","unresolved":false,"context_lines":[{"line_number":72,"context_line":"# log_statsd_metric_prefix \u003d"},{"line_number":73,"context_line":"#"},{"line_number":74,"context_line":"# Statsd metrics may include labeling information in a variety of formats."},{"line_number":75,"context_line":"# Available options: disabled, dogstatsd, graphite, influxdb, librato, signalfx"},{"line_number":76,"context_line":"# See also: https://github.com/prometheus/statsd_exporter#tagging-extensions"},{"line_number":77,"context_line":"# Note that enabling labels will likely increase the number of time series"},{"line_number":78,"context_line":"# stored, as more labels may be exposed than may be found in metric name when"}],"source_content_type":"application/octet-stream","patch_set":5,"id":"f3d8a825_690b213e","line":75,"in_reply_to":"da44bff8_c596d722","updated":"2024-07-11 16:22:43.000000000","message":"Acknowledged","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":true,"context_lines":[{"line_number":83,"context_line":"# format. Once that swift is fully instrumented with labeled metrics, if you"},{"line_number":84,"context_line":"# have log_statsd_label_mode enabled you may want to turn off legacy metrics;"},{"line_number":85,"context_line":"# to do that set this option to False. Defaults to True."},{"line_number":86,"context_line":"# log_statsd_emit_legacy \u003d"},{"line_number":87,"context_line":"#"},{"line_number":88,"context_line":"# List of origin hosts that are allowed for CORS requests in addition to what"},{"line_number":89,"context_line":"# the container has set."}],"source_content_type":"application/octet-stream","patch_set":5,"id":"6ada301b_813af761","line":86,"updated":"2024-03-14 19:39:51.000000000","message":"I\u0027m assuming the default here in the example should should be \"true\"","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"bc0b49ef784ef3e3456d7d2accb0167c16d999f8","unresolved":false,"context_lines":[{"line_number":83,"context_line":"# format. Once that swift is fully instrumented with labeled metrics, if you"},{"line_number":84,"context_line":"# have log_statsd_label_mode enabled you may want to turn off legacy metrics;"},{"line_number":85,"context_line":"# to do that set this option to False. Defaults to True."},{"line_number":86,"context_line":"# log_statsd_emit_legacy \u003d"},{"line_number":87,"context_line":"#"},{"line_number":88,"context_line":"# List of origin hosts that are allowed for CORS requests in addition to what"},{"line_number":89,"context_line":"# the container has set."}],"source_content_type":"application/octet-stream","patch_set":5,"id":"6c16bb12_5d0d8d71","line":86,"in_reply_to":"6ada301b_813af761","updated":"2024-03-21 19:59:32.000000000","message":"Acknowledged","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":true,"context_lines":[{"line_number":84,"context_line":"# have log_statsd_label_mode enabled you may want to turn off legacy metrics;"},{"line_number":85,"context_line":"# to do that set this option to False. Defaults to True."},{"line_number":86,"context_line":"# log_statsd_emit_legacy \u003d"},{"line_number":87,"context_line":"#"},{"line_number":88,"context_line":"# List of origin hosts that are allowed for CORS requests in addition to what"},{"line_number":89,"context_line":"# the container has set."},{"line_number":90,"context_line":"# Use a comma separated list of full URL (http://foo.bar:1234,https://foo.bar)"}],"source_content_type":"application/octet-stream","patch_set":5,"id":"fb5a1c8f_6d478c40","line":87,"updated":"2024-03-14 19:39:51.000000000","message":"I think this change also introduces some new userlabel config options that probably deserve some examples.","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"bc0b49ef784ef3e3456d7d2accb0167c16d999f8","unresolved":false,"context_lines":[{"line_number":84,"context_line":"# have log_statsd_label_mode enabled you may want to turn off legacy metrics;"},{"line_number":85,"context_line":"# to do that set this option to False. Defaults to True."},{"line_number":86,"context_line":"# log_statsd_emit_legacy \u003d"},{"line_number":87,"context_line":"#"},{"line_number":88,"context_line":"# List of origin hosts that are allowed for CORS requests in addition to what"},{"line_number":89,"context_line":"# the container has set."},{"line_number":90,"context_line":"# Use a comma separated list of full URL (http://foo.bar:1234,https://foo.bar)"}],"source_content_type":"application/octet-stream","patch_set":5,"id":"27745981_c5f6b637","line":87,"in_reply_to":"fb5a1c8f_6d478c40","updated":"2024-03-21 19:59:32.000000000","message":"Acknowledged","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"6eeef183a57026449905c8cef525d621b0fd1d0b","unresolved":true,"context_lines":[{"line_number":1036,"context_line":"# left-most proxy-logging is there to log requests that were handled in"},{"line_number":1037,"context_line":"# middleware and never made it through to the right-most middleware (and"},{"line_number":1038,"context_line":"# proxy server). Double logging is prevented for normal requests. See"},{"line_number":1039,"context_line":"# proxy-logging docs."},{"line_number":1040,"context_line":"#"},{"line_number":1041,"context_line":"# Hashing algorithm for log anonymization. Must be one of algorithms supported"},{"line_number":1042,"context_line":"# by Python\u0027s hashlib."}],"source_content_type":"application/octet-stream","patch_set":5,"id":"90ba5610_daa83803","line":1039,"updated":"2024-03-15 18:41:19.000000000","message":"it would be nice if these existing docs somehow described the \"recommended\" config pattern of using \"subrequest\" to deliniate instances of proxy-logging","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"50170394e9a2eab07d7c82825159949e3f510ddd","unresolved":false,"context_lines":[{"line_number":1036,"context_line":"# left-most proxy-logging is there to log requests that were handled in"},{"line_number":1037,"context_line":"# middleware and never made it through to the right-most middleware (and"},{"line_number":1038,"context_line":"# proxy server). Double logging is prevented for normal requests. See"},{"line_number":1039,"context_line":"# proxy-logging docs."},{"line_number":1040,"context_line":"#"},{"line_number":1041,"context_line":"# Hashing algorithm for log anonymization. Must be one of algorithms supported"},{"line_number":1042,"context_line":"# by Python\u0027s hashlib."}],"source_content_type":"application/octet-stream","patch_set":5,"id":"23f45f5a_aa46b8e0","line":1039,"in_reply_to":"0d40d44b_21c1ea2b","updated":"2024-03-22 19:59:56.000000000","message":"Acknowledged","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"aaa43ce00736b5d62297250c5924a2cba2c3f42a","unresolved":true,"context_lines":[{"line_number":1036,"context_line":"# left-most proxy-logging is there to log requests that were handled in"},{"line_number":1037,"context_line":"# middleware and never made it through to the right-most middleware (and"},{"line_number":1038,"context_line":"# proxy server). Double logging is prevented for normal requests. See"},{"line_number":1039,"context_line":"# proxy-logging docs."},{"line_number":1040,"context_line":"#"},{"line_number":1041,"context_line":"# Hashing algorithm for log anonymization. Must be one of algorithms supported"},{"line_number":1042,"context_line":"# by Python\u0027s hashlib."}],"source_content_type":"application/octet-stream","patch_set":5,"id":"0d40d44b_21c1ea2b","line":1039,"in_reply_to":"90ba5610_daa83803","updated":"2024-03-22 13:59:31.000000000","message":"Could consider updating existing docs in another task","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"4a5d69443a658c97f8dc12b57814767548d767e9","unresolved":true,"context_lines":[{"line_number":86,"context_line":"# log_statsd_emit_legacy \u003d True"},{"line_number":87,"context_line":"#"},{"line_number":88,"context_line":"# Statsd metrics emitted with labels also support user defined labels"},{"line_number":89,"context_line":"# configured by options. The format is:"},{"line_number":90,"context_line":"#     statsd_userlabel_\u003cname\u003e \u003d \u003cvalue\u003e"},{"line_number":91,"context_line":"# For example, a proxy-server configuration could use the following to"},{"line_number":92,"context_line":"# deliniate labeled metrics emitted by instances of proxy-logging middleware"}],"source_content_type":"application/octet-stream","patch_set":8,"id":"31960e43_e4b9cd2f","line":89,"updated":"2024-03-26 19:25:55.000000000","message":"So, what will/should happen if an operator tries to configure something like\n```\nstatsd_userlabel_container \u003d some_hardcoded_value\n```\n?\nShould we maybe force these into a namespace so we don\u0027t have to worry about collisions?","commit_id":"1e67567fda21b3f1197765b0f5963e6f3f3d4bc0"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"79ca9dcffb3129da088dec924c2466b33c25710b","unresolved":false,"context_lines":[{"line_number":86,"context_line":"# log_statsd_emit_legacy \u003d True"},{"line_number":87,"context_line":"#"},{"line_number":88,"context_line":"# Statsd metrics emitted with labels also support user defined labels"},{"line_number":89,"context_line":"# configured by options. The format is:"},{"line_number":90,"context_line":"#     statsd_userlabel_\u003cname\u003e \u003d \u003cvalue\u003e"},{"line_number":91,"context_line":"# For example, a proxy-server configuration could use the following to"},{"line_number":92,"context_line":"# deliniate labeled metrics emitted by instances of proxy-logging middleware"}],"source_content_type":"application/octet-stream","patch_set":8,"id":"9410dddd_5deff332","line":89,"in_reply_to":"31960e43_e4b9cd2f","updated":"2024-04-05 15:33:20.000000000","message":"Good point. Was actually thinking to have a namespace for example \u0027user_\u0027, similar to those in xattrs","commit_id":"1e67567fda21b3f1197765b0f5963e6f3f3d4bc0"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"4a5d69443a658c97f8dc12b57814767548d767e9","unresolved":true,"context_lines":[{"line_number":87,"context_line":"#"},{"line_number":88,"context_line":"# Statsd metrics emitted with labels also support user defined labels"},{"line_number":89,"context_line":"# configured by options. The format is:"},{"line_number":90,"context_line":"#     statsd_userlabel_\u003cname\u003e \u003d \u003cvalue\u003e"},{"line_number":91,"context_line":"# For example, a proxy-server configuration could use the following to"},{"line_number":92,"context_line":"# deliniate labeled metrics emitted by instances of proxy-logging middleware"},{"line_number":93,"context_line":"# in the pipeline:"}],"source_content_type":"application/octet-stream","patch_set":8,"id":"01f943d1_0e7c7e74","line":90,"range":{"start_line":90,"start_character":6,"end_line":90,"end_character":12},"updated":"2024-03-26 19:25:55.000000000","message":"It\u0027s a little weird that everything else to do with statsd metrics starts `log_statsd_` but this just starts `statsd_`. I get _why_ -- it has **nothing** to do with logging! -- but lacking a plan for converting *everything* to the `statsd_` option-namespace, I think I\u0027d prefer we use `log_statsd_userlabel_\u003cname\u003e \u003d \u003cvalue\u003e` and then deprecate in favor of `statsd_...` for everything later, once we *do* have that plan.","commit_id":"1e67567fda21b3f1197765b0f5963e6f3f3d4bc0"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"79ca9dcffb3129da088dec924c2466b33c25710b","unresolved":true,"context_lines":[{"line_number":87,"context_line":"#"},{"line_number":88,"context_line":"# Statsd metrics emitted with labels also support user defined labels"},{"line_number":89,"context_line":"# configured by options. The format is:"},{"line_number":90,"context_line":"#     statsd_userlabel_\u003cname\u003e \u003d \u003cvalue\u003e"},{"line_number":91,"context_line":"# For example, a proxy-server configuration could use the following to"},{"line_number":92,"context_line":"# deliniate labeled metrics emitted by instances of proxy-logging middleware"},{"line_number":93,"context_line":"# in the pipeline:"}],"source_content_type":"application/octet-stream","patch_set":8,"id":"6eb583e5_de929a53","line":90,"range":{"start_line":90,"start_character":6,"end_line":90,"end_character":12},"in_reply_to":"01f943d1_0e7c7e74","updated":"2024-04-05 15:33:20.000000000","message":"Had a discussion with other reviewers about this, probably going to deprecate \u0027log_statsd_\u0027 in another patch in favor of \u0027statsd_\u0027, then rebase this patch","commit_id":"1e67567fda21b3f1197765b0f5963e6f3f3d4bc0"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"73b6eb23671c5da2f8f4c2bd10ba59c7190c7df2","unresolved":false,"context_lines":[{"line_number":87,"context_line":"#"},{"line_number":88,"context_line":"# Statsd metrics emitted with labels also support user defined labels"},{"line_number":89,"context_line":"# configured by options. The format is:"},{"line_number":90,"context_line":"#     statsd_userlabel_\u003cname\u003e \u003d \u003cvalue\u003e"},{"line_number":91,"context_line":"# For example, a proxy-server configuration could use the following to"},{"line_number":92,"context_line":"# deliniate labeled metrics emitted by instances of proxy-logging middleware"},{"line_number":93,"context_line":"# in the pipeline:"}],"source_content_type":"application/octet-stream","patch_set":8,"id":"dd4d07f1_1f7d0e2f","line":90,"range":{"start_line":90,"start_character":6,"end_line":90,"end_character":12},"in_reply_to":"6eb583e5_de929a53","updated":"2024-04-05 16:33:15.000000000","message":"Acknowledged","commit_id":"1e67567fda21b3f1197765b0f5963e6f3f3d4bc0"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"11e44436167bd0af814619080ea7811c1533ae9f","unresolved":true,"context_lines":[{"line_number":75,"context_line":"# Available options: disabled, dogstatsd, graphite, influxdb, librato, signalfx"},{"line_number":76,"context_line":"# See also: https://github.com/prometheus/statsd_exporter#tagging-extensions"},{"line_number":77,"context_line":"# Note that enabling labels will likely increase the number of time series"},{"line_number":78,"context_line":"# stored, as more labels may be exposed than may be found in metric name when"},{"line_number":79,"context_line":"# labeling is disabled."},{"line_number":80,"context_line":"# statsd_label_mode \u003d disabled"},{"line_number":81,"context_line":"#"},{"line_number":82,"context_line":"# Historically, statsd metrics were emitted with implied labels in a \"legacy\""}],"source_content_type":"application/octet-stream","patch_set":22,"id":"a2f0134e_513429bc","line":79,"range":{"start_line":78,"start_character":10,"end_line":79,"end_character":22},"updated":"2024-06-25 18:40:03.000000000","message":"as more labeled metrics are exposed than may have been previously extracted from the dotted non-labeled legacy metric format.\n\n???","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"a0a734b73158987742caf8c9a22a24a947c1df42","unresolved":false,"context_lines":[{"line_number":75,"context_line":"# Available options: disabled, dogstatsd, graphite, influxdb, librato, signalfx"},{"line_number":76,"context_line":"# See also: https://github.com/prometheus/statsd_exporter#tagging-extensions"},{"line_number":77,"context_line":"# Note that enabling labels will likely increase the number of time series"},{"line_number":78,"context_line":"# stored, as more labels may be exposed than may be found in metric name when"},{"line_number":79,"context_line":"# labeling is disabled."},{"line_number":80,"context_line":"# statsd_label_mode \u003d disabled"},{"line_number":81,"context_line":"#"},{"line_number":82,"context_line":"# Historically, statsd metrics were emitted with implied labels in a \"legacy\""}],"source_content_type":"application/octet-stream","patch_set":22,"id":"0df2bc4c_e5f9bf8d","line":79,"range":{"start_line":78,"start_character":10,"end_line":79,"end_character":22},"in_reply_to":"a2f0134e_513429bc","updated":"2024-07-02 15:34:51.000000000","message":"Acknowledged","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"11e44436167bd0af814619080ea7811c1533ae9f","unresolved":true,"context_lines":[{"line_number":79,"context_line":"# labeling is disabled."},{"line_number":80,"context_line":"# statsd_label_mode \u003d disabled"},{"line_number":81,"context_line":"#"},{"line_number":82,"context_line":"# Historically, statsd metrics were emitted with implied labels in a \"legacy\""},{"line_number":83,"context_line":"# format. Once that swift is fully instrumented with labeled metrics, if you"},{"line_number":84,"context_line":"# have statsd_label_mode enabled you may want to turn off legacy metrics;"},{"line_number":85,"context_line":"# to do that set this option to False. Defaults to True."},{"line_number":86,"context_line":"# statsd_emit_legacy \u003d True"}],"source_content_type":"application/octet-stream","patch_set":22,"id":"5adfc294_ffe2bd18","line":83,"range":{"start_line":82,"start_character":31,"end_line":83,"end_character":8},"updated":"2024-06-25 18:40:03.000000000","message":"were emitted with implied labels as part of metric name in a dotted \"legacy\" format.","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"a0a734b73158987742caf8c9a22a24a947c1df42","unresolved":false,"context_lines":[{"line_number":79,"context_line":"# labeling is disabled."},{"line_number":80,"context_line":"# statsd_label_mode \u003d disabled"},{"line_number":81,"context_line":"#"},{"line_number":82,"context_line":"# Historically, statsd metrics were emitted with implied labels in a \"legacy\""},{"line_number":83,"context_line":"# format. Once that swift is fully instrumented with labeled metrics, if you"},{"line_number":84,"context_line":"# have statsd_label_mode enabled you may want to turn off legacy metrics;"},{"line_number":85,"context_line":"# to do that set this option to False. Defaults to True."},{"line_number":86,"context_line":"# statsd_emit_legacy \u003d True"}],"source_content_type":"application/octet-stream","patch_set":22,"id":"9b0e3f1c_dc909aee","line":83,"range":{"start_line":82,"start_character":31,"end_line":83,"end_character":8},"in_reply_to":"5adfc294_ffe2bd18","updated":"2024-07-02 15:34:51.000000000","message":"Acknowledged","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"11e44436167bd0af814619080ea7811c1533ae9f","unresolved":true,"context_lines":[{"line_number":104,"context_line":"# Note that non-labeled option \u0027log_statsd_metric_prefix\u0027 does not apply to"},{"line_number":105,"context_line":"# labeled metrics."},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"# Defaults to None."},{"line_number":108,"context_line":"#"},{"line_number":109,"context_line":"# List of origin hosts that are allowed for CORS requests in addition to what"},{"line_number":110,"context_line":"# the container has set."}],"source_content_type":"application/octet-stream","patch_set":22,"id":"4550fd8e_d0070895","line":107,"updated":"2024-06-25 18:40:03.000000000","message":"should we call out the character restriction?","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"a0a734b73158987742caf8c9a22a24a947c1df42","unresolved":false,"context_lines":[{"line_number":104,"context_line":"# Note that non-labeled option \u0027log_statsd_metric_prefix\u0027 does not apply to"},{"line_number":105,"context_line":"# labeled metrics."},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"# Defaults to None."},{"line_number":108,"context_line":"#"},{"line_number":109,"context_line":"# List of origin hosts that are allowed for CORS requests in addition to what"},{"line_number":110,"context_line":"# the container has set."}],"source_content_type":"application/octet-stream","patch_set":22,"id":"ce1e9d1b_4cc8c1f6","line":107,"in_reply_to":"4550fd8e_d0070895","updated":"2024-07-02 15:34:51.000000000","message":"Acknowledged","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"49971256edaffded3fbbe4bceb93c03bb66306e2","unresolved":true,"context_lines":[{"line_number":80,"context_line":"# statsd_label_mode \u003d disabled"},{"line_number":81,"context_line":"#"},{"line_number":82,"context_line":"# Historically, statsd metrics were emitted with implied labels as part of"},{"line_number":83,"context_line":"# metric name in a dotted \"legacy\" format. Once that swift is fully"},{"line_number":84,"context_line":"# instrumented with labeled metrics, if you have statsd_label_mode enabled you"},{"line_number":85,"context_line":"# may want to turn off legacy metrics; to do that set this option to False."},{"line_number":86,"context_line":"# Defaults to True."},{"line_number":87,"context_line":"# statsd_emit_legacy \u003d True"}],"source_content_type":"application/octet-stream","patch_set":27,"id":"234b81b8_bb7b7aae","line":84,"range":{"start_line":83,"start_character":43,"end_line":84,"end_character":35},"updated":"2024-07-12 12:28:17.000000000","message":"when does an SRE know that this is the case? Is this just referring to this being experimental, or is this referring to *all* metrics being modernized. \n\nShould anyone ever turn off legacy before we finish modernizing the entire code base?","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"e83e4e4599c665eb2ef2b9c6ef7f9755151af0c3","unresolved":true,"context_lines":[{"line_number":80,"context_line":"# statsd_label_mode \u003d disabled"},{"line_number":81,"context_line":"#"},{"line_number":82,"context_line":"# Historically, statsd metrics were emitted with implied labels as part of"},{"line_number":83,"context_line":"# metric name in a dotted \"legacy\" format. Once that swift is fully"},{"line_number":84,"context_line":"# instrumented with labeled metrics, if you have statsd_label_mode enabled you"},{"line_number":85,"context_line":"# may want to turn off legacy metrics; to do that set this option to False."},{"line_number":86,"context_line":"# Defaults to True."},{"line_number":87,"context_line":"# statsd_emit_legacy \u003d True"}],"source_content_type":"application/octet-stream","patch_set":27,"id":"d6fb9e45_974c36de","line":84,"range":{"start_line":83,"start_character":43,"end_line":84,"end_character":35},"in_reply_to":"089c4dc1_2ad8531c","updated":"2024-07-15 21:44:38.000000000","message":"\u003e Should anyone ever turn off legacy before we finish modernizing the entire code base?\n\nyou can turn off legacy as soon as you can get everything you need from labeled metrics - if all you need from your proxy-logging middleware is labeled metrics you can disable legacy metrics for *that component* immediately in the next patch.  SRE might start experimenting with just that as soon as they have some rough cuts at the new graphs based on labeled metrics up!\n\n\u003e it\u0027s unclear at what point we can safely remove the old ones.\n\nWouldn\u0027t the same have applied to removing the legacy_format kwarg?  We can\u0027t remove the non-labeled metrics instrumentation until the whole world of swift operators agrees the labeled telemetry has everything we need and more!  I expect we\u0027ll get there faster using *improved* telemetry as a carrot more than anything else.\n\n\u003e I worry that we\u0027ll be living in a dual-mode world indefinitely.\n\nNo indefinately, but at least until we have OUR clusters running with `emit_legacy \u003d False` and hear from a lot of operators they\u0027ve migrated, then we can at least change the default and deprecate it for a few years/releases.\n\nAs far as when WE can change to emit_legacy \u003d False I think it will be a negotiation with SRE depending on how quickly we can port code and they can port graphs.  I do expect to live in a duel-mode for quite some time; but it will only be \"indefinately\" if we get to the last 5-20% of metrics and decide they\u0027re not worth the effort to port to a labeled format.  Which might suck for a purity perspective, but might also indicate the practical (and correct?) necessary level of investment.  I don\u0027t think I understand how the legacy_format(s?) kwarg made any of this easier - it certainly made it harder to ensure we weren\u0027t breaking existing telemetry, and I expected it to motivate in at least some cases less well adapted new native labeled metrics.  I thought you were onboard with this approach; should we re-evaluate or can we commit?","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"6c73dd8c1e232f1daf1102296162d639e8c85583","unresolved":true,"context_lines":[{"line_number":80,"context_line":"# statsd_label_mode \u003d disabled"},{"line_number":81,"context_line":"#"},{"line_number":82,"context_line":"# Historically, statsd metrics were emitted with implied labels as part of"},{"line_number":83,"context_line":"# metric name in a dotted \"legacy\" format. Once that swift is fully"},{"line_number":84,"context_line":"# instrumented with labeled metrics, if you have statsd_label_mode enabled you"},{"line_number":85,"context_line":"# may want to turn off legacy metrics; to do that set this option to False."},{"line_number":86,"context_line":"# Defaults to True."},{"line_number":87,"context_line":"# statsd_emit_legacy \u003d True"}],"source_content_type":"application/octet-stream","patch_set":27,"id":"089c4dc1_2ad8531c","line":84,"range":{"start_line":83,"start_character":43,"end_line":84,"end_character":35},"in_reply_to":"234b81b8_bb7b7aae","updated":"2024-07-15 19:02:11.000000000","message":"I\u0027m also a little worried about how we\u0027ll know we\u0027re \"done\". It was part of why I went with the original `legacy_format`-kwarg API -- there\u0027d be a very well-defined done state: all calls have that kwarg.\n\nWith this, we\u0027re adding a bunch of new metrics, but it\u0027s unclear at what point we can safely remove the old ones. I worry that we\u0027ll be living in a dual-mode world indefinitely.","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"5a4ec86f9501e46cd834db332031f2027a15c924","unresolved":false,"context_lines":[{"line_number":80,"context_line":"# statsd_label_mode \u003d disabled"},{"line_number":81,"context_line":"#"},{"line_number":82,"context_line":"# Historically, statsd metrics were emitted with implied labels as part of"},{"line_number":83,"context_line":"# metric name in a dotted \"legacy\" format. Once that swift is fully"},{"line_number":84,"context_line":"# instrumented with labeled metrics, if you have statsd_label_mode enabled you"},{"line_number":85,"context_line":"# may want to turn off legacy metrics; to do that set this option to False."},{"line_number":86,"context_line":"# Defaults to True."},{"line_number":87,"context_line":"# statsd_emit_legacy \u003d True"}],"source_content_type":"application/octet-stream","patch_set":27,"id":"6898979c_e1803601","line":84,"range":{"start_line":83,"start_character":43,"end_line":84,"end_character":35},"in_reply_to":"d6fb9e45_974c36de","updated":"2024-09-05 15:33:20.000000000","message":"Acknowledged","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"49971256edaffded3fbbe4bceb93c03bb66306e2","unresolved":true,"context_lines":[{"line_number":88,"context_line":"#"},{"line_number":89,"context_line":"# Statsd metrics emitted with labels also support user defined labels"},{"line_number":90,"context_line":"# configured by options. The format is:"},{"line_number":91,"context_line":"#     statsd_userlabel_\u003cname\u003e \u003d \u003cvalue\u003e"},{"line_number":92,"context_line":"# where \u003cname\u003e and \u003cvalue\u003e are restricted to non-whitespace ASCII characters."},{"line_number":93,"context_line":"# For example, a proxy-server configuration could use the following to"},{"line_number":94,"context_line":"# deliniate labeled metrics emitted by instances of proxy-logging middleware"}],"source_content_type":"application/octet-stream","patch_set":27,"id":"355648a9_9b461677","line":91,"range":{"start_line":91,"start_character":13,"end_line":91,"end_character":22},"updated":"2024-07-12 12:28:17.000000000","message":"seems odd to not have user_label with an underscore","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"aa3d6fb7c80733c1ca9e5b515a39d00acec91c79","unresolved":false,"context_lines":[{"line_number":88,"context_line":"#"},{"line_number":89,"context_line":"# Statsd metrics emitted with labels also support user defined labels"},{"line_number":90,"context_line":"# configured by options. The format is:"},{"line_number":91,"context_line":"#     statsd_userlabel_\u003cname\u003e \u003d \u003cvalue\u003e"},{"line_number":92,"context_line":"# where \u003cname\u003e and \u003cvalue\u003e are restricted to non-whitespace ASCII characters."},{"line_number":93,"context_line":"# For example, a proxy-server configuration could use the following to"},{"line_number":94,"context_line":"# deliniate labeled metrics emitted by instances of proxy-logging middleware"}],"source_content_type":"application/octet-stream","patch_set":27,"id":"b76c6dfa_2ffad47e","line":91,"range":{"start_line":91,"start_character":13,"end_line":91,"end_character":22},"in_reply_to":"355648a9_9b461677","updated":"2024-07-19 16:33:39.000000000","message":"Acknowledged","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"db4cdb44d3c2884ebb34f429f9877dc8ff6a51ee","unresolved":false,"context_lines":[{"line_number":88,"context_line":"#"},{"line_number":89,"context_line":"# Statsd metrics emitted with labels also support user defined labels"},{"line_number":90,"context_line":"# configured by options. The format is:"},{"line_number":91,"context_line":"#     statsd_userlabel_\u003cname\u003e \u003d \u003cvalue\u003e"},{"line_number":92,"context_line":"# where \u003cname\u003e and \u003cvalue\u003e are restricted to non-whitespace ASCII characters."},{"line_number":93,"context_line":"# For example, a proxy-server configuration could use the following to"},{"line_number":94,"context_line":"# deliniate labeled metrics emitted by instances of proxy-logging middleware"}],"source_content_type":"application/octet-stream","patch_set":27,"id":"32e07e93_054ab27e","line":91,"range":{"start_line":91,"start_character":13,"end_line":91,"end_character":22},"in_reply_to":"355648a9_9b461677","updated":"2024-07-25 15:33:35.000000000","message":"Done","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"49971256edaffded3fbbe4bceb93c03bb66306e2","unresolved":true,"context_lines":[{"line_number":91,"context_line":"#     statsd_userlabel_\u003cname\u003e \u003d \u003cvalue\u003e"},{"line_number":92,"context_line":"# where \u003cname\u003e and \u003cvalue\u003e are restricted to non-whitespace ASCII characters."},{"line_number":93,"context_line":"# For example, a proxy-server configuration could use the following to"},{"line_number":94,"context_line":"# deliniate labeled metrics emitted by instances of proxy-logging middleware"},{"line_number":95,"context_line":"# in the pipeline:"},{"line_number":96,"context_line":"#     [filter:subrequest-logging]"},{"line_number":97,"context_line":"#     use \u003d egg:swift#proxy_logging"}],"source_content_type":"application/octet-stream","patch_set":27,"id":"98eb2fc4_274f2dc0","line":94,"range":{"start_line":94,"start_character":2,"end_line":94,"end_character":11},"updated":"2024-07-12 12:28:17.000000000","message":"spelling: delineate","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"aa3d6fb7c80733c1ca9e5b515a39d00acec91c79","unresolved":false,"context_lines":[{"line_number":91,"context_line":"#     statsd_userlabel_\u003cname\u003e \u003d \u003cvalue\u003e"},{"line_number":92,"context_line":"# where \u003cname\u003e and \u003cvalue\u003e are restricted to non-whitespace ASCII characters."},{"line_number":93,"context_line":"# For example, a proxy-server configuration could use the following to"},{"line_number":94,"context_line":"# deliniate labeled metrics emitted by instances of proxy-logging middleware"},{"line_number":95,"context_line":"# in the pipeline:"},{"line_number":96,"context_line":"#     [filter:subrequest-logging]"},{"line_number":97,"context_line":"#     use \u003d egg:swift#proxy_logging"}],"source_content_type":"application/octet-stream","patch_set":27,"id":"b85719ca_233f4649","line":94,"range":{"start_line":94,"start_character":2,"end_line":94,"end_character":11},"in_reply_to":"98eb2fc4_274f2dc0","updated":"2024-07-19 16:33:39.000000000","message":"Acknowledged","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"db4cdb44d3c2884ebb34f429f9877dc8ff6a51ee","unresolved":false,"context_lines":[{"line_number":91,"context_line":"#     statsd_userlabel_\u003cname\u003e \u003d \u003cvalue\u003e"},{"line_number":92,"context_line":"# where \u003cname\u003e and \u003cvalue\u003e are restricted to non-whitespace ASCII characters."},{"line_number":93,"context_line":"# For example, a proxy-server configuration could use the following to"},{"line_number":94,"context_line":"# deliniate labeled metrics emitted by instances of proxy-logging middleware"},{"line_number":95,"context_line":"# in the pipeline:"},{"line_number":96,"context_line":"#     [filter:subrequest-logging]"},{"line_number":97,"context_line":"#     use \u003d egg:swift#proxy_logging"}],"source_content_type":"application/octet-stream","patch_set":27,"id":"3c6c2fd3_20b88ad9","line":94,"range":{"start_line":94,"start_character":2,"end_line":94,"end_character":11},"in_reply_to":"98eb2fc4_274f2dc0","updated":"2024-07-25 15:33:35.000000000","message":"Done","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"6c73dd8c1e232f1daf1102296162d639e8c85583","unresolved":true,"context_lines":[{"line_number":89,"context_line":"# Statsd metrics emitted with labels also support user defined labels"},{"line_number":90,"context_line":"# configured by options. The format is:"},{"line_number":91,"context_line":"#     statsd_userlabel_\u003cname\u003e \u003d \u003cvalue\u003e"},{"line_number":92,"context_line":"# where \u003cname\u003e and \u003cvalue\u003e are restricted to non-whitespace ASCII characters."},{"line_number":93,"context_line":"# For example, a proxy-server configuration could use the following to"},{"line_number":94,"context_line":"# delineate labeled metrics emitted by instances of proxy-logging middleware"},{"line_number":95,"context_line":"# in the pipeline:"}],"source_content_type":"application/octet-stream","patch_set":28,"id":"4d631d9f_18156379","line":92,"range":{"start_line":92,"start_character":45,"end_line":92,"end_character":76},"updated":"2024-07-15 19:02:11.000000000","message":"This makes it sound like a bunch of potentially-bad things are allowed: `\"`, `\u0027`, `[`, `]`, `|`, `@`, `#`, `,`, `;`, `\u003d` ...\n\nFortunately, the code is currently much more restrictive, only allowing ASCII letters, numbers, and underscore. I wonder if we should be a _little_ more lenient, though -- pretty sure our main metrics store tracks dotted FQDNs for example. Maybe only allow `.` for values, though?","commit_id":"137ce227de8bd03e2493e8e4689975fade1c993d"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"e83e4e4599c665eb2ef2b9c6ef7f9755151af0c3","unresolved":true,"context_lines":[{"line_number":89,"context_line":"# Statsd metrics emitted with labels also support user defined labels"},{"line_number":90,"context_line":"# configured by options. The format is:"},{"line_number":91,"context_line":"#     statsd_userlabel_\u003cname\u003e \u003d \u003cvalue\u003e"},{"line_number":92,"context_line":"# where \u003cname\u003e and \u003cvalue\u003e are restricted to non-whitespace ASCII characters."},{"line_number":93,"context_line":"# For example, a proxy-server configuration could use the following to"},{"line_number":94,"context_line":"# delineate labeled metrics emitted by instances of proxy-logging middleware"},{"line_number":95,"context_line":"# in the pipeline:"}],"source_content_type":"application/octet-stream","patch_set":28,"id":"60002f73_adc94f37","line":92,"range":{"start_line":92,"start_character":45,"end_line":92,"end_character":76},"in_reply_to":"4d631d9f_18156379","updated":"2024-07-15 21:44:38.000000000","message":"Yes, I think SRE will expect to set\n\n```\nstatsd_user_label_hostname \u003d s8k-pdx01-k10-obj-16.nsv.pdx01.nvmetal.net\n```\n\nin each node\u0027s config.\n\nThis will blow up on them immediately:\n\n```\n+    def test_user_label_with_hostname(self):\n+        conf \u003d {\n+            \u0027log_statsd_host\u0027: \u0027myhost1\u0027,\n+            \u0027log_statsd_port\u0027: 1235,\n+            \u0027statsd_label_mode\u0027: \u0027dogstatsd\u0027,\n+            \u0027statsd_userlabel_hostname\u0027: \u0027my.host.name\u0027,\n+        }\n+        client \u003d statsd_client.get_statsd_client(conf)\n+        self.assertEqual(\u0027metric#app\u003dvalue,user_hostname\u003dmy.host.name:10|c\u0027,\n+                         client.build_line(\n+                             \u0027metric\u0027, \u002710\u0027, \u0027c\u0027, 1.0, {\u0027app\u0027: \u0027value\u0027}))\n+\n```\n\n^ raises `ValueError: invalid character in configuration \u0027statsd_userlabel_hostname\u0027 value \u0027my.host.name\u0027: \u0027.\u0027`","commit_id":"137ce227de8bd03e2493e8e4689975fade1c993d"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"aa3d6fb7c80733c1ca9e5b515a39d00acec91c79","unresolved":false,"context_lines":[{"line_number":89,"context_line":"# Statsd metrics emitted with labels also support user defined labels"},{"line_number":90,"context_line":"# configured by options. The format is:"},{"line_number":91,"context_line":"#     statsd_userlabel_\u003cname\u003e \u003d \u003cvalue\u003e"},{"line_number":92,"context_line":"# where \u003cname\u003e and \u003cvalue\u003e are restricted to non-whitespace ASCII characters."},{"line_number":93,"context_line":"# For example, a proxy-server configuration could use the following to"},{"line_number":94,"context_line":"# delineate labeled metrics emitted by instances of proxy-logging middleware"},{"line_number":95,"context_line":"# in the pipeline:"}],"source_content_type":"application/octet-stream","patch_set":28,"id":"52f3ca48_b92e67b5","line":92,"range":{"start_line":92,"start_character":45,"end_line":92,"end_character":76},"in_reply_to":"60002f73_adc94f37","updated":"2024-07-19 16:33:39.000000000","message":"Acknowledged","commit_id":"137ce227de8bd03e2493e8e4689975fade1c993d"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"6c73dd8c1e232f1daf1102296162d639e8c85583","unresolved":true,"context_lines":[{"line_number":103,"context_line":"#     [filter:subrequest-logging]"},{"line_number":104,"context_line":"#     use \u003d egg:swift#proxy_logging"},{"line_number":105,"context_line":"#     access_log_statsd_metric_prefix \u003d subrequest"},{"line_number":106,"context_line":"# Note that non-labeled option \u0027log_statsd_metric_prefix\u0027 does not apply to"},{"line_number":107,"context_line":"# labeled metrics."},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"# Defaults to None."},{"line_number":110,"context_line":"#"}],"source_content_type":"application/octet-stream","patch_set":28,"id":"6a448aae_2de7e6f3","line":107,"range":{"start_line":106,"start_character":2,"end_line":107,"end_character":18},"updated":"2024-07-15 19:02:11.000000000","message":"We should have a similar message close to the actual `log_statsd_metric_prefix` entries in the sample configs.","commit_id":"137ce227de8bd03e2493e8e4689975fade1c993d"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"aa3d6fb7c80733c1ca9e5b515a39d00acec91c79","unresolved":false,"context_lines":[{"line_number":103,"context_line":"#     [filter:subrequest-logging]"},{"line_number":104,"context_line":"#     use \u003d egg:swift#proxy_logging"},{"line_number":105,"context_line":"#     access_log_statsd_metric_prefix \u003d subrequest"},{"line_number":106,"context_line":"# Note that non-labeled option \u0027log_statsd_metric_prefix\u0027 does not apply to"},{"line_number":107,"context_line":"# labeled metrics."},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"# Defaults to None."},{"line_number":110,"context_line":"#"}],"source_content_type":"application/octet-stream","patch_set":28,"id":"72cc3869_4cc3e95c","line":107,"range":{"start_line":106,"start_character":2,"end_line":107,"end_character":18},"in_reply_to":"6a448aae_2de7e6f3","updated":"2024-07-19 16:33:39.000000000","message":"Seems this message is fairly close to the log_statsd_metric_prefix entries","commit_id":"137ce227de8bd03e2493e8e4689975fade1c993d"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"de7842f1679ae7a04326f70c810d4ae7ed08dd8d","unresolved":true,"context_lines":[{"line_number":89,"context_line":"# Statsd metrics emitted with labels also support user defined labels"},{"line_number":90,"context_line":"# configured by options. The format is:"},{"line_number":91,"context_line":"#     statsd_user_label_\u003cname\u003e \u003d \u003cvalue\u003e"},{"line_number":92,"context_line":"# where \u003cname\u003e and \u003cvalue\u003e are restricted to non-whitespace ASCII characters."},{"line_number":93,"context_line":"# For example, a proxy-server configuration could use the following to"},{"line_number":94,"context_line":"# delineate labeled metrics emitted by instances of proxy-logging middleware"},{"line_number":95,"context_line":"# in the pipeline:"}],"source_content_type":"application/octet-stream","patch_set":33,"id":"3dd94349_90cb6108","line":92,"updated":"2024-08-07 02:06:50.000000000","message":"This isn\u0027t completely true as the regex\u0027s seem to be:\n\n    USER_LABEL_PATTERN \u003d re.compile(r\"[^0-9a-zA-Z_]\")\n    USER_VALUE_PATTERN \u003d re.compile(r\"[^0-9a-zA-Z_.]\")\n\nWhich we use to check for incorrect characters. And the value seems to support the \u0027.\u0027 and not the label.\nWe do probably need to be more expclicit with what we support, if not here at least in the main documentation.\n\n    # where \u003cname\u003e and \u003cvalue\u003e are restricted to a subset of non-whitespace ASCII\n    # characters, both can include letters (upper and lower), numbers and underscores.\n    # Value may also contain a period (.).\n    \nOr something?","commit_id":"d561dd39936fe17009f2eeb834e2b6599ffa0dfb"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"5a4ec86f9501e46cd834db332031f2027a15c924","unresolved":false,"context_lines":[{"line_number":89,"context_line":"# Statsd metrics emitted with labels also support user defined labels"},{"line_number":90,"context_line":"# configured by options. The format is:"},{"line_number":91,"context_line":"#     statsd_user_label_\u003cname\u003e \u003d \u003cvalue\u003e"},{"line_number":92,"context_line":"# where \u003cname\u003e and \u003cvalue\u003e are restricted to non-whitespace ASCII characters."},{"line_number":93,"context_line":"# For example, a proxy-server configuration could use the following to"},{"line_number":94,"context_line":"# delineate labeled metrics emitted by instances of proxy-logging middleware"},{"line_number":95,"context_line":"# in the pipeline:"}],"source_content_type":"application/octet-stream","patch_set":33,"id":"6941610f_03466459","line":92,"in_reply_to":"3dd94349_90cb6108","updated":"2024-09-05 15:33:20.000000000","message":"Acknowledged","commit_id":"d561dd39936fe17009f2eeb834e2b6599ffa0dfb"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"ca8a986d5442eaa683a72b98e62de37e241ed16e","unresolved":true,"context_lines":[{"line_number":69,"context_line":"# log_statsd_sample_rate_factor \u003d 1.0"},{"line_number":70,"context_line":"# log_statsd_metric_prefix \u003d"},{"line_number":71,"context_line":"#"},{"line_number":72,"context_line":"# Statsd metrics may include labeling information in a variety of formats."},{"line_number":73,"context_line":"# Available options: disabled, dogstatsd, graphite, influxdb, librato, signalfx"},{"line_number":74,"context_line":"# See also: https://github.com/prometheus/statsd_exporter#tagging-extensions"},{"line_number":75,"context_line":"# Note that enabling labels will likely increase the number of time series"}],"source_content_type":"application/octet-stream","patch_set":46,"id":"d1a5e25f_9fab0a9a","line":72,"updated":"2025-03-21 15:23:29.000000000","message":"this sample conf text gets modified in the next patch (my bad, I didn\u0027t realise it was actually added in this patch)\n\nWe should probably pull the modified version forwards to here","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"d336860735ebb739a79033e92980f4384386857f","unresolved":false,"context_lines":[{"line_number":69,"context_line":"# log_statsd_sample_rate_factor \u003d 1.0"},{"line_number":70,"context_line":"# log_statsd_metric_prefix \u003d"},{"line_number":71,"context_line":"#"},{"line_number":72,"context_line":"# Statsd metrics may include labeling information in a variety of formats."},{"line_number":73,"context_line":"# Available options: disabled, dogstatsd, graphite, influxdb, librato, signalfx"},{"line_number":74,"context_line":"# See also: https://github.com/prometheus/statsd_exporter#tagging-extensions"},{"line_number":75,"context_line":"# Note that enabling labels will likely increase the number of time series"}],"source_content_type":"application/octet-stream","patch_set":46,"id":"179b2866_3c8a1eee","line":72,"in_reply_to":"d1a5e25f_9fab0a9a","updated":"2025-03-25 14:34:35.000000000","message":"Done","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"ca8a986d5442eaa683a72b98e62de37e241ed16e","unresolved":true,"context_lines":[{"line_number":104,"context_line":"#     use \u003d egg:swift#proxy_logging"},{"line_number":105,"context_line":"#     access_log_statsd_metric_prefix \u003d subrequest"},{"line_number":106,"context_line":"# Note that non-labeled option \u0027log_statsd_metric_prefix\u0027 does not apply to"},{"line_number":107,"context_line":"# labeled metrics."},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"# Defaults to None."},{"line_number":110,"context_line":"#"}],"source_content_type":"application/octet-stream","patch_set":46,"id":"089c0f95_f8933598","line":107,"updated":"2025-03-21 15:23:29.000000000","message":"This is only going to be true once we have added labeled statsd client to middlewares. Perhaps we should maintain a list of middlewares that support label metrics here? At least until it becomes more universal.","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"620a85e6187559b9776648a0542cf6b86799ff24","unresolved":false,"context_lines":[{"line_number":104,"context_line":"#     use \u003d egg:swift#proxy_logging"},{"line_number":105,"context_line":"#     access_log_statsd_metric_prefix \u003d subrequest"},{"line_number":106,"context_line":"# Note that non-labeled option \u0027log_statsd_metric_prefix\u0027 does not apply to"},{"line_number":107,"context_line":"# labeled metrics."},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"# Defaults to None."},{"line_number":110,"context_line":"#"}],"source_content_type":"application/octet-stream","patch_set":46,"id":"9a202b24_95f2e71d","line":107,"in_reply_to":"089c0f95_f8933598","updated":"2025-03-26 15:09:53.000000000","message":"Done","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0155681cc6e8a683f86ea18f95ff366b92da2532","unresolved":true,"context_lines":[{"line_number":73,"context_line":"# Available options:"},{"line_number":74,"context_line":"#     disabled, dogstatsd, graphite, influxdb, librato, signalfx."},{"line_number":75,"context_line":"# Defaults to disabled; enable statsd_label_mode by setting another option."},{"line_number":76,"context_line":"# See also: https://github.com/prometheus/statsd_exporter#tagging-extensions."},{"line_number":77,"context_line":"# Note that enabling statsd_label_mode will likely increase the number of time"},{"line_number":78,"context_line":"# series stored, as more labeled metrics may be exposed than may have been"},{"line_number":79,"context_line":"# previously extracted from the dotted non-labeled legacy metric format."}],"source_content_type":"application/octet-stream","patch_set":53,"id":"64269146_32a03ba4","line":76,"updated":"2025-04-03 21:19:45.000000000","message":"by setting another s/option/value/","commit_id":"7e5235894b4f590024d572f64ab0b3ba2b02c68b"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0155681cc6e8a683f86ea18f95ff366b92da2532","unresolved":true,"context_lines":[{"line_number":76,"context_line":"# See also: https://github.com/prometheus/statsd_exporter#tagging-extensions."},{"line_number":77,"context_line":"# Note that enabling statsd_label_mode will likely increase the number of time"},{"line_number":78,"context_line":"# series stored, as more labeled metrics may be exposed than may have been"},{"line_number":79,"context_line":"# previously extracted from the dotted non-labeled legacy metric format."},{"line_number":80,"context_line":"# statsd_label_mode \u003d disabled"},{"line_number":81,"context_line":"#"},{"line_number":82,"context_line":"# Historically, statsd metrics were emitted with implied labels as part of"}],"source_content_type":"application/octet-stream","patch_set":53,"id":"d0c0cab6_6b60f8be","line":79,"updated":"2025-04-03 21:19:45.000000000","message":"I think the note starting @ L76 can go, it\u0027s duplicated with docs and seems more appropriate *there*","commit_id":"7e5235894b4f590024d572f64ab0b3ba2b02c68b"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0155681cc6e8a683f86ea18f95ff366b92da2532","unresolved":true,"context_lines":[{"line_number":84,"context_line":"# with labeled metrics, and you have statsd_label_mode enabled, you may want to"},{"line_number":85,"context_line":"# turn off legacy metrics; to do that set this option to False. Defaults to"},{"line_number":86,"context_line":"# True."},{"line_number":87,"context_line":"# statsd_emit_legacy \u003d True"},{"line_number":88,"context_line":"#"},{"line_number":89,"context_line":"# Statsd metrics emitted with labels also support user defined labels"},{"line_number":90,"context_line":"# configured by options. The format for each option is:"}],"source_content_type":"application/octet-stream","patch_set":53,"id":"4b5def0b_242bfb34","line":87,"updated":"2025-04-03 21:19:45.000000000","message":"Currently a lot of swift\u0027s essential telemetry is emitted with implied labels as part of metric name in a dotted \"legacy\" format.  All of the legacy metrics will continue to be emitted by default, but new telemetry will require a statsd_label_mode.  You can disable \"legacy\" metrics on individual services or middleware by setting statsd_emit_legacy to False in just their config section, which may be useful in testing/debugging new metrics - but you should not change the DEFAULT if you currently use the existing statsd metrics in prod.\nstatsd_emit_legacy \u003d True","commit_id":"7e5235894b4f590024d572f64ab0b3ba2b02c68b"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0155681cc6e8a683f86ea18f95ff366b92da2532","unresolved":true,"context_lines":[{"line_number":91,"context_line":"#     statsd_user_label_\u003cname\u003e \u003d \u003cvalue\u003e"},{"line_number":92,"context_line":"# where \u003cname\u003e and \u003cvalue\u003e are restricted to a subset of non-whitespace ASCII"},{"line_number":93,"context_line":"# characters, including letters (upper and lower), numbers and underscores."},{"line_number":94,"context_line":"# \u003cvalue\u003e may also contain the period character (.). Each option will add a"},{"line_number":95,"context_line":"# label with name user_\u003cname\u003e and value \u003cvalue\u003e to labeled metrics."},{"line_number":96,"context_line":"# User defined labels may be configured in this [DEFAULT] section, in which"},{"line_number":97,"context_line":"# case they will be included with every labeled metric, or they may be"}],"source_content_type":"application/octet-stream","patch_set":53,"id":"54d4a49b_377c6f85","line":94,"updated":"2025-04-03 21:19:45.000000000","message":"\u003e \u003cvalue\u003e may also contain the period character (.)\n\nI best this was for Host name\n\n-----\n\n\nThe format for each option is:\n    statsd_user_label_\u003cname\u003e \u003d \u003cvalue\u003e\nEach option will add a label with name user_\u003cname\u003e and value \u003cvalue\u003e to labeled metrics. e.g.\n    statsd_user_label_host \u003d myhost.example.com\nNote there is a restricted character set for both \u003cname\u003e and \u003cvalue\u003e.\n\u003cname\u003e :\u003d ASCII letters (upper and lower), number digits, and underscores\n\u003cvalue\u003e :\u003d  ASCII letters (upper and lower), number digits, underscores, and periods","commit_id":"7e5235894b4f590024d572f64ab0b3ba2b02c68b"}],"swift/common/statsd_client.py":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"e5f9944084aee68c842028f65508d40ea36d37a7","unresolved":true,"context_lines":[{"line_number":99,"context_line":"    \"\"\""},{"line_number":100,"context_line":"    Get an instance of StatsdClient using config settings."},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    **Log config and defaults**::"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        log_statsd_host \u003d (disabled)"},{"line_number":105,"context_line":"        log_statsd_port \u003d 8125"}],"source_content_type":"text/x-python","patch_set":19,"id":"c9840c86_3ad197e8","line":102,"range":{"start_line":102,"start_character":6,"end_line":102,"end_character":9},"updated":"2024-06-13 08:24:40.000000000","message":"why is this described as *Log* config?","commit_id":"f26b113d76c0bf78117364e932353628095f0aee"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"571a73a77c96627c40c6a6d312b37a6a009afd43","unresolved":false,"context_lines":[{"line_number":99,"context_line":"    \"\"\""},{"line_number":100,"context_line":"    Get an instance of StatsdClient using config settings."},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    **Log config and defaults**::"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        log_statsd_host \u003d (disabled)"},{"line_number":105,"context_line":"        log_statsd_port \u003d 8125"}],"source_content_type":"text/x-python","patch_set":19,"id":"d687b3f9_6e7e58b2","line":102,"range":{"start_line":102,"start_character":6,"end_line":102,"end_character":9},"in_reply_to":"c9840c86_3ad197e8","updated":"2024-06-18 15:35:42.000000000","message":"Ack, updated the description","commit_id":"f26b113d76c0bf78117364e932353628095f0aee"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"e5f9944084aee68c842028f65508d40ea36d37a7","unresolved":true,"context_lines":[{"line_number":106,"context_line":"        log_statsd_default_sample_rate \u003d 1.0"},{"line_number":107,"context_line":"        log_statsd_sample_rate_factor \u003d 1.0"},{"line_number":108,"context_line":"        log_statsd_metric_prefix \u003d (empty-string)"},{"line_number":109,"context_line":"        log_statsd_label_mode \u003d disabled"},{"line_number":110,"context_line":"        log_statsd_emit_legacy \u003d true"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    :param conf: Configuration dict to read settings from"}],"source_content_type":"text/x-python","patch_set":19,"id":"0d15ae4d_d2bdcd9f","line":109,"updated":"2024-06-13 08:24:40.000000000","message":"I don\u0027t really like that there\u0027s a doctsring here that is modified for a change that is made in the class below - can we move the docstring to the class?\n\nIf I want to know the interface for StatsdClient I am going to look at StatsdClient.","commit_id":"f26b113d76c0bf78117364e932353628095f0aee"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"571a73a77c96627c40c6a6d312b37a6a009afd43","unresolved":false,"context_lines":[{"line_number":106,"context_line":"        log_statsd_default_sample_rate \u003d 1.0"},{"line_number":107,"context_line":"        log_statsd_sample_rate_factor \u003d 1.0"},{"line_number":108,"context_line":"        log_statsd_metric_prefix \u003d (empty-string)"},{"line_number":109,"context_line":"        log_statsd_label_mode \u003d disabled"},{"line_number":110,"context_line":"        log_statsd_emit_legacy \u003d true"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    :param conf: Configuration dict to read settings from"}],"source_content_type":"text/x-python","patch_set":19,"id":"e2490e45_aeae6eef","line":109,"in_reply_to":"0d15ae4d_d2bdcd9f","updated":"2024-06-18 15:35:42.000000000","message":"Changed the config parsing to get_statsd_client per our discussion","commit_id":"f26b113d76c0bf78117364e932353628095f0aee"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"e5f9944084aee68c842028f65508d40ea36d37a7","unresolved":true,"context_lines":[{"line_number":107,"context_line":"        log_statsd_sample_rate_factor \u003d 1.0"},{"line_number":108,"context_line":"        log_statsd_metric_prefix \u003d (empty-string)"},{"line_number":109,"context_line":"        log_statsd_label_mode \u003d disabled"},{"line_number":110,"context_line":"        log_statsd_emit_legacy \u003d true"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    :param conf: Configuration dict to read settings from"},{"line_number":113,"context_line":"    :param statsd_tail_prefix: tail prefix to pass to statsd client"}],"source_content_type":"text/x-python","patch_set":19,"id":"96741b29_c0fa8e3c","line":110,"updated":"2024-06-13 08:24:40.000000000","message":"why persist in using the log_* prefix for *new* options?","commit_id":"f26b113d76c0bf78117364e932353628095f0aee"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"571a73a77c96627c40c6a6d312b37a6a009afd43","unresolved":false,"context_lines":[{"line_number":107,"context_line":"        log_statsd_sample_rate_factor \u003d 1.0"},{"line_number":108,"context_line":"        log_statsd_metric_prefix \u003d (empty-string)"},{"line_number":109,"context_line":"        log_statsd_label_mode \u003d disabled"},{"line_number":110,"context_line":"        log_statsd_emit_legacy \u003d true"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    :param conf: Configuration dict to read settings from"},{"line_number":113,"context_line":"    :param statsd_tail_prefix: tail prefix to pass to statsd client"}],"source_content_type":"text/x-python","patch_set":19,"id":"6a60b0c2_095c5b7f","line":110,"in_reply_to":"96741b29_c0fa8e3c","updated":"2024-06-18 15:35:42.000000000","message":"Updated the log_ prefix per our discussion","commit_id":"f26b113d76c0bf78117364e932353628095f0aee"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4d8a78ba141d68242de96ecbace01b63a7b570cf","unresolved":true,"context_lines":[{"line_number":131,"context_line":"        self.sample_rate_factor \u003d float(conf.get("},{"line_number":132,"context_line":"            \u0027log_statsd_sample_rate_factor\u0027, 1))"},{"line_number":133,"context_line":"        label_mode \u003d conf.get("},{"line_number":134,"context_line":"            \u0027log_statsd_label_mode\u0027, LabelModes.DISABLED.value).lower()"},{"line_number":135,"context_line":"        self.emit_legacy \u003d config_true_value(conf.get("},{"line_number":136,"context_line":"            \u0027log_statsd_emit_legacy\u0027, \u0027true\u0027))"},{"line_number":137,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"661800f3_6bf43750","line":134,"updated":"2024-06-12 20:56:37.000000000","message":"it *would* probably be fine just to have LABEL_MODE_DISABLED, etc constants at the top","commit_id":"f26b113d76c0bf78117364e932353628095f0aee"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"ec8ecaccd38283b3be5deaedfb4ac65db7dcdc88","unresolved":false,"context_lines":[{"line_number":131,"context_line":"        self.sample_rate_factor \u003d float(conf.get("},{"line_number":132,"context_line":"            \u0027log_statsd_sample_rate_factor\u0027, 1))"},{"line_number":133,"context_line":"        label_mode \u003d conf.get("},{"line_number":134,"context_line":"            \u0027log_statsd_label_mode\u0027, LabelModes.DISABLED.value).lower()"},{"line_number":135,"context_line":"        self.emit_legacy \u003d config_true_value(conf.get("},{"line_number":136,"context_line":"            \u0027log_statsd_emit_legacy\u0027, \u0027true\u0027))"},{"line_number":137,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"9ba4efc8_3d1b06d2","line":134,"in_reply_to":"661800f3_6bf43750","updated":"2024-07-11 16:22:43.000000000","message":"Acknowledged","commit_id":"f26b113d76c0bf78117364e932353628095f0aee"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"11e44436167bd0af814619080ea7811c1533ae9f","unresolved":true,"context_lines":[{"line_number":163,"context_line":"            if self.random() \u003c sample_rate:"},{"line_number":164,"context_line":"                parts.append(\u0027@%s\u0027 % (sample_rate,))"},{"line_number":165,"context_line":"            else:"},{"line_number":166,"context_line":"                return"},{"line_number":167,"context_line":"        if six.PY3:"},{"line_number":168,"context_line":"            parts \u003d [part.encode(\u0027utf-8\u0027) for part in parts]"},{"line_number":169,"context_line":"        # Ideally, we\u0027d cache a sending socket in self, but that"}],"source_content_type":"text/x-python","patch_set":22,"id":"9725952e_b1f0dcf5","side":"PARENT","line":166,"updated":"2024-06-25 18:40:03.000000000","message":"so previously we returned `None` to indicate no value was sent...","commit_id":"a21d078009e2750b8a513dd9f832723c3b51dbe0"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"a0a734b73158987742caf8c9a22a24a947c1df42","unresolved":false,"context_lines":[{"line_number":163,"context_line":"            if self.random() \u003c sample_rate:"},{"line_number":164,"context_line":"                parts.append(\u0027@%s\u0027 % (sample_rate,))"},{"line_number":165,"context_line":"            else:"},{"line_number":166,"context_line":"                return"},{"line_number":167,"context_line":"        if six.PY3:"},{"line_number":168,"context_line":"            parts \u003d [part.encode(\u0027utf-8\u0027) for part in parts]"},{"line_number":169,"context_line":"        # Ideally, we\u0027d cache a sending socket in self, but that"}],"source_content_type":"text/x-python","patch_set":22,"id":"079fcc56_bf3b3674","side":"PARENT","line":166,"in_reply_to":"9725952e_b1f0dcf5","updated":"2024-07-02 15:34:51.000000000","message":"Acknowledged","commit_id":"a21d078009e2750b8a513dd9f832723c3b51dbe0"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"11e44436167bd0af814619080ea7811c1533ae9f","unresolved":true,"context_lines":[{"line_number":19,"context_line":"import warnings"},{"line_number":20,"context_line":"import re"},{"line_number":21,"context_line":"from contextlib import closing"},{"line_number":22,"context_line":"from enum import Enum"},{"line_number":23,"context_line":"from random import random"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"from eventlet.green import socket"}],"source_content_type":"text/x-python","patch_set":22,"id":"4bdabedb_73879f8d","line":22,"updated":"2024-06-25 18:40:03.000000000","message":"I thought we decided this was only sort of accidently installed on py2 because of some transative dep?  It\u0027s a built-in in py3, but as long as we \"support\" py2 it\u0027d be *nice* if we could enumerate our dependencies.\n\nIIRC the \"problem\" seemed to be adding the dependency to constraints directly tripped the openstack global dependency check (since openstack only \"officially\" supports py3) - but IIUC we work around this with out *other* py2 exclusive dependencies by adding the package to py2-constraints.txt\n\nShould we try to add `enum34\u003d\u003d1.1.10` to that file?","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"b5e54c1773625fa7085a57cf1e7a328c15c62c01","unresolved":true,"context_lines":[{"line_number":19,"context_line":"import warnings"},{"line_number":20,"context_line":"import re"},{"line_number":21,"context_line":"from contextlib import closing"},{"line_number":22,"context_line":"from enum import Enum"},{"line_number":23,"context_line":"from random import random"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"from eventlet.green import socket"}],"source_content_type":"text/x-python","patch_set":22,"id":"ceebaf76_2f8ab399","line":22,"in_reply_to":"28fba76e_d8658046","updated":"2024-07-15 22:33:53.000000000","message":"Looks like [`cryptography` will still take care of it for us](https://github.com/pyca/cryptography/blob/3.3.2/setup.py#L88)?","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"a0a734b73158987742caf8c9a22a24a947c1df42","unresolved":true,"context_lines":[{"line_number":19,"context_line":"import warnings"},{"line_number":20,"context_line":"import re"},{"line_number":21,"context_line":"from contextlib import closing"},{"line_number":22,"context_line":"from enum import Enum"},{"line_number":23,"context_line":"from random import random"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"from eventlet.green import socket"}],"source_content_type":"text/x-python","patch_set":22,"id":"b45d5baa_9d600ba7","line":22,"in_reply_to":"4bdabedb_73879f8d","updated":"2024-07-02 15:34:51.000000000","message":"There is an existing enum-compat\u003d\u003d\u003d0.0.3 in that file. Would that be sufficient?","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"6c73dd8c1e232f1daf1102296162d639e8c85583","unresolved":true,"context_lines":[{"line_number":19,"context_line":"import warnings"},{"line_number":20,"context_line":"import re"},{"line_number":21,"context_line":"from contextlib import closing"},{"line_number":22,"context_line":"from enum import Enum"},{"line_number":23,"context_line":"from random import random"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"from eventlet.green import socket"}],"source_content_type":"text/x-python","patch_set":22,"id":"f562c612_dc927da7","line":22,"in_reply_to":"b45d5baa_9d600ba7","updated":"2024-07-15 19:02:11.000000000","message":"Looking at the passing py2 job, `enum34` is getting installed [to satisfy eventlet](https://github.com/eventlet/eventlet/blob/v0.25.2/setup.py#L19) which [we\u0027ve pinned on a pretty old version](https://github.com/openstack/swift/blob/2.33.0/py2-constraints.txt#L18). There are more recent versions of eventlet that still work on py2, though, and [not all of them seem to require `enum34`](https://github.com/eventlet/eventlet/blob/v0.33.3/setup.py#L20-L25).\n\nWe almost certainly *should* ensure `enum34` is listed in `py2-contraints.txt` and `lower-contraints.txt`, but I don\u0027t think that it will be sufficient to ensure it gets installed correctly in all cases.\n\nSide note: one thing I rather wish `pip` had an option for is to error loudly if you specified a constraint file and some dependency got pulled in that **wasn\u0027t** listed in it...","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"e43a4057d59c9076188081ebedb15a20f47c2407","unresolved":true,"context_lines":[{"line_number":19,"context_line":"import warnings"},{"line_number":20,"context_line":"import re"},{"line_number":21,"context_line":"from contextlib import closing"},{"line_number":22,"context_line":"from enum import Enum"},{"line_number":23,"context_line":"from random import random"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"from eventlet.green import socket"}],"source_content_type":"text/x-python","patch_set":22,"id":"28fba76e_d8658046","line":22,"in_reply_to":"b4c5d7c8_cd2552d7","updated":"2024-07-15 22:19:34.000000000","message":"`enum-compat` *depends upon* `enum34`, but only for py2.\n\nThe constraints files only ensure that a particular version will get installed *if it would otherwise get installed* -- the concern I\u0027ve got is that if you\u0027re running Swift on py2 with `eventlet` 2.26.0+ [which doesn\u0027t depend upon `enum34`/`enum-compat`](https://github.com/eventlet/eventlet/blob/v0.26.0/setup.py#L17-L22), you might not already have `enum34` installed and upgrading Swift will pop import errors.\n\nWho knows, though? Maybe something else just happens to pull it in, too. I\u0027ll dig through the logs on https://review.opendev.org/c/openstack/swift/+/924187 once the py2 job comes back.\n\nThe long and short of it is that if we\u0027re going to do the importing, it\u0027s rather on us to declare the dependency. FWIW, I hate that I didn\u0027t have any better way to work around the requirements-check job [the last time this sort of thing reared its head](https://github.com/openstack/swift/blob/2.33.0/requirements.txt#L15-L22).","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"aa3d6fb7c80733c1ca9e5b515a39d00acec91c79","unresolved":false,"context_lines":[{"line_number":19,"context_line":"import warnings"},{"line_number":20,"context_line":"import re"},{"line_number":21,"context_line":"from contextlib import closing"},{"line_number":22,"context_line":"from enum import Enum"},{"line_number":23,"context_line":"from random import random"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"from eventlet.green import socket"}],"source_content_type":"text/x-python","patch_set":22,"id":"e4b34abc_79344f90","line":22,"in_reply_to":"ceebaf76_2f8ab399","updated":"2024-07-19 16:33:39.000000000","message":"Thanks Tim for looking at this! Removed enum per suggestion","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"e83e4e4599c665eb2ef2b9c6ef7f9755151af0c3","unresolved":true,"context_lines":[{"line_number":19,"context_line":"import warnings"},{"line_number":20,"context_line":"import re"},{"line_number":21,"context_line":"from contextlib import closing"},{"line_number":22,"context_line":"from enum import Enum"},{"line_number":23,"context_line":"from random import random"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"from eventlet.green import socket"}],"source_content_type":"text/x-python","patch_set":22,"id":"b4c5d7c8_cd2552d7","line":22,"in_reply_to":"f562c612_dc927da7","updated":"2024-07-15 21:44:38.000000000","message":"yes, I think enum-compat *is* enum34\n\nhttps://pypi.org/project/enum-compat/#history\n\nthe existing line in py2-constaints is possible sufficient?\n\nin `lower-constraints` we have `enum-compat\u003d\u003d0.0.2`\n\nTim, aside from `pip` not having all the options you want - do you think our existing py2 dependencies already enumerate (heh) the need for this package and we can safely use py3\u0027s native Enum classes?  Or can you explain the difference between `enum-compat` and `enum34` being listed in `py2-constraints`/`lower-constraints`?","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"11e44436167bd0af814619080ea7811c1533ae9f","unresolved":true,"context_lines":[{"line_number":133,"context_line":"    if six.PY2:"},{"line_number":134,"context_line":"        pattern \u003d re.compile(r\"[^\\w]\")"},{"line_number":135,"context_line":"    else:"},{"line_number":136,"context_line":"        pattern \u003d re.compile(r\"[^\\w]\", re.ASCII)"},{"line_number":137,"context_line":"    for k, v in conf.items():"},{"line_number":138,"context_line":"        if not k.startswith(STATSD_CONF_USERLABEL_PREFIX):"},{"line_number":139,"context_line":"            continue"}],"source_content_type":"text/x-python","patch_set":22,"id":"580339f9_5eac1fcc","line":136,"updated":"2024-06-25 18:40:03.000000000","message":"this didn\u0027t really do what I thought I did at first:\n\n\t\u003e\u003e\u003e import re\n\t\u003e\u003e\u003e conf \u003d \u0027foo☃bar\u0027\n\t\u003e\u003e\u003e pattern \u003d re.compile(r\"[^\\w]\", re.ASCII)\n\t\u003e\u003e\u003e pattern.search(conf)\n\t\u003cre.Match object; span\u003d(3, 4), match\u003d\u0027☃\u0027\u003e\n\t\u003e\u003e\u003e pattern.search(conf).group(0)\n\t\u0027☃\u0027\n\t\u003e\u003e\u003e conf \u003d \u0027foo bar\u0027\n\t\u003e\u003e\u003e pattern.search(conf)\n\t\u003cre.Match object; span\u003d(3, 4), match\u003d\u0027 \u0027\u003e\n\t\u003e\u003e\u003e pattern.search(conf).group(0)\n\t\u0027 \u0027\n\nI think I was expecting some kind of \"whitelist\" pattern... I couldn\u0027t find the tests.","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"a0a734b73158987742caf8c9a22a24a947c1df42","unresolved":false,"context_lines":[{"line_number":133,"context_line":"    if six.PY2:"},{"line_number":134,"context_line":"        pattern \u003d re.compile(r\"[^\\w]\")"},{"line_number":135,"context_line":"    else:"},{"line_number":136,"context_line":"        pattern \u003d re.compile(r\"[^\\w]\", re.ASCII)"},{"line_number":137,"context_line":"    for k, v in conf.items():"},{"line_number":138,"context_line":"        if not k.startswith(STATSD_CONF_USERLABEL_PREFIX):"},{"line_number":139,"context_line":"            continue"}],"source_content_type":"text/x-python","patch_set":22,"id":"92412065_a1de7445","line":136,"in_reply_to":"580339f9_5eac1fcc","updated":"2024-07-02 15:34:51.000000000","message":"Ack. The userlabel tests are in test_server.py","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"11e44436167bd0af814619080ea7811c1533ae9f","unresolved":true,"context_lines":[{"line_number":137,"context_line":"    for k, v in conf.items():"},{"line_number":138,"context_line":"        if not k.startswith(STATSD_CONF_USERLABEL_PREFIX):"},{"line_number":139,"context_line":"            continue"},{"line_number":140,"context_line":"        conf_label \u003d k[len(STATSD_CONF_USERLABEL_PREFIX):]"},{"line_number":141,"context_line":"        result \u003d pattern.search(conf_label)"},{"line_number":142,"context_line":"        if result is not None:"},{"line_number":143,"context_line":"            raise ValueError("}],"source_content_type":"text/x-python","patch_set":22,"id":"1c8c4b66_19e93e89","line":140,"updated":"2024-06-25 18:40:03.000000000","message":"I think I can add a NameError here and all test_statsd_client tests still pass:\n\n922766: extract build_line from send | https://review.opendev.org/c/openstack/swift/+/922766","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"a0a734b73158987742caf8c9a22a24a947c1df42","unresolved":false,"context_lines":[{"line_number":137,"context_line":"    for k, v in conf.items():"},{"line_number":138,"context_line":"        if not k.startswith(STATSD_CONF_USERLABEL_PREFIX):"},{"line_number":139,"context_line":"            continue"},{"line_number":140,"context_line":"        conf_label \u003d k[len(STATSD_CONF_USERLABEL_PREFIX):]"},{"line_number":141,"context_line":"        result \u003d pattern.search(conf_label)"},{"line_number":142,"context_line":"        if result is not None:"},{"line_number":143,"context_line":"            raise ValueError("}],"source_content_type":"text/x-python","patch_set":22,"id":"da2c5e41_5cea8f7c","line":140,"in_reply_to":"1c8c4b66_19e93e89","updated":"2024-07-02 15:34:51.000000000","message":"Ack. Thanks a lot for the patch!","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"11e44436167bd0af814619080ea7811c1533ae9f","unresolved":true,"context_lines":[{"line_number":167,"context_line":"    def __init__(self, host, port, base_prefix\u003d\u0027\u0027, tail_prefix\u003d\u0027\u0027,"},{"line_number":168,"context_line":"                 default_sample_rate\u003d1, sample_rate_factor\u003d1,"},{"line_number":169,"context_line":"                 label_mode\u003dLabelModes.DISABLED.value,"},{"line_number":170,"context_line":"                 emit_legacy\u003d\u0027true\u0027, default_labels\u003dNone,"},{"line_number":171,"context_line":"                 logger\u003dNone):"},{"line_number":172,"context_line":"        self._host \u003d host"},{"line_number":173,"context_line":"        self._port \u003d port"}],"source_content_type":"text/x-python","patch_set":22,"id":"8930e341_847a74b1","line":170,"updated":"2024-06-25 18:40:03.000000000","message":"I think you want `emit_legcy\u003dTrue` here","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"a0a734b73158987742caf8c9a22a24a947c1df42","unresolved":false,"context_lines":[{"line_number":167,"context_line":"    def __init__(self, host, port, base_prefix\u003d\u0027\u0027, tail_prefix\u003d\u0027\u0027,"},{"line_number":168,"context_line":"                 default_sample_rate\u003d1, sample_rate_factor\u003d1,"},{"line_number":169,"context_line":"                 label_mode\u003dLabelModes.DISABLED.value,"},{"line_number":170,"context_line":"                 emit_legacy\u003d\u0027true\u0027, default_labels\u003dNone,"},{"line_number":171,"context_line":"                 logger\u003dNone):"},{"line_number":172,"context_line":"        self._host \u003d host"},{"line_number":173,"context_line":"        self._port \u003d port"}],"source_content_type":"text/x-python","patch_set":22,"id":"0a004984_c6214d89","line":170,"in_reply_to":"8930e341_847a74b1","updated":"2024-07-02 15:34:51.000000000","message":"Acknowledged","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"11e44436167bd0af814619080ea7811c1533ae9f","unresolved":true,"context_lines":[{"line_number":193,"context_line":"            self._set_sock_family_and_target(self._host, self._port)"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"        self.build_line_map \u003d {"},{"line_number":196,"context_line":"            LabelModes.DISABLED: None,"},{"line_number":197,"context_line":"            LabelModes.GRAPHITE: build_line_graphite,"},{"line_number":198,"context_line":"            LabelModes.INFLUXDB: build_line_influxdb,"},{"line_number":199,"context_line":"            LabelModes.DOGSTATSD: build_line_dogstatsd,"}],"source_content_type":"text/x-python","patch_set":22,"id":"23fb0cea_50a331ad","line":196,"updated":"2024-06-25 18:40:03.000000000","message":"maybe just omit LabelModes.DISABLED and do:\n\n    self._build_line_f \u003d build_line_map.get(self.label_mode)\n    \nI don\u0027t think we need the `label_mode` attribute once we lookup a `build_label_line_f` but I\u0027m not opposed to keeping it around for context.","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"a0a734b73158987742caf8c9a22a24a947c1df42","unresolved":false,"context_lines":[{"line_number":193,"context_line":"            self._set_sock_family_and_target(self._host, self._port)"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"        self.build_line_map \u003d {"},{"line_number":196,"context_line":"            LabelModes.DISABLED: None,"},{"line_number":197,"context_line":"            LabelModes.GRAPHITE: build_line_graphite,"},{"line_number":198,"context_line":"            LabelModes.INFLUXDB: build_line_influxdb,"},{"line_number":199,"context_line":"            LabelModes.DOGSTATSD: build_line_dogstatsd,"}],"source_content_type":"text/x-python","patch_set":22,"id":"7a7d56c2_ff765e80","line":196,"in_reply_to":"23fb0cea_50a331ad","updated":"2024-07-02 15:34:51.000000000","message":"Acknowledged","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"11e44436167bd0af814619080ea7811c1533ae9f","unresolved":true,"context_lines":[{"line_number":288,"context_line":"        :return: a tuple of (bytes sent, a boolean flag indicating the"},{"line_number":289,"context_line":"            effect of sample_rate). The boolean flag would be True if"},{"line_number":290,"context_line":"            no data is actually sent to socket due to sample_rate, in"},{"line_number":291,"context_line":"            such case the bytes sent should be 0."},{"line_number":292,"context_line":"        \"\"\""},{"line_number":293,"context_line":"        if not self._host:"},{"line_number":294,"context_line":"            # StatsD not configured"}],"source_content_type":"text/x-python","patch_set":22,"id":"6340e4ff_1217dfd6","line":291,"updated":"2024-06-25 18:40:03.000000000","message":"at least we *try* to explain what\u0027s going on.\n\nit bothers me that I can\u0027t think of a good name for rv[1], `retry_sample_rate` is the best I\u0027ve seen but the \"retry\" behavior doesn\u0027t even make sense in contexts outside of tests.","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"a0a734b73158987742caf8c9a22a24a947c1df42","unresolved":false,"context_lines":[{"line_number":288,"context_line":"        :return: a tuple of (bytes sent, a boolean flag indicating the"},{"line_number":289,"context_line":"            effect of sample_rate). The boolean flag would be True if"},{"line_number":290,"context_line":"            no data is actually sent to socket due to sample_rate, in"},{"line_number":291,"context_line":"            such case the bytes sent should be 0."},{"line_number":292,"context_line":"        \"\"\""},{"line_number":293,"context_line":"        if not self._host:"},{"line_number":294,"context_line":"            # StatsD not configured"}],"source_content_type":"text/x-python","patch_set":22,"id":"6ef0896e_00ae9023","line":291,"in_reply_to":"6340e4ff_1217dfd6","updated":"2024-07-02 15:34:51.000000000","message":"Indeed the \"retry\" behavior is only used in tests. Reverted the changes per discussion","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"11e44436167bd0af814619080ea7811c1533ae9f","unresolved":true,"context_lines":[{"line_number":299,"context_line":"        sample_rate \u003d sample_rate * self._sample_rate_factor"},{"line_number":300,"context_line":""},{"line_number":301,"context_line":"        if sample_rate \u003c 1 and self.random() \u003e\u003d sample_rate:"},{"line_number":302,"context_line":"            return 0, True"},{"line_number":303,"context_line":""},{"line_number":304,"context_line":"        if labels is None:"},{"line_number":305,"context_line":"            # Legacy metric"}],"source_content_type":"text/x-python","patch_set":22,"id":"1a70ba8f_12bc3bea","line":302,"updated":"2024-06-25 18:40:03.000000000","message":"ok, so *this* is the only place we return True - indicating we didn\u0027t send anything - and that was specifically because of sample_rate.\n\nI had to refresh my brain on the use-case for sample_rate: it allows you to emit `counter|1~0.001` to indicate the stat value could be \"estimated\" as increment 100; we use it in memcache I guess...","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"a0a734b73158987742caf8c9a22a24a947c1df42","unresolved":false,"context_lines":[{"line_number":299,"context_line":"        sample_rate \u003d sample_rate * self._sample_rate_factor"},{"line_number":300,"context_line":""},{"line_number":301,"context_line":"        if sample_rate \u003c 1 and self.random() \u003e\u003d sample_rate:"},{"line_number":302,"context_line":"            return 0, True"},{"line_number":303,"context_line":""},{"line_number":304,"context_line":"        if labels is None:"},{"line_number":305,"context_line":"            # Legacy metric"}],"source_content_type":"text/x-python","patch_set":22,"id":"d243b197_2a6f1378","line":302,"in_reply_to":"1a70ba8f_12bc3bea","updated":"2024-07-02 15:34:51.000000000","message":"Acknowledged","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"11e44436167bd0af814619080ea7811c1533ae9f","unresolved":true,"context_lines":[{"line_number":309,"context_line":"                self._prefix, m_name, m_value, m_type, sample_rate)"},{"line_number":310,"context_line":"        else:"},{"line_number":311,"context_line":"            # Labeled"},{"line_number":312,"context_line":"            if self.label_mode \u003d\u003d \"disabled\":"},{"line_number":313,"context_line":"                return 0, False"},{"line_number":314,"context_line":"            labels \u003d dict(self.default_labels, **labels)"},{"line_number":315,"context_line":"            line \u003d self._build_line_f("}],"source_content_type":"text/x-python","patch_set":22,"id":"29f0110d_37025668","line":312,"updated":"2024-06-25 18:40:03.000000000","message":"shouldn\u0027t this compare to `LabelModes.DISABLED` or do we just want to use the strings?","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"a0a734b73158987742caf8c9a22a24a947c1df42","unresolved":false,"context_lines":[{"line_number":309,"context_line":"                self._prefix, m_name, m_value, m_type, sample_rate)"},{"line_number":310,"context_line":"        else:"},{"line_number":311,"context_line":"            # Labeled"},{"line_number":312,"context_line":"            if self.label_mode \u003d\u003d \"disabled\":"},{"line_number":313,"context_line":"                return 0, False"},{"line_number":314,"context_line":"            labels \u003d dict(self.default_labels, **labels)"},{"line_number":315,"context_line":"            line \u003d self._build_line_f("}],"source_content_type":"text/x-python","patch_set":22,"id":"e2efaed4_4a2ec018","line":312,"in_reply_to":"29f0110d_37025668","updated":"2024-07-02 15:34:51.000000000","message":"Acknowledged","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"11e44436167bd0af814619080ea7811c1533ae9f","unresolved":true,"context_lines":[{"line_number":312,"context_line":"            if self.label_mode \u003d\u003d \"disabled\":"},{"line_number":313,"context_line":"                return 0, False"},{"line_number":314,"context_line":"            labels \u003d dict(self.default_labels, **labels)"},{"line_number":315,"context_line":"            line \u003d self._build_line_f("},{"line_number":316,"context_line":"                m_name,"},{"line_number":317,"context_line":"                sorted(labels.items()),"},{"line_number":318,"context_line":"                m_value,"}],"source_content_type":"text/x-python","patch_set":22,"id":"6f9d9c3c_8c6d3179","line":315,"updated":"2024-06-25 18:40:03.000000000","message":"it seems like some care was taken to ensure that `self._build_line_f` can return `None` when `statsd_label_mode \u003d disabled` and yet here we call the function indiscriminately.","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"a0a734b73158987742caf8c9a22a24a947c1df42","unresolved":false,"context_lines":[{"line_number":312,"context_line":"            if self.label_mode \u003d\u003d \"disabled\":"},{"line_number":313,"context_line":"                return 0, False"},{"line_number":314,"context_line":"            labels \u003d dict(self.default_labels, **labels)"},{"line_number":315,"context_line":"            line \u003d self._build_line_f("},{"line_number":316,"context_line":"                m_name,"},{"line_number":317,"context_line":"                sorted(labels.items()),"},{"line_number":318,"context_line":"                m_value,"}],"source_content_type":"text/x-python","patch_set":22,"id":"4c1fddeb_a6c32d4e","line":315,"in_reply_to":"6f9d9c3c_8c6d3179","updated":"2024-07-02 15:34:51.000000000","message":"Acknowledged","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"11e44436167bd0af814619080ea7811c1533ae9f","unresolved":true,"context_lines":[{"line_number":317,"context_line":"                sorted(labels.items()),"},{"line_number":318,"context_line":"                m_value,"},{"line_number":319,"context_line":"                m_type,"},{"line_number":320,"context_line":"                sample_rate)"},{"line_number":321,"context_line":""},{"line_number":322,"context_line":"        if not six.PY2:"},{"line_number":323,"context_line":"            line \u003d line.encode(\u0027utf-8\u0027)"}],"source_content_type":"text/x-python","patch_set":22,"id":"efcd8fd8_0a3a93db","line":320,"updated":"2024-06-25 18:40:03.000000000","message":"there\u0027s a couple things going in in these 10-15 lines, maybe extract:\n\n922766: extract build_line from send | https://review.opendev.org/c/openstack/swift/+/922766","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"a0a734b73158987742caf8c9a22a24a947c1df42","unresolved":false,"context_lines":[{"line_number":317,"context_line":"                sorted(labels.items()),"},{"line_number":318,"context_line":"                m_value,"},{"line_number":319,"context_line":"                m_type,"},{"line_number":320,"context_line":"                sample_rate)"},{"line_number":321,"context_line":""},{"line_number":322,"context_line":"        if not six.PY2:"},{"line_number":323,"context_line":"            line \u003d line.encode(\u0027utf-8\u0027)"}],"source_content_type":"text/x-python","patch_set":22,"id":"d14c8e6b_a7aa7038","line":320,"in_reply_to":"efcd8fd8_0a3a93db","updated":"2024-07-02 15:34:51.000000000","message":"Acknowledged","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"11e44436167bd0af814619080ea7811c1533ae9f","unresolved":true,"context_lines":[{"line_number":333,"context_line":"                    self.logger.warning("},{"line_number":334,"context_line":"                        \u0027Error sending UDP message to %(target)r: %(err)s\u0027,"},{"line_number":335,"context_line":"                        {\u0027target\u0027: self._target, \u0027err\u0027: err})"},{"line_number":336,"context_line":"        return n, False"},{"line_number":337,"context_line":""},{"line_number":338,"context_line":"    def _open_socket(self):"},{"line_number":339,"context_line":"        return socket.socket(self._sock_family, socket.SOCK_DGRAM)"}],"source_content_type":"text/x-python","patch_set":22,"id":"3fac3111_f0ab5dc7","line":336,"updated":"2024-06-25 18:40:03.000000000","message":"this is a significant API change...","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"a0a734b73158987742caf8c9a22a24a947c1df42","unresolved":false,"context_lines":[{"line_number":333,"context_line":"                    self.logger.warning("},{"line_number":334,"context_line":"                        \u0027Error sending UDP message to %(target)r: %(err)s\u0027,"},{"line_number":335,"context_line":"                        {\u0027target\u0027: self._target, \u0027err\u0027: err})"},{"line_number":336,"context_line":"        return n, False"},{"line_number":337,"context_line":""},{"line_number":338,"context_line":"    def _open_socket(self):"},{"line_number":339,"context_line":"        return socket.socket(self._sock_family, socket.SOCK_DGRAM)"}],"source_content_type":"text/x-python","patch_set":22,"id":"4db5daaf_5ec66b1e","line":336,"in_reply_to":"3fac3111_f0ab5dc7","updated":"2024-07-02 15:34:51.000000000","message":"Acknowledged","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"49971256edaffded3fbbe4bceb93c03bb66306e2","unresolved":true,"context_lines":[{"line_number":44,"context_line":"def build_line_librato(name, labels, value, type, sample_rate):"},{"line_number":45,"context_line":"    # https://www.librato.com/docs/kb/collect/collection_agents/stastd/#stat-level-tags"},{"line_number":46,"context_line":"    name +\u003d \u0027#\u0027 + \u0027,\u0027.join(\u0027%s\u003d%s\u0027 % (k, v) for k, v in labels)"},{"line_number":47,"context_line":"    line \u003d \u0027%s:%s|%s\u0027 % (name, value, type)"},{"line_number":48,"context_line":"    if sample_rate \u003c 1:"},{"line_number":49,"context_line":"        line +\u003d \u0027@%s\u0027 % (sample_rate,)"},{"line_number":50,"context_line":"    return line"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"def build_line_influxdb(name, labels, value, type, sample_rate):"}],"source_content_type":"text/x-python","patch_set":27,"id":"7c44ca6c_85e9fbd6","line":50,"range":{"start_line":47,"start_character":4,"end_line":50,"end_character":15},"updated":"2024-07-12 12:28:17.000000000","message":"these lines are repeated several times in these build_line functions\n\nAlso line 46 seems like it can be parameterised and re-used for most modes:\n\n```\nname +\u003d prefix + delimiter.join(\u0027%s\u003d%s\u0027 % (k, v) for k, v in labels) + suffix\n```","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"aa3d6fb7c80733c1ca9e5b515a39d00acec91c79","unresolved":false,"context_lines":[{"line_number":44,"context_line":"def build_line_librato(name, labels, value, type, sample_rate):"},{"line_number":45,"context_line":"    # https://www.librato.com/docs/kb/collect/collection_agents/stastd/#stat-level-tags"},{"line_number":46,"context_line":"    name +\u003d \u0027#\u0027 + \u0027,\u0027.join(\u0027%s\u003d%s\u0027 % (k, v) for k, v in labels)"},{"line_number":47,"context_line":"    line \u003d \u0027%s:%s|%s\u0027 % (name, value, type)"},{"line_number":48,"context_line":"    if sample_rate \u003c 1:"},{"line_number":49,"context_line":"        line +\u003d \u0027@%s\u0027 % (sample_rate,)"},{"line_number":50,"context_line":"    return line"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"def build_line_influxdb(name, labels, value, type, sample_rate):"}],"source_content_type":"text/x-python","patch_set":27,"id":"24979736_132e41e6","line":50,"range":{"start_line":47,"start_character":4,"end_line":50,"end_character":15},"in_reply_to":"7c44ca6c_85e9fbd6","updated":"2024-07-19 16:33:39.000000000","message":"Acknowledged","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"db4cdb44d3c2884ebb34f429f9877dc8ff6a51ee","unresolved":false,"context_lines":[{"line_number":44,"context_line":"def build_line_librato(name, labels, value, type, sample_rate):"},{"line_number":45,"context_line":"    # https://www.librato.com/docs/kb/collect/collection_agents/stastd/#stat-level-tags"},{"line_number":46,"context_line":"    name +\u003d \u0027#\u0027 + \u0027,\u0027.join(\u0027%s\u003d%s\u0027 % (k, v) for k, v in labels)"},{"line_number":47,"context_line":"    line \u003d \u0027%s:%s|%s\u0027 % (name, value, type)"},{"line_number":48,"context_line":"    if sample_rate \u003c 1:"},{"line_number":49,"context_line":"        line +\u003d \u0027@%s\u0027 % (sample_rate,)"},{"line_number":50,"context_line":"    return line"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"def build_line_influxdb(name, labels, value, type, sample_rate):"}],"source_content_type":"text/x-python","patch_set":27,"id":"9b73f7fd_342a57fd","line":50,"range":{"start_line":47,"start_character":4,"end_line":50,"end_character":15},"in_reply_to":"7c44ca6c_85e9fbd6","updated":"2024-07-25 15:33:35.000000000","message":"Done","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"49971256edaffded3fbbe4bceb93c03bb66306e2","unresolved":true,"context_lines":[{"line_number":168,"context_line":"class StatsdClient(object):"},{"line_number":169,"context_line":"    def __init__(self, host, port, base_prefix\u003d\u0027\u0027, tail_prefix\u003d\u0027\u0027,"},{"line_number":170,"context_line":"                 default_sample_rate\u003d1, sample_rate_factor\u003d1,"},{"line_number":171,"context_line":"                 label_mode\u003dLabelModes.DISABLED.value,"},{"line_number":172,"context_line":"                 emit_legacy\u003dTrue, default_labels\u003dNone,"},{"line_number":173,"context_line":"                 logger\u003dNone):"},{"line_number":174,"context_line":"        self._host \u003d host"}],"source_content_type":"text/x-python","patch_set":27,"id":"c92f7556_10b38f30","line":171,"range":{"start_line":171,"start_character":28,"end_line":171,"end_character":53},"updated":"2024-07-12 12:28:17.000000000","message":"I expected this to be one of the Enum members rather than it\u0027s value","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"aa3d6fb7c80733c1ca9e5b515a39d00acec91c79","unresolved":false,"context_lines":[{"line_number":168,"context_line":"class StatsdClient(object):"},{"line_number":169,"context_line":"    def __init__(self, host, port, base_prefix\u003d\u0027\u0027, tail_prefix\u003d\u0027\u0027,"},{"line_number":170,"context_line":"                 default_sample_rate\u003d1, sample_rate_factor\u003d1,"},{"line_number":171,"context_line":"                 label_mode\u003dLabelModes.DISABLED.value,"},{"line_number":172,"context_line":"                 emit_legacy\u003dTrue, default_labels\u003dNone,"},{"line_number":173,"context_line":"                 logger\u003dNone):"},{"line_number":174,"context_line":"        self._host \u003d host"}],"source_content_type":"text/x-python","patch_set":27,"id":"d563b9c9_3f35a740","line":171,"range":{"start_line":171,"start_character":28,"end_line":171,"end_character":53},"in_reply_to":"c92f7556_10b38f30","updated":"2024-07-19 16:33:39.000000000","message":"Acknowledged","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"49971256edaffded3fbbe4bceb93c03bb66306e2","unresolved":true,"context_lines":[{"line_number":178,"context_line":"        self._sample_rate_factor \u003d sample_rate_factor"},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"        self.emit_legacy \u003d emit_legacy"},{"line_number":181,"context_line":"        self.default_labels \u003d default_labels"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"        self.random \u003d random"},{"line_number":184,"context_line":"        self.logger \u003d logger"}],"source_content_type":"text/x-python","patch_set":27,"id":"fd67f9e7_20df2a8f","line":181,"updated":"2024-07-12 12:28:17.000000000","message":"this must default to an empty dict","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"aa3d6fb7c80733c1ca9e5b515a39d00acec91c79","unresolved":false,"context_lines":[{"line_number":178,"context_line":"        self._sample_rate_factor \u003d sample_rate_factor"},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"        self.emit_legacy \u003d emit_legacy"},{"line_number":181,"context_line":"        self.default_labels \u003d default_labels"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"        self.random \u003d random"},{"line_number":184,"context_line":"        self.logger \u003d logger"}],"source_content_type":"text/x-python","patch_set":27,"id":"b8863f91_b14aea11","line":181,"in_reply_to":"fd67f9e7_20df2a8f","updated":"2024-07-19 16:33:39.000000000","message":"Acknowledged","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"db4cdb44d3c2884ebb34f429f9877dc8ff6a51ee","unresolved":false,"context_lines":[{"line_number":178,"context_line":"        self._sample_rate_factor \u003d sample_rate_factor"},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"        self.emit_legacy \u003d emit_legacy"},{"line_number":181,"context_line":"        self.default_labels \u003d default_labels"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"        self.random \u003d random"},{"line_number":184,"context_line":"        self.logger \u003d logger"}],"source_content_type":"text/x-python","patch_set":27,"id":"10b10bec_5902073d","line":181,"in_reply_to":"fd67f9e7_20df2a8f","updated":"2024-07-25 15:33:35.000000000","message":"Done","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"49971256edaffded3fbbe4bceb93c03bb66306e2","unresolved":true,"context_lines":[{"line_number":189,"context_line":"            self._set_sock_family_and_target(self._host, self._port)"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"        try:"},{"line_number":192,"context_line":"            self.label_mode \u003d LabelModes(label_mode)"},{"line_number":193,"context_line":"        except ValueError:"},{"line_number":194,"context_line":"            raise ValueError("},{"line_number":195,"context_line":"                \u0027unknown log_statsd_label_mode %r; \u0027"}],"source_content_type":"text/x-python","patch_set":27,"id":"21c72338_e12a96c9","line":192,"updated":"2024-07-12 12:28:17.000000000","message":"couldn\u0027t this translation be done in get_statsd_client ?\n\nAlso self.label_mode isn\u0027t used outside of the constructor AFAICT","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"6c73dd8c1e232f1daf1102296162d639e8c85583","unresolved":true,"context_lines":[{"line_number":189,"context_line":"            self._set_sock_family_and_target(self._host, self._port)"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"        try:"},{"line_number":192,"context_line":"            self.label_mode \u003d LabelModes(label_mode)"},{"line_number":193,"context_line":"        except ValueError:"},{"line_number":194,"context_line":"            raise ValueError("},{"line_number":195,"context_line":"                \u0027unknown log_statsd_label_mode %r; \u0027"}],"source_content_type":"text/x-python","patch_set":27,"id":"7e747ea1_01f43a25","line":192,"in_reply_to":"21c72338_e12a96c9","updated":"2024-07-15 19:02:11.000000000","message":"\u003e couldn\u0027t this translation be done in get_statsd_client ?\n\nIDK, I think I like the fact that you can pass *either* a `str` or a `LabelMode` to the constructor, even if we don\u0027t expect people to generally be using the constructor directly.","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"aa3d6fb7c80733c1ca9e5b515a39d00acec91c79","unresolved":false,"context_lines":[{"line_number":189,"context_line":"            self._set_sock_family_and_target(self._host, self._port)"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"        try:"},{"line_number":192,"context_line":"            self.label_mode \u003d LabelModes(label_mode)"},{"line_number":193,"context_line":"        except ValueError:"},{"line_number":194,"context_line":"            raise ValueError("},{"line_number":195,"context_line":"                \u0027unknown log_statsd_label_mode %r; \u0027"}],"source_content_type":"text/x-python","patch_set":27,"id":"e14c4268_b9bcfa93","line":192,"in_reply_to":"7e747ea1_01f43a25","updated":"2024-07-19 16:33:39.000000000","message":"Acknowledged","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"49971256edaffded3fbbe4bceb93c03bb66306e2","unresolved":true,"context_lines":[{"line_number":200,"context_line":"            LabelModes.DOGSTATSD: build_line_dogstatsd,"},{"line_number":201,"context_line":"            LabelModes.LIBRATO: build_line_librato,"},{"line_number":202,"context_line":"            LabelModes.SIGNALFX: build_line_signalfx,"},{"line_number":203,"context_line":"        }.get(self.label_mode)"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"    def build_line(self, m_name, m_value, m_type, sample_rate, labels):"},{"line_number":206,"context_line":"        if labels:"}],"source_content_type":"text/x-python","patch_set":27,"id":"8370dd12_cd063b20","line":203,"updated":"2024-07-12 12:28:17.000000000","message":"I\u0027m not sure what the Enum gives us:\n\n* the caller passes in a string e.g. \u0027graphite\u0027\n* we use the Enum to check \u0027graphite\u0027 is supported\n* but then we have a dict to lookup the build line func, so we have to make sure that when the Enum is updated the dict is also updated\n* otherwise we might silently end up with no build line func at line 208\n\nGiven that the caller is passing in a string, can\u0027t we skip the Enum and look up the build_line func in a dict that maps string_mode -\u003e build line func, and raise an error *right here* if there is no matching build line func.","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"e43a4057d59c9076188081ebedb15a20f47c2407","unresolved":true,"context_lines":[{"line_number":200,"context_line":"            LabelModes.DOGSTATSD: build_line_dogstatsd,"},{"line_number":201,"context_line":"            LabelModes.LIBRATO: build_line_librato,"},{"line_number":202,"context_line":"            LabelModes.SIGNALFX: build_line_signalfx,"},{"line_number":203,"context_line":"        }.get(self.label_mode)"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"    def build_line(self, m_name, m_value, m_type, sample_rate, labels):"},{"line_number":206,"context_line":"        if labels:"}],"source_content_type":"text/x-python","patch_set":27,"id":"29cc692a_e355ec4f","line":203,"in_reply_to":"03ad7218_274ebc12","updated":"2024-07-15 22:19:34.000000000","message":"True -- `except AttributeError` generally is a smell for me (can mask a lot of typos!) but it\u0027d probably be tightly-enough scoped to not be an issue.","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"aa3d6fb7c80733c1ca9e5b515a39d00acec91c79","unresolved":false,"context_lines":[{"line_number":200,"context_line":"            LabelModes.DOGSTATSD: build_line_dogstatsd,"},{"line_number":201,"context_line":"            LabelModes.LIBRATO: build_line_librato,"},{"line_number":202,"context_line":"            LabelModes.SIGNALFX: build_line_signalfx,"},{"line_number":203,"context_line":"        }.get(self.label_mode)"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"    def build_line(self, m_name, m_value, m_type, sample_rate, labels):"},{"line_number":206,"context_line":"        if labels:"}],"source_content_type":"text/x-python","patch_set":27,"id":"c3950e48_7297c56d","line":203,"in_reply_to":"29cc692a_e355ec4f","updated":"2024-07-19 16:33:39.000000000","message":"Acknowledged","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"6c73dd8c1e232f1daf1102296162d639e8c85583","unresolved":true,"context_lines":[{"line_number":200,"context_line":"            LabelModes.DOGSTATSD: build_line_dogstatsd,"},{"line_number":201,"context_line":"            LabelModes.LIBRATO: build_line_librato,"},{"line_number":202,"context_line":"            LabelModes.SIGNALFX: build_line_signalfx,"},{"line_number":203,"context_line":"        }.get(self.label_mode)"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"    def build_line(self, m_name, m_value, m_type, sample_rate, labels):"},{"line_number":206,"context_line":"        if labels:"}],"source_content_type":"text/x-python","patch_set":27,"id":"c09c3f6b_c5ee64ec","line":203,"in_reply_to":"8370dd12_cd063b20","updated":"2024-07-15 19:02:11.000000000","message":"It\u0027s also a little funny that we define the possible modes and the build_line methods for each of them way up at the module level, but then bury the translation from one to the other down in a local `dict` (that\u0027s used exactly once!) in `StatsdClient.__init__` -- I might be getting too far off into bike-shedding, but I\u0027d be tempted to do something like a static class:\n\n```\nclass LabeledFormats(object):\n    disabled \u003d None\n\n    @staticmethod\n    def graphite(name, labels, value, type, sample_rate):\n        ...\n\n    @staticmethod\n    def influxdb(name, labels, value, type, sample_rate):\n        ...\n```\nand in `StatsdClient.__init__` we say something like\n```\n    if not hasattr(LabeledFormats, label_mode):\n        raise ValueError(...)\n    else:\n        self._label_line_f \u003d getattr(LabeledFormats, label_mode)\n```\n\nThen if we ever find ourselves wanting to add another format, there\u0027s exactly one spot that should need to get updated.\n\nBonus benefit in getting away from `Enum`: we don\u0027t have to muck with requirements stuff at all.","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"e83e4e4599c665eb2ef2b9c6ef7f9755151af0c3","unresolved":true,"context_lines":[{"line_number":200,"context_line":"            LabelModes.DOGSTATSD: build_line_dogstatsd,"},{"line_number":201,"context_line":"            LabelModes.LIBRATO: build_line_librato,"},{"line_number":202,"context_line":"            LabelModes.SIGNALFX: build_line_signalfx,"},{"line_number":203,"context_line":"        }.get(self.label_mode)"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"    def build_line(self, m_name, m_value, m_type, sample_rate, labels):"},{"line_number":206,"context_line":"        if labels:"}],"source_content_type":"text/x-python","patch_set":27,"id":"03ad7218_274ebc12","line":203,"in_reply_to":"c09c3f6b_c5ee64ec","updated":"2024-07-15 21:44:38.000000000","message":"That\u0027s not bad!  I think you can simplify:\n\n```\ntry:\n    self._label_line_f \u003d getattr(LabeledFormat, label_mode)\nexcept AttributeError:\n     raise ValueError(...)\n```\n\nunlike `{}.get` getattr doesn\u0027t have a default of None (although you CAN say `getattr(obj, \u0027attr\u0027, default)`\n\nhttps://docs.python.org/3/library/functions.html#getattr","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"49971256edaffded3fbbe4bceb93c03bb66306e2","unresolved":true,"context_lines":[{"line_number":203,"context_line":"        }.get(self.label_mode)"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"    def build_line(self, m_name, m_value, m_type, sample_rate, labels):"},{"line_number":206,"context_line":"        if labels:"},{"line_number":207,"context_line":"            build_line_f \u003d self._label_line_f"},{"line_number":208,"context_line":"            if not build_line_f:"},{"line_number":209,"context_line":"                return"}],"source_content_type":"text/x-python","patch_set":27,"id":"78c792a7_76ab811d","line":206,"updated":"2024-07-12 12:28:17.000000000","message":"so I *must* always pass in non-empty labels OR keep legacy enabled? This test fails (well, it actually hangs in a loop 😭 because of the test infrastructure)\n\n```\n    def test_delegate_methods_with_labels_and_prefix_graphite_no_legacy(self):\n        self.logger \u003d utils.get_logger({\n            \u0027log_statsd_host\u0027: \u0027localhost\u0027,\n            \u0027log_statsd_port\u0027: str(self.port),\n            \u0027log_statsd_metric_prefix\u0027: \u0027my_prefix\u0027,\n            \u0027statsd_label_mode\u0027: \u0027graphite\u0027,\n            \u0027statsd_emit_legacy\u0027: \u0027false\u0027,\n        }, \u0027pfx\u0027)\n        self.assertStat(\n            \u0027simple_counter:1|c\u0027,\n            self.logger.increment, \u0027simple_counter\u0027, labels\u003d{})\n\n```","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"6c73dd8c1e232f1daf1102296162d639e8c85583","unresolved":true,"context_lines":[{"line_number":203,"context_line":"        }.get(self.label_mode)"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"    def build_line(self, m_name, m_value, m_type, sample_rate, labels):"},{"line_number":206,"context_line":"        if labels:"},{"line_number":207,"context_line":"            build_line_f \u003d self._label_line_f"},{"line_number":208,"context_line":"            if not build_line_f:"},{"line_number":209,"context_line":"                return"}],"source_content_type":"text/x-python","patch_set":27,"id":"eade1ab5_a7e5642d","line":206,"in_reply_to":"78c792a7_76ab811d","updated":"2024-07-15 19:02:11.000000000","message":"Definitely feels like it ought to be `if labels is not None:` here -- especially with the `default_labels` overlay happening below.","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"e83e4e4599c665eb2ef2b9c6ef7f9755151af0c3","unresolved":true,"context_lines":[{"line_number":203,"context_line":"        }.get(self.label_mode)"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"    def build_line(self, m_name, m_value, m_type, sample_rate, labels):"},{"line_number":206,"context_line":"        if labels:"},{"line_number":207,"context_line":"            build_line_f \u003d self._label_line_f"},{"line_number":208,"context_line":"            if not build_line_f:"},{"line_number":209,"context_line":"                return"}],"source_content_type":"text/x-python","patch_set":27,"id":"edcf6aa8_1eba1589","line":206,"in_reply_to":"eade1ab5_a7e5642d","updated":"2024-07-15 21:44:38.000000000","message":"I think that was my bug!\n\nhttps://review.opendev.org/c/openstack/swift/+/922766/2/swift/common/statsd_client.py#206\n\nSorry Yan!\n\nI tried the suggested `is not None` fix and the test passed but it takes 5s (!?), it scared me it was still hung!?","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"aa3d6fb7c80733c1ca9e5b515a39d00acec91c79","unresolved":false,"context_lines":[{"line_number":203,"context_line":"        }.get(self.label_mode)"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"    def build_line(self, m_name, m_value, m_type, sample_rate, labels):"},{"line_number":206,"context_line":"        if labels:"},{"line_number":207,"context_line":"            build_line_f \u003d self._label_line_f"},{"line_number":208,"context_line":"            if not build_line_f:"},{"line_number":209,"context_line":"                return"}],"source_content_type":"text/x-python","patch_set":27,"id":"50d34412_14de8353","line":206,"in_reply_to":"edcf6aa8_1eba1589","updated":"2024-07-19 16:33:39.000000000","message":"No worries, Clay, thanks for the patch!","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"49971256edaffded3fbbe4bceb93c03bb66306e2","unresolved":true,"context_lines":[{"line_number":214,"context_line":"                m_value,"},{"line_number":215,"context_line":"                m_type,"},{"line_number":216,"context_line":"                sample_rate)"},{"line_number":217,"context_line":"        else:"},{"line_number":218,"context_line":"            if not self.emit_legacy:"},{"line_number":219,"context_line":"                return None"},{"line_number":220,"context_line":"            return build_line_legacy_format("}],"source_content_type":"text/x-python","patch_set":27,"id":"44107db4_38b4b084","line":217,"updated":"2024-07-12 12:28:17.000000000","message":"could be \n```\nelif:\n    # emit legacy\nelse:\n    return None\n```","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"aa3d6fb7c80733c1ca9e5b515a39d00acec91c79","unresolved":false,"context_lines":[{"line_number":214,"context_line":"                m_value,"},{"line_number":215,"context_line":"                m_type,"},{"line_number":216,"context_line":"                sample_rate)"},{"line_number":217,"context_line":"        else:"},{"line_number":218,"context_line":"            if not self.emit_legacy:"},{"line_number":219,"context_line":"                return None"},{"line_number":220,"context_line":"            return build_line_legacy_format("}],"source_content_type":"text/x-python","patch_set":27,"id":"fabf35fc_21174392","line":217,"in_reply_to":"44107db4_38b4b084","updated":"2024-07-19 16:33:39.000000000","message":"Acknowledged","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"db4cdb44d3c2884ebb34f429f9877dc8ff6a51ee","unresolved":false,"context_lines":[{"line_number":214,"context_line":"                m_value,"},{"line_number":215,"context_line":"                m_type,"},{"line_number":216,"context_line":"                sample_rate)"},{"line_number":217,"context_line":"        else:"},{"line_number":218,"context_line":"            if not self.emit_legacy:"},{"line_number":219,"context_line":"                return None"},{"line_number":220,"context_line":"            return build_line_legacy_format("}],"source_content_type":"text/x-python","patch_set":27,"id":"68226ac2_89313b8c","line":217,"in_reply_to":"44107db4_38b4b084","updated":"2024-07-25 15:33:35.000000000","message":"Done","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"49971256edaffded3fbbe4bceb93c03bb66306e2","unresolved":true,"context_lines":[{"line_number":216,"context_line":"                sample_rate)"},{"line_number":217,"context_line":"        else:"},{"line_number":218,"context_line":"            if not self.emit_legacy:"},{"line_number":219,"context_line":"                return None"},{"line_number":220,"context_line":"            return build_line_legacy_format("},{"line_number":221,"context_line":"                self._prefix, m_name, m_value, m_type, sample_rate)"},{"line_number":222,"context_line":""}],"source_content_type":"text/x-python","patch_set":27,"id":"d74cb566_b633bf8c","line":219,"updated":"2024-07-12 12:28:17.000000000","message":"I\u0027m a little confused about the meaning of emit_legacy. It seems from the next patch that the caller (proxy_logging) is not replacing existing calls with labeled calls, but making additional calls with labels. So the caller is deciding to continue to emit legacy metrics? And StatsdClient is NOT emitting both labeled and legacy format metrics in response to one call.\n\nSo why would I ever disable emit_legacy - it seems it would switch off all non-label metrics?\n\nOh... is this just a mechanism to one day *ignore* all those additional legacy calls that we\u0027re leaving in the codebase ? At first glance that feels a little too heavily disguised, but I guess the alternative is to repeat each method with a \u0027labels\u0027 version.\n\nHave we considered having a LabeledStatsdClient subclass that accepts the labels arg, and have callers use that so it\u0027s much more explicit?","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"aa3d6fb7c80733c1ca9e5b515a39d00acec91c79","unresolved":false,"context_lines":[{"line_number":216,"context_line":"                sample_rate)"},{"line_number":217,"context_line":"        else:"},{"line_number":218,"context_line":"            if not self.emit_legacy:"},{"line_number":219,"context_line":"                return None"},{"line_number":220,"context_line":"            return build_line_legacy_format("},{"line_number":221,"context_line":"                self._prefix, m_name, m_value, m_type, sample_rate)"},{"line_number":222,"context_line":""}],"source_content_type":"text/x-python","patch_set":27,"id":"f94ca23a_f8437a8e","line":219,"in_reply_to":"1e84039c_960179ba","updated":"2024-07-19 16:33:39.000000000","message":"Acknowledged","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"e83e4e4599c665eb2ef2b9c6ef7f9755151af0c3","unresolved":true,"context_lines":[{"line_number":216,"context_line":"                sample_rate)"},{"line_number":217,"context_line":"        else:"},{"line_number":218,"context_line":"            if not self.emit_legacy:"},{"line_number":219,"context_line":"                return None"},{"line_number":220,"context_line":"            return build_line_legacy_format("},{"line_number":221,"context_line":"                self._prefix, m_name, m_value, m_type, sample_rate)"},{"line_number":222,"context_line":""}],"source_content_type":"text/x-python","patch_set":27,"id":"1e84039c_960179ba","line":219,"in_reply_to":"d74cb566_b633bf8c","updated":"2024-07-15 21:44:38.000000000","message":"\u003e disable emit_legacy - it seems it would switch off all non-label metrics?\n\n\u003e this just a mechanism to one day ignore all those additional legacy calls that we\u0027re leaving in the codebase \n\n^ this, you\u0027ve got it\n\n\u003e having a LabeledStatsdClient subclass that accepts the labels arg, and have callers use that so it\u0027s much more explicit?\n\nI think this is a great idea!  But I don\u0027t think that makes the operational decision of \"I can actually get everything I need from labeled metrics to the point that *this component* doesn\u0027t even need to emit_legacy anymore since I don\u0027t have any graphs that I care aobut that use those metrics anyway\".  That is when *ops* would choose to set `emit_legacy \u003d False` for *that component* and cut down on their UDP emissions for the telemetry they don\u0027t use or care about anymore.\n\nBut when you\u0027re first dipping your toe into labeled metrics you\u0027ll want label_mode AND legacy metrics - but hopefully once you get a taste of that sweet sweet lableled necter your\u0027ll be itching to emit_legacy \u003d False just as soon as you can schedule the rework on your graphs!","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"49971256edaffded3fbbe4bceb93c03bb66306e2","unresolved":true,"context_lines":[{"line_number":309,"context_line":"        sample_rate \u003d sample_rate * self._sample_rate_factor"},{"line_number":310,"context_line":""},{"line_number":311,"context_line":"        if sample_rate \u003c 1 and self.random() \u003e\u003d sample_rate:"},{"line_number":312,"context_line":"            return"},{"line_number":313,"context_line":""},{"line_number":314,"context_line":"        line \u003d self.build_line(m_name, m_value, m_type, sample_rate, labels)"},{"line_number":315,"context_line":"        if line is None:"}],"source_content_type":"text/x-python","patch_set":27,"id":"13e2737d_5065faf7","line":312,"updated":"2024-07-12 12:28:17.000000000","message":"+1 nice simplification","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"aa3d6fb7c80733c1ca9e5b515a39d00acec91c79","unresolved":false,"context_lines":[{"line_number":309,"context_line":"        sample_rate \u003d sample_rate * self._sample_rate_factor"},{"line_number":310,"context_line":""},{"line_number":311,"context_line":"        if sample_rate \u003c 1 and self.random() \u003e\u003d sample_rate:"},{"line_number":312,"context_line":"            return"},{"line_number":313,"context_line":""},{"line_number":314,"context_line":"        line \u003d self.build_line(m_name, m_value, m_type, sample_rate, labels)"},{"line_number":315,"context_line":"        if line is None:"}],"source_content_type":"text/x-python","patch_set":27,"id":"890a23e9_90d4dd90","line":312,"in_reply_to":"13e2737d_5065faf7","updated":"2024-07-19 16:33:39.000000000","message":"Acknowledged","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"db4cdb44d3c2884ebb34f429f9877dc8ff6a51ee","unresolved":false,"context_lines":[{"line_number":309,"context_line":"        sample_rate \u003d sample_rate * self._sample_rate_factor"},{"line_number":310,"context_line":""},{"line_number":311,"context_line":"        if sample_rate \u003c 1 and self.random() \u003e\u003d sample_rate:"},{"line_number":312,"context_line":"            return"},{"line_number":313,"context_line":""},{"line_number":314,"context_line":"        line \u003d self.build_line(m_name, m_value, m_type, sample_rate, labels)"},{"line_number":315,"context_line":"        if line is None:"}],"source_content_type":"text/x-python","patch_set":27,"id":"d2159368_8dcc12b2","line":312,"in_reply_to":"13e2737d_5065faf7","updated":"2024-07-25 15:33:35.000000000","message":"Acknowledged","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"6c73dd8c1e232f1daf1102296162d639e8c85583","unresolved":true,"context_lines":[{"line_number":130,"context_line":"    if six.PY2:"},{"line_number":131,"context_line":"        pattern \u003d re.compile(r\"[^\\w]\")"},{"line_number":132,"context_line":"    else:"},{"line_number":133,"context_line":"        pattern \u003d re.compile(r\"[^\\w]\", re.ASCII)"},{"line_number":134,"context_line":"    for k, v in conf.items():"},{"line_number":135,"context_line":"        if not k.startswith(STATSD_CONF_USERLABEL_PREFIX):"},{"line_number":136,"context_line":"            continue"}],"source_content_type":"text/x-python","patch_set":28,"id":"715f8ee0_0f02b287","line":133,"updated":"2024-07-15 19:02:11.000000000","message":"If we want to use regex, can we at least spell it out a little more? I never remember the nuances of character classes like `\\w` well enough -- I think `[^0-9a-zA-Z_]` would be much more explicit and clear (and you won\u0027t need different code for py2/py3).\n\nProbably would be better to pull the re-compiling up to module-level.","commit_id":"137ce227de8bd03e2493e8e4689975fade1c993d"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"aa3d6fb7c80733c1ca9e5b515a39d00acec91c79","unresolved":false,"context_lines":[{"line_number":130,"context_line":"    if six.PY2:"},{"line_number":131,"context_line":"        pattern \u003d re.compile(r\"[^\\w]\")"},{"line_number":132,"context_line":"    else:"},{"line_number":133,"context_line":"        pattern \u003d re.compile(r\"[^\\w]\", re.ASCII)"},{"line_number":134,"context_line":"    for k, v in conf.items():"},{"line_number":135,"context_line":"        if not k.startswith(STATSD_CONF_USERLABEL_PREFIX):"},{"line_number":136,"context_line":"            continue"}],"source_content_type":"text/x-python","patch_set":28,"id":"e501d46b_881b78df","line":133,"in_reply_to":"529d272f_fceb7956","updated":"2024-07-19 16:33:39.000000000","message":"Acknowledged","commit_id":"137ce227de8bd03e2493e8e4689975fade1c993d"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"e83e4e4599c665eb2ef2b9c6ef7f9755151af0c3","unresolved":true,"context_lines":[{"line_number":130,"context_line":"    if six.PY2:"},{"line_number":131,"context_line":"        pattern \u003d re.compile(r\"[^\\w]\")"},{"line_number":132,"context_line":"    else:"},{"line_number":133,"context_line":"        pattern \u003d re.compile(r\"[^\\w]\", re.ASCII)"},{"line_number":134,"context_line":"    for k, v in conf.items():"},{"line_number":135,"context_line":"        if not k.startswith(STATSD_CONF_USERLABEL_PREFIX):"},{"line_number":136,"context_line":"            continue"}],"source_content_type":"text/x-python","patch_set":28,"id":"529d272f_fceb7956","line":133,"in_reply_to":"715f8ee0_0f02b287","updated":"2024-07-15 21:44:38.000000000","message":"I had similar confusion:\n\nhttps://review.opendev.org/c/openstack/swift/+/922766/comment/f5daa40e_54753a45/","commit_id":"137ce227de8bd03e2493e8e4689975fade1c993d"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"6c73dd8c1e232f1daf1102296162d639e8c85583","unresolved":true,"context_lines":[{"line_number":166,"context_line":"    def __init__(self, host, port, base_prefix\u003d\u0027\u0027, tail_prefix\u003d\u0027\u0027,"},{"line_number":167,"context_line":"                 default_sample_rate\u003d1, sample_rate_factor\u003d1,"},{"line_number":168,"context_line":"                 label_mode\u003dLabelModes.DISABLED.value,"},{"line_number":169,"context_line":"                 emit_legacy\u003dTrue, default_labels\u003d{},"},{"line_number":170,"context_line":"                 logger\u003dNone):"},{"line_number":171,"context_line":"        self._host \u003d host"},{"line_number":172,"context_line":"        self._port \u003d port"}],"source_content_type":"text/x-python","patch_set":28,"id":"47bf0609_fad13b61","line":169,"range":{"start_line":169,"start_character":35,"end_line":169,"end_character":52},"updated":"2024-07-15 19:02:11.000000000","message":"Pretty sure Alistair was thinking something more like\n```\ndef __init__(... default_labels\u003dNone, ...):\n    ...\n    self.default_labels \u003d default_labels or {}\n```\nI think it works out OK-ish here, since we\u0027re not expecting to manipulate the dict at all, but in general you don\u0027t want to specify mutable data types as defaults in function signatures; it can lead to weird/unexpected behaviors as it\u0027s shared between any instances that use that default:\n```\n\u003e\u003e\u003e class A(object):\n...     def __init__(self, d\u003d{}):\n...             self.d \u003d d\n... \n\u003e\u003e\u003e a \u003d A()\n\u003e\u003e\u003e a.d\n{}\n\u003e\u003e\u003e b \u003d A()\n\u003e\u003e\u003e b.d\n{}\n\u003e\u003e\u003e b.d[\u0027foo\u0027] \u003d \u0027bar\u0027\n\u003e\u003e\u003e a.d\n{\u0027foo\u0027: \u0027bar\u0027}\n```","commit_id":"137ce227de8bd03e2493e8e4689975fade1c993d"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"aa3d6fb7c80733c1ca9e5b515a39d00acec91c79","unresolved":false,"context_lines":[{"line_number":166,"context_line":"    def __init__(self, host, port, base_prefix\u003d\u0027\u0027, tail_prefix\u003d\u0027\u0027,"},{"line_number":167,"context_line":"                 default_sample_rate\u003d1, sample_rate_factor\u003d1,"},{"line_number":168,"context_line":"                 label_mode\u003dLabelModes.DISABLED.value,"},{"line_number":169,"context_line":"                 emit_legacy\u003dTrue, default_labels\u003d{},"},{"line_number":170,"context_line":"                 logger\u003dNone):"},{"line_number":171,"context_line":"        self._host \u003d host"},{"line_number":172,"context_line":"        self._port \u003d port"}],"source_content_type":"text/x-python","patch_set":28,"id":"87692687_7eb7fd9a","line":169,"range":{"start_line":169,"start_character":35,"end_line":169,"end_character":52},"in_reply_to":"47bf0609_fad13b61","updated":"2024-07-19 16:33:39.000000000","message":"Acknowledged","commit_id":"137ce227de8bd03e2493e8e4689975fade1c993d"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"db4cdb44d3c2884ebb34f429f9877dc8ff6a51ee","unresolved":true,"context_lines":[{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    emit_legacy \u003d config_true_value(conf.get("},{"line_number":119,"context_line":"        \u0027statsd_emit_legacy\u0027, \u0027true\u0027))"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"    return StatsdClient("},{"line_number":122,"context_line":"        host, port,"},{"line_number":123,"context_line":"        base_prefix\u003dbase_prefix,"}],"source_content_type":"text/x-python","patch_set":30,"id":"25aa661e_4e2ccf70","line":120,"updated":"2024-07-25 15:33:35.000000000","message":"alternatively you could set host to None to disable metrics being emitted","commit_id":"17382f672a5fd3a99781f3d5599887ee2725033d"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"d005adb00a62faf9a3888b985c10ffdb92fdacd2","unresolved":false,"context_lines":[{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    emit_legacy \u003d config_true_value(conf.get("},{"line_number":119,"context_line":"        \u0027statsd_emit_legacy\u0027, \u0027true\u0027))"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"    return StatsdClient("},{"line_number":122,"context_line":"        host, port,"},{"line_number":123,"context_line":"        base_prefix\u003dbase_prefix,"}],"source_content_type":"text/x-python","patch_set":30,"id":"7c8605dd_a350c8c6","line":120,"in_reply_to":"25aa661e_4e2ccf70","updated":"2024-07-30 16:22:36.000000000","message":"Acknowledged","commit_id":"17382f672a5fd3a99781f3d5599887ee2725033d"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"db4cdb44d3c2884ebb34f429f9877dc8ff6a51ee","unresolved":true,"context_lines":[{"line_number":253,"context_line":"        if sample_rate \u003c 1 and self.random() \u003e\u003d sample_rate:"},{"line_number":254,"context_line":"            return"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"        line \u003d self.build_line(m_name, m_value, m_type, sample_rate, **kwargs)"},{"line_number":257,"context_line":"        if line is None:"},{"line_number":258,"context_line":"            return"},{"line_number":259,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"59f09fba_35eff178","line":256,"updated":"2024-07-25 15:33:35.000000000","message":"The only arg this method cares about explicitly is ``sample_rate`` - all the other args are passed back to the subclass.\n\nRather than bouncing control up and then back down to the subclass for ``build_line``, the subclass could just build a line and pass it to ``_send``. In which case there would be a small inefficiency of building a line even when stats are disabled.\n\nSo, we could break up _send() into helpers... for example, diff for just the StatsdClient:\n```\ndiff --git a/swift/common/statsd_client.py b/swift/common/statsd_client.py\nindex ba2505cb3..4157a8595 100644\n--- a/swift/common/statsd_client.py\n+++ b/swift/common/statsd_client.py\n@@ -237,23 +237,26 @@ class AbstractStatsdClient(object):\n         else:\n             self._target \u003d (host, port)\n\n-    def _send(self, m_name, m_value, m_type, sample_rate, **kwargs):\n-        \"\"\"\n-        Send a line of metrics to socket if allowed by sample_rate. If\n-        sample_rate \u003c 1, may not actually send a packet.\n-        \"\"\"\n+    def _is_emitted(self, sample_rate):\n         if not self._host:\n             # StatsD not configured\n-            return\n+            return False, None\n\n         if sample_rate is None:\n             sample_rate \u003d self._default_sample_rate\n         sample_rate \u003d sample_rate * self._sample_rate_factor\n\n         if sample_rate \u003c 1 and self.random() \u003e\u003d sample_rate:\n-            return\n+            return False, None\n+\n+        return True, sample_rate\n+\n+    def _send_line(self, line):\n+        \"\"\"\n+        Send a line of metrics to socket if allowed by sample_rate. If\n+        sample_rate \u003c 1, may not actually send a packet.\n+        \"\"\"\n\n-        line \u003d self.build_line(m_name, m_value, m_type, sample_rate, **kwargs)\n         if line is None:\n             return\n\n@@ -289,12 +292,11 @@ class StatsdClient(AbstractStatsdClient):\n\n         self._set_prefix(tail_prefix)\n\n-    def build_line(self, m_name, m_value, m_type, sample_rate):\n-        if self.emit_legacy:\n-            return build_line_legacy_format(\n-                self._prefix, m_name, m_value, m_type, sample_rate)\n-        else:\n-            return None\n+    def _send(self, m_name, m_value, m_type, sample_rate):\n+        is_emitted, sample_rate \u003d self._is_emitted(sample_rate)\n+        if self.emit_legacy and is_emitted:\n+            return self._send_line(build_line_legacy_format(\n+                self._prefix, m_name, m_value, m_type, sample_rate))\n\n     def _set_prefix(self, tail_prefix):\n         \"\"\"\n```","commit_id":"17382f672a5fd3a99781f3d5599887ee2725033d"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"d005adb00a62faf9a3888b985c10ffdb92fdacd2","unresolved":false,"context_lines":[{"line_number":253,"context_line":"        if sample_rate \u003c 1 and self.random() \u003e\u003d sample_rate:"},{"line_number":254,"context_line":"            return"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"        line \u003d self.build_line(m_name, m_value, m_type, sample_rate, **kwargs)"},{"line_number":257,"context_line":"        if line is None:"},{"line_number":258,"context_line":"            return"},{"line_number":259,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"e1241998_de591690","line":256,"in_reply_to":"59f09fba_35eff178","updated":"2024-07-30 16:22:36.000000000","message":"Acknowledged","commit_id":"17382f672a5fd3a99781f3d5599887ee2725033d"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"db4cdb44d3c2884ebb34f429f9877dc8ff6a51ee","unresolved":true,"context_lines":[{"line_number":386,"context_line":"        if not build_line_f:"},{"line_number":387,"context_line":"            return"},{"line_number":388,"context_line":"        labels \u003d dict(self.default_labels, **labels)"},{"line_number":389,"context_line":"        return build_line_f("},{"line_number":390,"context_line":"            m_name,"},{"line_number":391,"context_line":"            sorted(labels.items()),"},{"line_number":392,"context_line":"            m_value,"}],"source_content_type":"text/x-python","patch_set":30,"id":"956f5ae9_cd44d8c5","line":389,"updated":"2024-07-25 15:33:35.000000000","message":"it\u0027s unfortunate that the args order for build_line_f is different than build_line - when possible it\u0027s good to preserve args order down a call hierarchy","commit_id":"17382f672a5fd3a99781f3d5599887ee2725033d"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"d005adb00a62faf9a3888b985c10ffdb92fdacd2","unresolved":false,"context_lines":[{"line_number":386,"context_line":"        if not build_line_f:"},{"line_number":387,"context_line":"            return"},{"line_number":388,"context_line":"        labels \u003d dict(self.default_labels, **labels)"},{"line_number":389,"context_line":"        return build_line_f("},{"line_number":390,"context_line":"            m_name,"},{"line_number":391,"context_line":"            sorted(labels.items()),"},{"line_number":392,"context_line":"            m_value,"}],"source_content_type":"text/x-python","patch_set":30,"id":"cefdb8d1_a286977b","line":389,"in_reply_to":"956f5ae9_cd44d8c5","updated":"2024-07-30 16:22:36.000000000","message":"Acknowledged","commit_id":"17382f672a5fd3a99781f3d5599887ee2725033d"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"de7842f1679ae7a04326f70c810d4ae7ed08dd8d","unresolved":true,"context_lines":[{"line_number":30,"context_line":"STATSD_CONF_USER_LABEL_PREFIX \u003d \u0027statsd_user_label_\u0027"},{"line_number":31,"context_line":"STATSD_USER_LABEL_NAMESPACE \u003d \u0027user_\u0027"},{"line_number":32,"context_line":"USER_LABEL_PATTERN \u003d re.compile(r\"[^0-9a-zA-Z_]\")"},{"line_number":33,"context_line":"USER_VALUE_PATTERN \u003d re.compile(r\"[^0-9a-zA-Z_.]\")"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"def _build_line_parts(name, value, type, sample_rate):"}],"source_content_type":"text/x-python","patch_set":33,"id":"21bc8a5e_e2bae409","line":33,"updated":"2024-08-07 02:06:50.000000000","message":"So a value can have a dot (.) but lavel can\u0027t.. probably somethng to mention in any doc.","commit_id":"d561dd39936fe17009f2eeb834e2b6599ffa0dfb"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"5a4ec86f9501e46cd834db332031f2027a15c924","unresolved":false,"context_lines":[{"line_number":30,"context_line":"STATSD_CONF_USER_LABEL_PREFIX \u003d \u0027statsd_user_label_\u0027"},{"line_number":31,"context_line":"STATSD_USER_LABEL_NAMESPACE \u003d \u0027user_\u0027"},{"line_number":32,"context_line":"USER_LABEL_PATTERN \u003d re.compile(r\"[^0-9a-zA-Z_]\")"},{"line_number":33,"context_line":"USER_VALUE_PATTERN \u003d re.compile(r\"[^0-9a-zA-Z_.]\")"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"def _build_line_parts(name, value, type, sample_rate):"}],"source_content_type":"text/x-python","patch_set":33,"id":"d77741b4_e44c93bb","line":33,"in_reply_to":"21bc8a5e_e2bae409","updated":"2024-09-05 15:33:20.000000000","message":"Acknowledged","commit_id":"d561dd39936fe17009f2eeb834e2b6599ffa0dfb"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"af4b06b9cc4a236ac9c5953e16b64e288317e7b8","unresolved":true,"context_lines":[{"line_number":80,"context_line":"        return line"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"def build_line_legacy_format(prefix, name, value, type, sample_rate):"},{"line_number":84,"context_line":"    parts \u003d [\u0027%s%s:%s\u0027 % (prefix, name, value), type]"},{"line_number":85,"context_line":"    if sample_rate \u003c 1:"},{"line_number":86,"context_line":"        parts.append(\u0027@%s\u0027 % (sample_rate,))"}],"source_content_type":"text/x-python","patch_set":33,"id":"ac7466e3_0a9f06ac","line":83,"updated":"2024-08-05 12:50:21.000000000","message":"does this need to be a function or could it revert to being inline in the ``StatsdClient._send()``?","commit_id":"d561dd39936fe17009f2eeb834e2b6599ffa0dfb"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"5a4ec86f9501e46cd834db332031f2027a15c924","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        return line"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"def build_line_legacy_format(prefix, name, value, type, sample_rate):"},{"line_number":84,"context_line":"    parts \u003d [\u0027%s%s:%s\u0027 % (prefix, name, value), type]"},{"line_number":85,"context_line":"    if sample_rate \u003c 1:"},{"line_number":86,"context_line":"        parts.append(\u0027@%s\u0027 % (sample_rate,))"}],"source_content_type":"text/x-python","patch_set":33,"id":"258df541_c5cc5ba4","line":83,"in_reply_to":"ac7466e3_0a9f06ac","updated":"2024-09-05 15:33:20.000000000","message":"Good point, could be inline","commit_id":"d561dd39936fe17009f2eeb834e2b6599ffa0dfb"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"de7842f1679ae7a04326f70c810d4ae7ed08dd8d","unresolved":true,"context_lines":[{"line_number":369,"context_line":"                 label_mode\u003d\u0027disabled\u0027, default_labels\u003dNone,"},{"line_number":370,"context_line":"                 logger\u003dNone):"},{"line_number":371,"context_line":"        AbstractStatsdClient.__init__("},{"line_number":372,"context_line":"            self, host, port, default_sample_rate, sample_rate_factor, logger)"},{"line_number":373,"context_line":"        self.label_mode \u003d label_mode"},{"line_number":374,"context_line":"        self.default_labels \u003d default_labels or {}"},{"line_number":375,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"9d0f3c7d_b09338b3","line":372,"updated":"2024-08-07 02:06:50.000000000","message":"I guess more of a NIT or question. Because we\u0027re using single inheritence, but are using an object base base class. Why did we go:\n\n     AbstractStatsdClient.__init__(\n\nOver:\n\n    super(LabeledStatsdClient, self).__init__(\n\nI guess there is no real differnce, just I was expecting super because it\u0027s a \"new\" style class (object)","commit_id":"d561dd39936fe17009f2eeb834e2b6599ffa0dfb"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"b08838abde9daf9270d067d77fcff08bb0a4d087","unresolved":false,"context_lines":[{"line_number":369,"context_line":"                 label_mode\u003d\u0027disabled\u0027, default_labels\u003dNone,"},{"line_number":370,"context_line":"                 logger\u003dNone):"},{"line_number":371,"context_line":"        AbstractStatsdClient.__init__("},{"line_number":372,"context_line":"            self, host, port, default_sample_rate, sample_rate_factor, logger)"},{"line_number":373,"context_line":"        self.label_mode \u003d label_mode"},{"line_number":374,"context_line":"        self.default_labels \u003d default_labels or {}"},{"line_number":375,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"ba084740_8c340902","line":372,"in_reply_to":"1add1e08_97935f2a","updated":"2025-03-25 10:35:27.000000000","message":"Done","commit_id":"d561dd39936fe17009f2eeb834e2b6599ffa0dfb"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"ca8a986d5442eaa683a72b98e62de37e241ed16e","unresolved":true,"context_lines":[{"line_number":369,"context_line":"                 label_mode\u003d\u0027disabled\u0027, default_labels\u003dNone,"},{"line_number":370,"context_line":"                 logger\u003dNone):"},{"line_number":371,"context_line":"        AbstractStatsdClient.__init__("},{"line_number":372,"context_line":"            self, host, port, default_sample_rate, sample_rate_factor, logger)"},{"line_number":373,"context_line":"        self.label_mode \u003d label_mode"},{"line_number":374,"context_line":"        self.default_labels \u003d default_labels or {}"},{"line_number":375,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"1add1e08_97935f2a","line":372,"in_reply_to":"8ff5e059_854c58fb","updated":"2025-03-21 15:23:29.000000000","message":"python3 ony now so we can just write ``super().__init__``","commit_id":"d561dd39936fe17009f2eeb834e2b6599ffa0dfb"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"5a4ec86f9501e46cd834db332031f2027a15c924","unresolved":true,"context_lines":[{"line_number":369,"context_line":"                 label_mode\u003d\u0027disabled\u0027, default_labels\u003dNone,"},{"line_number":370,"context_line":"                 logger\u003dNone):"},{"line_number":371,"context_line":"        AbstractStatsdClient.__init__("},{"line_number":372,"context_line":"            self, host, port, default_sample_rate, sample_rate_factor, logger)"},{"line_number":373,"context_line":"        self.label_mode \u003d label_mode"},{"line_number":374,"context_line":"        self.default_labels \u003d default_labels or {}"},{"line_number":375,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"8ff5e059_854c58fb","line":372,"in_reply_to":"9d0f3c7d_b09338b3","updated":"2024-09-05 15:33:20.000000000","message":"Good question, agreed should probably use super. Although some unit tests such as test_proxy_logging.py actually mock patch swift.common.statsd_client.StatsdClient as FakeStatsdClient, which would cause infinite loop error if using super(StatsdClient,self).__init__(), any good ideas there?","commit_id":"d561dd39936fe17009f2eeb834e2b6599ffa0dfb"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"de7842f1679ae7a04326f70c810d4ae7ed08dd8d","unresolved":true,"context_lines":[{"line_number":390,"context_line":"                m_name, m_value, m_type, sample_rate, labels))"},{"line_number":391,"context_line":""},{"line_number":392,"context_line":"    def _build_line(self, m_name, m_value, m_type, sample_rate, labels):"},{"line_number":393,"context_line":"        build_line_f \u003d self._label_line_f"},{"line_number":394,"context_line":"        if not build_line_f:"},{"line_number":395,"context_line":"            return"},{"line_number":396,"context_line":"        labels \u003d dict(self.default_labels, **labels)"}],"source_content_type":"text/x-python","patch_set":33,"id":"a8517098_de5e4cfb","line":393,"updated":"2024-08-07 02:06:50.000000000","message":"Why are we making a local reference to the function and then call it below and not just call it explicitly:\n\n     return self._label_line_f(...","commit_id":"d561dd39936fe17009f2eeb834e2b6599ffa0dfb"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"5a4ec86f9501e46cd834db332031f2027a15c924","unresolved":false,"context_lines":[{"line_number":390,"context_line":"                m_name, m_value, m_type, sample_rate, labels))"},{"line_number":391,"context_line":""},{"line_number":392,"context_line":"    def _build_line(self, m_name, m_value, m_type, sample_rate, labels):"},{"line_number":393,"context_line":"        build_line_f \u003d self._label_line_f"},{"line_number":394,"context_line":"        if not build_line_f:"},{"line_number":395,"context_line":"            return"},{"line_number":396,"context_line":"        labels \u003d dict(self.default_labels, **labels)"}],"source_content_type":"text/x-python","patch_set":33,"id":"b1778e3c_df2f4f0d","line":393,"in_reply_to":"a8517098_de5e4cfb","updated":"2024-09-05 15:33:20.000000000","message":"Acknowledged","commit_id":"d561dd39936fe17009f2eeb834e2b6599ffa0dfb"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f99f24954e7eb6d38088d94fded3c44a1329255d","unresolved":true,"context_lines":[{"line_number":373,"context_line":"                not f.startswith(\u0027__\u0027)]"},{"line_number":374,"context_line":"            raise ValueError("},{"line_number":375,"context_line":"                \u0027unknown statsd_label_mode %r; \u0027"},{"line_number":376,"context_line":"                \u0027expected one of %r\u0027 % (label_mode, label_modes))"},{"line_number":377,"context_line":""},{"line_number":378,"context_line":"    def _send(self, m_name, m_value, m_type, sample_rate, labels):"},{"line_number":379,"context_line":"        is_emitted, sample_rate \u003d self._is_emitted(sample_rate)"}],"source_content_type":"text/x-python","patch_set":43,"id":"87d4ffda_23a3695d","line":376,"updated":"2025-03-05 21:01:06.000000000","message":"please add an info level log message when someone creates a LabeledStatsdClient with label_mode set to disabled.  I have on multiple tries added label_mode \u003d dogstatsd to the subrequest_logging section cause it\u0027s the first place I find a config option prefixed with statsd even tho I *intended* to add statsd_label_mode into the proxy default section.\n\nmaybe we decide it\u0027s too noisy for info if there\u0027s 3-4 different mw that create disabled LabeledStatsdClient instances, but even if it was only debug (for dev) I think that would have helped me.","commit_id":"c9da7202cff70a2b3d8ad15e79dc83c76f00cb60"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"c6bffda0a663def0d97886a1de8e3b97c4514299","unresolved":false,"context_lines":[{"line_number":373,"context_line":"                not f.startswith(\u0027__\u0027)]"},{"line_number":374,"context_line":"            raise ValueError("},{"line_number":375,"context_line":"                \u0027unknown statsd_label_mode %r; \u0027"},{"line_number":376,"context_line":"                \u0027expected one of %r\u0027 % (label_mode, label_modes))"},{"line_number":377,"context_line":""},{"line_number":378,"context_line":"    def _send(self, m_name, m_value, m_type, sample_rate, labels):"},{"line_number":379,"context_line":"        is_emitted, sample_rate \u003d self._is_emitted(sample_rate)"}],"source_content_type":"text/x-python","patch_set":43,"id":"96b551fc_2f2adefd","line":376,"in_reply_to":"79a81c30_0fbac074","updated":"2025-03-26 09:09:35.000000000","message":"I had verbal feedback that debug level is ok","commit_id":"c9da7202cff70a2b3d8ad15e79dc83c76f00cb60"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"ca8a986d5442eaa683a72b98e62de37e241ed16e","unresolved":true,"context_lines":[{"line_number":373,"context_line":"                not f.startswith(\u0027__\u0027)]"},{"line_number":374,"context_line":"            raise ValueError("},{"line_number":375,"context_line":"                \u0027unknown statsd_label_mode %r; \u0027"},{"line_number":376,"context_line":"                \u0027expected one of %r\u0027 % (label_mode, label_modes))"},{"line_number":377,"context_line":""},{"line_number":378,"context_line":"    def _send(self, m_name, m_value, m_type, sample_rate, labels):"},{"line_number":379,"context_line":"        is_emitted, sample_rate \u003d self._is_emitted(sample_rate)"}],"source_content_type":"text/x-python","patch_set":43,"id":"e49ef580_3acfbdb3","line":376,"in_reply_to":"87d4ffda_23a3695d","updated":"2025-03-21 15:23:29.000000000","message":"I too have been burnt because I forgot that labeled metrics needs to be explicitly enabled, although I then set the option in the [DEFAULT] section. To be most useful it feels like a log message should include some hint as to *which* section/middleware has it disabled, which I think we can do using the logger.name.\n\nI wonder if always logging which mode (including disabled) might be helpful so there\u0027s a potential headsup if an op has mistakenly configured different modes in different conf sections.","commit_id":"c9da7202cff70a2b3d8ad15e79dc83c76f00cb60"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"b08838abde9daf9270d067d77fcff08bb0a4d087","unresolved":true,"context_lines":[{"line_number":373,"context_line":"                not f.startswith(\u0027__\u0027)]"},{"line_number":374,"context_line":"            raise ValueError("},{"line_number":375,"context_line":"                \u0027unknown statsd_label_mode %r; \u0027"},{"line_number":376,"context_line":"                \u0027expected one of %r\u0027 % (label_mode, label_modes))"},{"line_number":377,"context_line":""},{"line_number":378,"context_line":"    def _send(self, m_name, m_value, m_type, sample_rate, labels):"},{"line_number":379,"context_line":"        is_emitted, sample_rate \u003d self._is_emitted(sample_rate)"}],"source_content_type":"text/x-python","patch_set":43,"id":"79a81c30_0fbac074","line":376,"in_reply_to":"e49ef580_3acfbdb3","updated":"2025-03-25 10:35:27.000000000","message":"Done at debug level pending consensus","commit_id":"c9da7202cff70a2b3d8ad15e79dc83c76f00cb60"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"ca8a986d5442eaa683a72b98e62de37e241ed16e","unresolved":true,"context_lines":[{"line_number":39,"context_line":"    return line"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"class LabeledFormats(object):"},{"line_number":43,"context_line":"    disabled \u003d None"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":46,"id":"4ea33929_3959e2da","line":42,"range":{"start_line":42,"start_character":20,"end_line":42,"end_character":28},"updated":"2025-03-21 15:23:29.000000000","message":"nit: now we\u0027re py3 only we don\u0027t need ``(object)``","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"b08838abde9daf9270d067d77fcff08bb0a4d087","unresolved":false,"context_lines":[{"line_number":39,"context_line":"    return line"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"class LabeledFormats(object):"},{"line_number":43,"context_line":"    disabled \u003d None"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":46,"id":"4b620e3b_776e0ac7","line":42,"range":{"start_line":42,"start_character":20,"end_line":42,"end_character":28},"in_reply_to":"4ea33929_3959e2da","updated":"2025-03-25 10:35:27.000000000","message":"Done","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"ca8a986d5442eaa683a72b98e62de37e241ed16e","unresolved":true,"context_lines":[{"line_number":111,"context_line":"        \u0027statsd_emit_legacy\u0027, \u0027true\u0027))"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"    return StatsdClient("},{"line_number":114,"context_line":"        host, port,"},{"line_number":115,"context_line":"        base_prefix\u003dbase_prefix,"},{"line_number":116,"context_line":"        tail_prefix\u003dtail_prefix,"},{"line_number":117,"context_line":"        default_sample_rate\u003ddefault_sample_rate,"}],"source_content_type":"text/x-python","patch_set":46,"id":"9046dd2b_822e3c03","line":114,"updated":"2025-03-21 15:23:29.000000000","message":"nit: somebody wiser than me once said \"all args on one line or one arg per line\" and I do find it easier to quickly discern the individual args when that rule is applied","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"c6bffda0a663def0d97886a1de8e3b97c4514299","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        \u0027statsd_emit_legacy\u0027, \u0027true\u0027))"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"    return StatsdClient("},{"line_number":114,"context_line":"        host, port,"},{"line_number":115,"context_line":"        base_prefix\u003dbase_prefix,"},{"line_number":116,"context_line":"        tail_prefix\u003dtail_prefix,"},{"line_number":117,"context_line":"        default_sample_rate\u003ddefault_sample_rate,"}],"source_content_type":"text/x-python","patch_set":46,"id":"0a3e8cd5_ed041d28","line":114,"in_reply_to":"19068d3e_271006fc","updated":"2025-03-26 09:09:35.000000000","message":"Acknowledged","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"dfe995f216edbb0c8cfdf4e5914ca52cc5f1a8b1","unresolved":true,"context_lines":[{"line_number":111,"context_line":"        \u0027statsd_emit_legacy\u0027, \u0027true\u0027))"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"    return StatsdClient("},{"line_number":114,"context_line":"        host, port,"},{"line_number":115,"context_line":"        base_prefix\u003dbase_prefix,"},{"line_number":116,"context_line":"        tail_prefix\u003dtail_prefix,"},{"line_number":117,"context_line":"        default_sample_rate\u003ddefault_sample_rate,"}],"source_content_type":"text/x-python","patch_set":46,"id":"19068d3e_271006fc","line":114,"in_reply_to":"9046dd2b_822e3c03","updated":"2025-03-25 15:57:08.000000000","message":"don\u0027t change - I can\u0027t really defend that as a general requirement ;-)","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"ca8a986d5442eaa683a72b98e62de37e241ed16e","unresolved":true,"context_lines":[{"line_number":169,"context_line":"        default_labels[conf_label] \u003d v"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    return LabeledStatsdClient("},{"line_number":172,"context_line":"        host, port,"},{"line_number":173,"context_line":"        default_sample_rate\u003ddefault_sample_rate,"},{"line_number":174,"context_line":"        sample_rate_factor\u003dsample_rate_factor,"},{"line_number":175,"context_line":"        label_mode\u003dlabel_mode,"}],"source_content_type":"text/x-python","patch_set":46,"id":"1dab6781_05d99a6b","line":172,"updated":"2025-03-21 15:23:29.000000000","message":"nit: ditto re one arg per line","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"dfe995f216edbb0c8cfdf4e5914ca52cc5f1a8b1","unresolved":true,"context_lines":[{"line_number":169,"context_line":"        default_labels[conf_label] \u003d v"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    return LabeledStatsdClient("},{"line_number":172,"context_line":"        host, port,"},{"line_number":173,"context_line":"        default_sample_rate\u003ddefault_sample_rate,"},{"line_number":174,"context_line":"        sample_rate_factor\u003dsample_rate_factor,"},{"line_number":175,"context_line":"        label_mode\u003dlabel_mode,"}],"source_content_type":"text/x-python","patch_set":46,"id":"6e7b65c6_dbeb9f0f","line":172,"in_reply_to":"1dab6781_05d99a6b","updated":"2025-03-25 15:57:08.000000000","message":"don\u0027t change - I can\u0027t really defend that as a general requirement ;-)","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"c6bffda0a663def0d97886a1de8e3b97c4514299","unresolved":false,"context_lines":[{"line_number":169,"context_line":"        default_labels[conf_label] \u003d v"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    return LabeledStatsdClient("},{"line_number":172,"context_line":"        host, port,"},{"line_number":173,"context_line":"        default_sample_rate\u003ddefault_sample_rate,"},{"line_number":174,"context_line":"        sample_rate_factor\u003dsample_rate_factor,"},{"line_number":175,"context_line":"        label_mode\u003dlabel_mode,"}],"source_content_type":"text/x-python","patch_set":46,"id":"40fe4644_658a5299","line":172,"in_reply_to":"6e7b65c6_dbeb9f0f","updated":"2025-03-26 09:09:35.000000000","message":"Acknowledged","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"ca8a986d5442eaa683a72b98e62de37e241ed16e","unresolved":true,"context_lines":[{"line_number":177,"context_line":"        logger\u003dlogger)"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"class AbstractStatsdClient(object):"},{"line_number":181,"context_line":"    def __init__(self, host, port,"},{"line_number":182,"context_line":"                 default_sample_rate\u003d1, sample_rate_factor\u003d1,"},{"line_number":183,"context_line":"                 logger\u003dNone):"}],"source_content_type":"text/x-python","patch_set":46,"id":"3a41088c_18c2b75c","line":180,"updated":"2025-03-21 15:23:29.000000000","message":"nit: now we\u0027re py3 only we don\u0027t need ``(object)``","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"b08838abde9daf9270d067d77fcff08bb0a4d087","unresolved":false,"context_lines":[{"line_number":177,"context_line":"        logger\u003dlogger)"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"class AbstractStatsdClient(object):"},{"line_number":181,"context_line":"    def __init__(self, host, port,"},{"line_number":182,"context_line":"                 default_sample_rate\u003d1, sample_rate_factor\u003d1,"},{"line_number":183,"context_line":"                 logger\u003dNone):"}],"source_content_type":"text/x-python","patch_set":46,"id":"080fed2d_3ac12e5f","line":180,"in_reply_to":"3a41088c_18c2b75c","updated":"2025-03-25 10:35:27.000000000","message":"Done","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"ca8a986d5442eaa683a72b98e62de37e241ed16e","unresolved":true,"context_lines":[{"line_number":185,"context_line":"        self._port \u003d port"},{"line_number":186,"context_line":"        self._default_sample_rate \u003d default_sample_rate"},{"line_number":187,"context_line":"        self._sample_rate_factor \u003d sample_rate_factor"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"        self.random \u003d random"},{"line_number":190,"context_line":"        self.logger \u003d logger"},{"line_number":191,"context_line":"        self._sock_family \u003d self._target \u003d None"}],"source_content_type":"text/x-python","patch_set":46,"id":"eec3b992_d6a1ccc2","line":188,"updated":"2025-03-21 15:23:29.000000000","message":"nit: unnecessary whitespace","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"b08838abde9daf9270d067d77fcff08bb0a4d087","unresolved":false,"context_lines":[{"line_number":185,"context_line":"        self._port \u003d port"},{"line_number":186,"context_line":"        self._default_sample_rate \u003d default_sample_rate"},{"line_number":187,"context_line":"        self._sample_rate_factor \u003d sample_rate_factor"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"        self.random \u003d random"},{"line_number":190,"context_line":"        self.logger \u003d logger"},{"line_number":191,"context_line":"        self._sock_family \u003d self._target \u003d None"}],"source_content_type":"text/x-python","patch_set":46,"id":"4191a84a_a2eafc03","line":188,"in_reply_to":"eec3b992_d6a1ccc2","updated":"2025-03-25 10:35:27.000000000","message":"Done","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"ca8a986d5442eaa683a72b98e62de37e241ed16e","unresolved":true,"context_lines":[{"line_number":229,"context_line":"        else:"},{"line_number":230,"context_line":"            self._target \u003d (host, port)"},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"    def _is_emitted(self, sample_rate):"},{"line_number":233,"context_line":"        if not self._host:"},{"line_number":234,"context_line":"            # StatsD not configured"},{"line_number":235,"context_line":"            return False, None"}],"source_content_type":"text/x-python","patch_set":46,"id":"0522a182_83579b0e","line":232,"updated":"2025-03-21 15:23:29.000000000","message":"ok. this a relocated version of the first part of the previous ``_send()`` method","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"b08838abde9daf9270d067d77fcff08bb0a4d087","unresolved":false,"context_lines":[{"line_number":229,"context_line":"        else:"},{"line_number":230,"context_line":"            self._target \u003d (host, port)"},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"    def _is_emitted(self, sample_rate):"},{"line_number":233,"context_line":"        if not self._host:"},{"line_number":234,"context_line":"            # StatsD not configured"},{"line_number":235,"context_line":"            return False, None"}],"source_content_type":"text/x-python","patch_set":46,"id":"4fb1041c_eaba6155","line":232,"in_reply_to":"0522a182_83579b0e","updated":"2025-03-25 10:35:27.000000000","message":"Acknowledged","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"ca8a986d5442eaa683a72b98e62de37e241ed16e","unresolved":true,"context_lines":[{"line_number":245,"context_line":""},{"line_number":246,"context_line":"    def _send_line(self, line):"},{"line_number":247,"context_line":"        \"\"\""},{"line_number":248,"context_line":"        Send a line of metrics to socket if allowed by sample_rate. If"},{"line_number":249,"context_line":"        sample_rate \u003c 1, may not actually send a packet."},{"line_number":250,"context_line":"        \"\"\""},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"        if line is None:"}],"source_content_type":"text/x-python","patch_set":46,"id":"edc0eb43_b034d872","line":249,"range":{"start_line":248,"start_character":41,"end_line":249,"end_character":56},"updated":"2025-03-21 15:23:29.000000000","message":"The text about sample_rate belongs in _is_emitted. This method does not pay attention to sample rate.","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"b08838abde9daf9270d067d77fcff08bb0a4d087","unresolved":false,"context_lines":[{"line_number":245,"context_line":""},{"line_number":246,"context_line":"    def _send_line(self, line):"},{"line_number":247,"context_line":"        \"\"\""},{"line_number":248,"context_line":"        Send a line of metrics to socket if allowed by sample_rate. If"},{"line_number":249,"context_line":"        sample_rate \u003c 1, may not actually send a packet."},{"line_number":250,"context_line":"        \"\"\""},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"        if line is None:"}],"source_content_type":"text/x-python","patch_set":46,"id":"f6ad814b_a5d04589","line":249,"range":{"start_line":248,"start_character":41,"end_line":249,"end_character":56},"in_reply_to":"edc0eb43_b034d872","updated":"2025-03-25 10:35:27.000000000","message":"Done","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"ca8a986d5442eaa683a72b98e62de37e241ed16e","unresolved":true,"context_lines":[{"line_number":362,"context_line":"                 logger\u003dNone):"},{"line_number":363,"context_line":"        AbstractStatsdClient.__init__("},{"line_number":364,"context_line":"            self, host, port, default_sample_rate, sample_rate_factor, logger)"},{"line_number":365,"context_line":"        self.label_mode \u003d label_mode"},{"line_number":366,"context_line":"        self.default_labels \u003d default_labels or {}"},{"line_number":367,"context_line":""},{"line_number":368,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":46,"id":"54f8e999_14240c63","line":365,"updated":"2025-03-21 15:23:29.000000000","message":"this is not used, except in tests. The tests can make assertions on self._label_line_f (which could be made \u0027public\u0027 instead of label_mode). That also makes the assertions a bit tighter.","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"b08838abde9daf9270d067d77fcff08bb0a4d087","unresolved":false,"context_lines":[{"line_number":362,"context_line":"                 logger\u003dNone):"},{"line_number":363,"context_line":"        AbstractStatsdClient.__init__("},{"line_number":364,"context_line":"            self, host, port, default_sample_rate, sample_rate_factor, logger)"},{"line_number":365,"context_line":"        self.label_mode \u003d label_mode"},{"line_number":366,"context_line":"        self.default_labels \u003d default_labels or {}"},{"line_number":367,"context_line":""},{"line_number":368,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":46,"id":"56e617f2_f2d86405","line":365,"in_reply_to":"54f8e999_14240c63","updated":"2025-03-25 10:35:27.000000000","message":"Done","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"ca8a986d5442eaa683a72b98e62de37e241ed16e","unresolved":true,"context_lines":[{"line_number":370,"context_line":"        except AttributeError:"},{"line_number":371,"context_line":"            label_modes \u003d ["},{"line_number":372,"context_line":"                f for f in LabeledFormats.__dict__ if"},{"line_number":373,"context_line":"                not f.startswith(\u0027__\u0027)]"},{"line_number":374,"context_line":"            raise ValueError("},{"line_number":375,"context_line":"                \u0027unknown statsd_label_mode %r; \u0027"},{"line_number":376,"context_line":"                \u0027expected one of %r\u0027 % (label_mode, label_modes))"}],"source_content_type":"text/x-python","patch_set":46,"id":"236fbe9c_67f103c2","line":373,"updated":"2025-03-21 15:23:29.000000000","message":"It\u0027s unfortunate that this detailed knowledge of LabeledFormats implementation needs to bleed into another class. We could at least encapsulate it in a module function","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"b08838abde9daf9270d067d77fcff08bb0a4d087","unresolved":false,"context_lines":[{"line_number":370,"context_line":"        except AttributeError:"},{"line_number":371,"context_line":"            label_modes \u003d ["},{"line_number":372,"context_line":"                f for f in LabeledFormats.__dict__ if"},{"line_number":373,"context_line":"                not f.startswith(\u0027__\u0027)]"},{"line_number":374,"context_line":"            raise ValueError("},{"line_number":375,"context_line":"                \u0027unknown statsd_label_mode %r; \u0027"},{"line_number":376,"context_line":"                \u0027expected one of %r\u0027 % (label_mode, label_modes))"}],"source_content_type":"text/x-python","patch_set":46,"id":"44fed9ce_a0acdd2a","line":373,"in_reply_to":"236fbe9c_67f103c2","updated":"2025-03-25 10:35:27.000000000","message":"Done","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"ca8a986d5442eaa683a72b98e62de37e241ed16e","unresolved":true,"context_lines":[{"line_number":383,"context_line":""},{"line_number":384,"context_line":"    def _build_line(self, m_name, m_value, m_type, sample_rate, labels):"},{"line_number":385,"context_line":"        if not self._label_line_f:"},{"line_number":386,"context_line":"            return"},{"line_number":387,"context_line":"        labels \u003d dict(self.default_labels, **labels)"},{"line_number":388,"context_line":"        return self._label_line_f("},{"line_number":389,"context_line":"            m_name,"}],"source_content_type":"text/x-python","patch_set":46,"id":"0bfad5f4_36906413","line":386,"updated":"2025-03-21 15:23:29.000000000","message":"seems odd to wait until here to bail out if labeled mode is actually disabled - we could do the early return at the start of ``_send``","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"b08838abde9daf9270d067d77fcff08bb0a4d087","unresolved":false,"context_lines":[{"line_number":383,"context_line":""},{"line_number":384,"context_line":"    def _build_line(self, m_name, m_value, m_type, sample_rate, labels):"},{"line_number":385,"context_line":"        if not self._label_line_f:"},{"line_number":386,"context_line":"            return"},{"line_number":387,"context_line":"        labels \u003d dict(self.default_labels, **labels)"},{"line_number":388,"context_line":"        return self._label_line_f("},{"line_number":389,"context_line":"            m_name,"}],"source_content_type":"text/x-python","patch_set":46,"id":"d287a03c_ff1d949a","line":386,"in_reply_to":"0bfad5f4_36906413","updated":"2025-03-25 10:35:27.000000000","message":"Done","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"a9258375c2563585fb1042693ed0cef69cc89f95","unresolved":true,"context_lines":[{"line_number":35,"context_line":"def _build_line_parts(name, value, type, sample_rate):"},{"line_number":36,"context_line":"    line \u003d \u0027%s:%s|%s\u0027 % (name, value, type)"},{"line_number":37,"context_line":"    if sample_rate \u003c 1:"},{"line_number":38,"context_line":"        line +\u003d \u0027@%s\u0027 % (sample_rate,)"},{"line_number":39,"context_line":"    return line"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":""}],"source_content_type":"text/x-python","patch_set":47,"id":"5edf5ae9_83e44533","line":38,"updated":"2025-03-24 15:38:45.000000000","message":"I think we may be missing a ``|`` delimiter before the sample rate value\n\nSee https://review.opendev.org/c/openstack/swift/+/945333","commit_id":"b9ef50c32b28d5b361bca13e599f11e2c8c1559f"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"d336860735ebb739a79033e92980f4384386857f","unresolved":false,"context_lines":[{"line_number":35,"context_line":"def _build_line_parts(name, value, type, sample_rate):"},{"line_number":36,"context_line":"    line \u003d \u0027%s:%s|%s\u0027 % (name, value, type)"},{"line_number":37,"context_line":"    if sample_rate \u003c 1:"},{"line_number":38,"context_line":"        line +\u003d \u0027@%s\u0027 % (sample_rate,)"},{"line_number":39,"context_line":"    return line"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":""}],"source_content_type":"text/x-python","patch_set":47,"id":"599cf250_5d03d0ef","line":38,"in_reply_to":"5edf5ae9_83e44533","updated":"2025-03-25 14:34:35.000000000","message":"Done","commit_id":"b9ef50c32b28d5b361bca13e599f11e2c8c1559f"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"a9258375c2563585fb1042693ed0cef69cc89f95","unresolved":true,"context_lines":[{"line_number":45,"context_line":"    @staticmethod"},{"line_number":46,"context_line":"    def librato(name, value, type, sample_rate, labels):"},{"line_number":47,"context_line":"        # https://www.librato.com/docs/kb/collect/collection_agents/stastd/#stat-level-tags"},{"line_number":48,"context_line":"        name +\u003d \u0027#\u0027 + \u0027,\u0027.join(\u0027%s\u003d%s\u0027 % (k, v) for k, v in labels)"},{"line_number":49,"context_line":"        line \u003d _build_line_parts(name, value, type, sample_rate)"},{"line_number":50,"context_line":"        return line"},{"line_number":51,"context_line":""}],"source_content_type":"text/x-python","patch_set":47,"id":"45abe97d_5ebbe880","line":48,"updated":"2025-03-24 15:38:45.000000000","message":"librato seems happy to receive a trailing ``#`` with no tags, but it doesn\u0027t *require* the ``#`` in that case \n\n(I explored this by hacking the test here https://github.com/librato/statsd-librato-backend/blob/master/test/librato_tests.js#L107)\n\nhttps://review.opendev.org/c/openstack/swift/+/945334","commit_id":"b9ef50c32b28d5b361bca13e599f11e2c8c1559f"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"d336860735ebb739a79033e92980f4384386857f","unresolved":false,"context_lines":[{"line_number":45,"context_line":"    @staticmethod"},{"line_number":46,"context_line":"    def librato(name, value, type, sample_rate, labels):"},{"line_number":47,"context_line":"        # https://www.librato.com/docs/kb/collect/collection_agents/stastd/#stat-level-tags"},{"line_number":48,"context_line":"        name +\u003d \u0027#\u0027 + \u0027,\u0027.join(\u0027%s\u003d%s\u0027 % (k, v) for k, v in labels)"},{"line_number":49,"context_line":"        line \u003d _build_line_parts(name, value, type, sample_rate)"},{"line_number":50,"context_line":"        return line"},{"line_number":51,"context_line":""}],"source_content_type":"text/x-python","patch_set":47,"id":"d659b04b_34a0168d","line":48,"in_reply_to":"45abe97d_5ebbe880","updated":"2025-03-25 14:34:35.000000000","message":"Done","commit_id":"b9ef50c32b28d5b361bca13e599f11e2c8c1559f"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"a9258375c2563585fb1042693ed0cef69cc89f95","unresolved":true,"context_lines":[{"line_number":60,"context_line":"    def signalfx(name, value, type, sample_rate, labels):"},{"line_number":61,"context_line":"        # https://web.archive.org/web/20211123040355/https://docs.signalfx.com/en/latest/integrations/agent/monitors/collectd-statsd.html#adding-dimensions-to-statsd-metrics"},{"line_number":62,"context_line":"        # https://docs.splunk.com/Observability/gdi/statsd/statsd.html#adding-dimensions-to-statsd-metrics"},{"line_number":63,"context_line":"        name +\u003d \u0027[%s]\u0027 % \u0027,\u0027.join(\u0027%s\u003d%s\u0027 % (k, v) for k, v in labels)"},{"line_number":64,"context_line":"        line \u003d _build_line_parts(name, value, type, sample_rate)"},{"line_number":65,"context_line":"        return line"},{"line_number":66,"context_line":""}],"source_content_type":"text/x-python","patch_set":47,"id":"4e8bfcff_932c8b8d","line":63,"updated":"2025-03-24 15:38:45.000000000","message":"I wonder why we are supporting this mode because it sounds like it is obsolete [1], and in splunk being replaced by and otel collector with dogstatds tags [2]\n\n[1] https://docs.splunk.com/observability/en/gdi/monitors-network/statsd.html#adding-dimensions-to-statsd-metrics\n\n[2] https://docs.splunk.com/observability/en/gdi/opentelemetry/components/statsd-receiver.html#statsd-receiver\n\n[3] https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/statsdreceiver","commit_id":"b9ef50c32b28d5b361bca13e599f11e2c8c1559f"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0155681cc6e8a683f86ea18f95ff366b92da2532","unresolved":true,"context_lines":[{"line_number":60,"context_line":"    def signalfx(name, value, type, sample_rate, labels):"},{"line_number":61,"context_line":"        # https://web.archive.org/web/20211123040355/https://docs.signalfx.com/en/latest/integrations/agent/monitors/collectd-statsd.html#adding-dimensions-to-statsd-metrics"},{"line_number":62,"context_line":"        # https://docs.splunk.com/Observability/gdi/statsd/statsd.html#adding-dimensions-to-statsd-metrics"},{"line_number":63,"context_line":"        name +\u003d \u0027[%s]\u0027 % \u0027,\u0027.join(\u0027%s\u003d%s\u0027 % (k, v) for k, v in labels)"},{"line_number":64,"context_line":"        line \u003d _build_line_parts(name, value, type, sample_rate)"},{"line_number":65,"context_line":"        return line"},{"line_number":66,"context_line":""}],"source_content_type":"text/x-python","patch_set":47,"id":"4cd5a0b3_acbe8b33","line":63,"in_reply_to":"4e8bfcff_932c8b8d","updated":"2025-04-03 21:19:45.000000000","message":"it MUST be the case that the original author doesn\u0027t understand https://blog.codinghorror.com/the-best-code-is-no-code-at-all/\n\n\u003e Every time you write new code, you should do so reluctantly, under duress, because you completely exhausted all your other options\n\n^ words to live by IMHO\n\nthe fact you had to go and research \"Why are we supporting THIS?  Why not something else?  Would a different set be better?\" is reason enough to convince me the signalfx implementation should have *already been removed* - *I* don\u0027t need it and don\u0027t want to maintain unless it\u0027s needed by someone that otherwise wouldn\u0027t be able to use swift (i.e. someone needed it enough to submit a patch to add it, e.g. under duress, having exhausted other options)\n\nOTOH, it\u0027s done now and will probably be fine so I\u0027m inclined to let it slide and hope for the best (FLW) just to keep my focus on more important things.","commit_id":"b9ef50c32b28d5b361bca13e599f11e2c8c1559f"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"a9258375c2563585fb1042693ed0cef69cc89f95","unresolved":true,"context_lines":[{"line_number":75,"context_line":"    def dogstatsd(name, value, type, sample_rate, labels):"},{"line_number":76,"context_line":"        # https://docs.datadoghq.com/developers/dogstatsd/datagram_shell/?tab\u003dmetrics"},{"line_number":77,"context_line":"        line \u003d _build_line_parts(name, value, type, sample_rate)"},{"line_number":78,"context_line":"        line +\u003d \u0027|#\u0027 + \u0027,\u0027.join(\u0027%s:%s\u0027 % (k, v) for k, v in labels)"},{"line_number":79,"context_line":"        return line"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":""}],"source_content_type":"text/x-python","patch_set":47,"id":"1f7dcadf_81cf85f8","line":78,"updated":"2025-03-24 15:38:45.000000000","message":"The datadog python client [1] does NOT send the ``|#`` if there are no labels \n\n[1] https://datadogpy.readthedocs.io/en/latest/#datadog-dogstatsd\n\nSee https://review.opendev.org/c/openstack/swift/+/945334","commit_id":"b9ef50c32b28d5b361bca13e599f11e2c8c1559f"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"d336860735ebb739a79033e92980f4384386857f","unresolved":false,"context_lines":[{"line_number":75,"context_line":"    def dogstatsd(name, value, type, sample_rate, labels):"},{"line_number":76,"context_line":"        # https://docs.datadoghq.com/developers/dogstatsd/datagram_shell/?tab\u003dmetrics"},{"line_number":77,"context_line":"        line \u003d _build_line_parts(name, value, type, sample_rate)"},{"line_number":78,"context_line":"        line +\u003d \u0027|#\u0027 + \u0027,\u0027.join(\u0027%s:%s\u0027 % (k, v) for k, v in labels)"},{"line_number":79,"context_line":"        return line"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":""}],"source_content_type":"text/x-python","patch_set":47,"id":"9df48072_6ffd3753","line":78,"in_reply_to":"1f7dcadf_81cf85f8","updated":"2025-03-25 14:34:35.000000000","message":"Done","commit_id":"b9ef50c32b28d5b361bca13e599f11e2c8c1559f"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"dfe995f216edbb0c8cfdf4e5914ca52cc5f1a8b1","unresolved":true,"context_lines":[{"line_number":32,"context_line":"USER_VALUE_PATTERN \u003d re.compile(r\"[^0-9a-zA-Z_.]\")"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"def _build_line_parts(name, value, type, sample_rate):"},{"line_number":36,"context_line":"    line \u003d \u0027%s:%s|%s\u0027 % (name, value, type)"},{"line_number":37,"context_line":"    if sample_rate \u003c 1:"},{"line_number":38,"context_line":"        line +\u003d \u0027|@%s\u0027 % (sample_rate,)"}],"source_content_type":"text/x-python","patch_set":49,"id":"0a86b165_a80edc6c","line":35,"range":{"start_line":35,"start_character":35,"end_line":35,"end_character":39},"updated":"2025-03-25 15:57:08.000000000","message":"type is a builtin keyword - we should use a different arg name","commit_id":"d0047a8fe3f8eb702758de2d1773ba28c8c291e8"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"593028f17009a618dccd3bd88bb84541521fd9f4","unresolved":false,"context_lines":[{"line_number":32,"context_line":"USER_VALUE_PATTERN \u003d re.compile(r\"[^0-9a-zA-Z_.]\")"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"def _build_line_parts(name, value, type, sample_rate):"},{"line_number":36,"context_line":"    line \u003d \u0027%s:%s|%s\u0027 % (name, value, type)"},{"line_number":37,"context_line":"    if sample_rate \u003c 1:"},{"line_number":38,"context_line":"        line +\u003d \u0027|@%s\u0027 % (sample_rate,)"}],"source_content_type":"text/x-python","patch_set":49,"id":"7d458c14_bb94fcd6","line":35,"range":{"start_line":35,"start_character":35,"end_line":35,"end_character":39},"in_reply_to":"0a86b165_a80edc6c","updated":"2025-04-02 14:35:53.000000000","message":"Done","commit_id":"d0047a8fe3f8eb702758de2d1773ba28c8c291e8"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"d336860735ebb739a79033e92980f4384386857f","unresolved":true,"context_lines":[{"line_number":190,"context_line":"                \u0027value {1!r}: {2!r}\u0027.format("},{"line_number":191,"context_line":"                    k, v, result.group(0)))"},{"line_number":192,"context_line":"        conf_label \u003d STATSD_USER_LABEL_NAMESPACE + conf_label"},{"line_number":193,"context_line":"        default_labels[conf_label] \u003d v"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"    return LabeledStatsdClient("},{"line_number":196,"context_line":"        host, port,"}],"source_content_type":"text/x-python","patch_set":49,"id":"b3f16534_22365a54","line":193,"updated":"2025-03-25 14:34:35.000000000","message":"shouldn\u0027t we do this validation in the class constructor?","commit_id":"d0047a8fe3f8eb702758de2d1773ba28c8c291e8"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"d99be6cde3d1552e1d14eff7dd391dac120caa92","unresolved":false,"context_lines":[{"line_number":190,"context_line":"                \u0027value {1!r}: {2!r}\u0027.format("},{"line_number":191,"context_line":"                    k, v, result.group(0)))"},{"line_number":192,"context_line":"        conf_label \u003d STATSD_USER_LABEL_NAMESPACE + conf_label"},{"line_number":193,"context_line":"        default_labels[conf_label] \u003d v"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"    return LabeledStatsdClient("},{"line_number":196,"context_line":"        host, port,"}],"source_content_type":"text/x-python","patch_set":49,"id":"be948c42_2be9d346","line":193,"in_reply_to":"b3f16534_22365a54","updated":"2025-04-03 19:23:09.000000000","message":"chatted with Al, should address this in a follow-up patch","commit_id":"d0047a8fe3f8eb702758de2d1773ba28c8c291e8"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0155681cc6e8a683f86ea18f95ff366b92da2532","unresolved":true,"context_lines":[{"line_number":190,"context_line":"                \u0027value {1!r}: {2!r}\u0027.format("},{"line_number":191,"context_line":"                    k, v, result.group(0)))"},{"line_number":192,"context_line":"        conf_label \u003d STATSD_USER_LABEL_NAMESPACE + conf_label"},{"line_number":193,"context_line":"        default_labels[conf_label] \u003d v"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"    return LabeledStatsdClient("},{"line_number":196,"context_line":"        host, port,"}],"source_content_type":"text/x-python","patch_set":49,"id":"4df46f8b_696d6b59","line":193,"in_reply_to":"b3f16534_22365a54","updated":"2025-04-03 21:19:45.000000000","message":"well, we\u0027d have it iterate the conf.items to find them - then iterate default_labels to sanitize them\n\nwe could argue once you get to the class it\u0027s more of a garbage-in\u003d\u003egarbage-out sort of implementation and this validation belongs closer to the config parsing (user provided data passed un-sanitized to a class might be a kind of smell!)\n\nSince no external code should ever try to create a LabeledStatsdClient directly I think this method *is* the interface for this module, and how we organize that implementation after that is up to us.\n\nFWIW I couldn\u0027t find a helper that does the \"just find all option\u003d\u003evalue with this prefix in the config\" loop for us - if that already existed it might look better to just\n\n```\ndefault_labels \u003d read_prefixed_options(conf, STATSD_CONF_USER_LABEL_PREFIX)\n```\n\n... and have LabeledStatsdClient do the regex\n\n... but I think this is correct and fine.","commit_id":"d0047a8fe3f8eb702758de2d1773ba28c8c291e8"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"d336860735ebb739a79033e92980f4384386857f","unresolved":true,"context_lines":[{"line_number":321,"context_line":"        return socket.socket(self._sock_family, socket.SOCK_DGRAM)"},{"line_number":322,"context_line":""},{"line_number":323,"context_line":""},{"line_number":324,"context_line":"class StatsdClient(AbstractStatsdClient):"},{"line_number":325,"context_line":"    def __init__(self, host, port,"},{"line_number":326,"context_line":"                 base_prefix\u003d\u0027\u0027, tail_prefix\u003d\u0027\u0027,"},{"line_number":327,"context_line":"                 default_sample_rate\u003d1, sample_rate_factor\u003d1,"}],"source_content_type":"text/x-python","patch_set":49,"id":"d728d2a9_e4f2aa9d","line":324,"updated":"2025-03-25 14:34:35.000000000","message":"docstring would be good\n\nSee https://review.opendev.org/c/openstack/swift/+/945463","commit_id":"d0047a8fe3f8eb702758de2d1773ba28c8c291e8"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"c6bffda0a663def0d97886a1de8e3b97c4514299","unresolved":false,"context_lines":[{"line_number":321,"context_line":"        return socket.socket(self._sock_family, socket.SOCK_DGRAM)"},{"line_number":322,"context_line":""},{"line_number":323,"context_line":""},{"line_number":324,"context_line":"class StatsdClient(AbstractStatsdClient):"},{"line_number":325,"context_line":"    def __init__(self, host, port,"},{"line_number":326,"context_line":"                 base_prefix\u003d\u0027\u0027, tail_prefix\u003d\u0027\u0027,"},{"line_number":327,"context_line":"                 default_sample_rate\u003d1, sample_rate_factor\u003d1,"}],"source_content_type":"text/x-python","patch_set":49,"id":"e0c9b1f0_04a672fb","line":324,"in_reply_to":"d728d2a9_e4f2aa9d","updated":"2025-03-26 09:09:35.000000000","message":"Done","commit_id":"d0047a8fe3f8eb702758de2d1773ba28c8c291e8"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"d336860735ebb739a79033e92980f4384386857f","unresolved":true,"context_lines":[{"line_number":342,"context_line":"            if adjusted_sample_rate \u003c 1:"},{"line_number":343,"context_line":"                parts.append(\u0027@%s\u0027 % (adjusted_sample_rate,))"},{"line_number":344,"context_line":"            line \u003d \u0027|\u0027.join(parts)"},{"line_number":345,"context_line":"            return self._send_line(line)"},{"line_number":346,"context_line":""},{"line_number":347,"context_line":"    def _set_prefix(self, tail_prefix):"},{"line_number":348,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":49,"id":"4890032b_2e975cee","line":345,"updated":"2025-03-25 14:34:35.000000000","message":"we could use the helper function here:\n\n```\n        if self.emit_legacy and is_emitted:\n            name \u003d self._prefix + m_name\n            line \u003d _build_line_parts(\n                name, m_value, m_type, adjusted_sample_rate)\n            return self._send_line(line)\n\n```\n\nSee https://review.opendev.org/c/openstack/swift/+/945463","commit_id":"d0047a8fe3f8eb702758de2d1773ba28c8c291e8"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"c6bffda0a663def0d97886a1de8e3b97c4514299","unresolved":false,"context_lines":[{"line_number":342,"context_line":"            if adjusted_sample_rate \u003c 1:"},{"line_number":343,"context_line":"                parts.append(\u0027@%s\u0027 % (adjusted_sample_rate,))"},{"line_number":344,"context_line":"            line \u003d \u0027|\u0027.join(parts)"},{"line_number":345,"context_line":"            return self._send_line(line)"},{"line_number":346,"context_line":""},{"line_number":347,"context_line":"    def _set_prefix(self, tail_prefix):"},{"line_number":348,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":49,"id":"9574bb9a_10137063","line":345,"in_reply_to":"4890032b_2e975cee","updated":"2025-03-26 09:09:35.000000000","message":"Done","commit_id":"d0047a8fe3f8eb702758de2d1773ba28c8c291e8"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"d336860735ebb739a79033e92980f4384386857f","unresolved":true,"context_lines":[{"line_number":409,"context_line":"                metric, elapsed_time * 1000 / byte_xfer * 1000, sample_rate)"},{"line_number":410,"context_line":""},{"line_number":411,"context_line":""},{"line_number":412,"context_line":"class LabeledStatsdClient(AbstractStatsdClient):"},{"line_number":413,"context_line":"    def __init__(self, host, port,"},{"line_number":414,"context_line":"                 default_sample_rate\u003d1, sample_rate_factor\u003d1,"},{"line_number":415,"context_line":"                 label_mode\u003d\u0027disabled\u0027, default_labels\u003dNone,"}],"source_content_type":"text/x-python","patch_set":49,"id":"7261f043_e8b07672","line":412,"updated":"2025-03-25 14:34:35.000000000","message":"needs a docstring\n\nSee https://review.opendev.org/c/openstack/swift/+/945463","commit_id":"d0047a8fe3f8eb702758de2d1773ba28c8c291e8"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"c6bffda0a663def0d97886a1de8e3b97c4514299","unresolved":false,"context_lines":[{"line_number":409,"context_line":"                metric, elapsed_time * 1000 / byte_xfer * 1000, sample_rate)"},{"line_number":410,"context_line":""},{"line_number":411,"context_line":""},{"line_number":412,"context_line":"class LabeledStatsdClient(AbstractStatsdClient):"},{"line_number":413,"context_line":"    def __init__(self, host, port,"},{"line_number":414,"context_line":"                 default_sample_rate\u003d1, sample_rate_factor\u003d1,"},{"line_number":415,"context_line":"                 label_mode\u003d\u0027disabled\u0027, default_labels\u003dNone,"}],"source_content_type":"text/x-python","patch_set":49,"id":"191f8d15_f9682c13","line":412,"in_reply_to":"7261f043_e8b07672","updated":"2025-03-26 09:09:35.000000000","message":"Done","commit_id":"d0047a8fe3f8eb702758de2d1773ba28c8c291e8"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0155681cc6e8a683f86ea18f95ff366b92da2532","unresolved":true,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    @staticmethod"},{"line_number":62,"context_line":"    def signalfx(metric, value, metric_type, sample_rate, labels):"},{"line_number":63,"context_line":"        # https://web.archive.org/web/20211123040355/https://docs.signalfx.com/en/latest/integrations/agent/monitors/collectd-statsd.html#adding-dimensions-to-statsd-metrics"},{"line_number":64,"context_line":"        # https://docs.splunk.com/Observability/gdi/statsd/statsd.html#adding-dimensions-to-statsd-metrics"},{"line_number":65,"context_line":"        if labels:"},{"line_number":66,"context_line":"            metric +\u003d \u0027[%s]\u0027 % \u0027,\u0027.join(\u0027%s\u003d%s\u0027 % (k, v) for k, v in labels)"}],"source_content_type":"text/x-python","patch_set":53,"id":"9178a9a4_c6053198","line":63,"updated":"2025-04-03 21:19:45.000000000","message":"what is the point of the web archive link?\n\nthe link to \"Statsd (deprecated)\" seems sufficient.","commit_id":"7e5235894b4f590024d572f64ab0b3ba2b02c68b"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0155681cc6e8a683f86ea18f95ff366b92da2532","unresolved":true,"context_lines":[{"line_number":75,"context_line":"        line \u003d _build_line_parts(metric, value, metric_type, sample_rate)"},{"line_number":76,"context_line":"        return line"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    @staticmethod"},{"line_number":79,"context_line":"    def dogstatsd(metric, value, metric_type, sample_rate, labels):"},{"line_number":80,"context_line":"        # https://docs.datadoghq.com/developers/dogstatsd/datagram_shell/?tab\u003dmetrics"},{"line_number":81,"context_line":"        line \u003d _build_line_parts(metric, value, metric_type, sample_rate)"}],"source_content_type":"text/x-python","patch_set":53,"id":"f68550ef_c68833ed","line":78,"updated":"2025-04-03 21:19:45.000000000","message":"FWIW @staticmethod is my least favorite built-in decorator; I\u0027ll always complain about it\u0027s use.\n\nIt has IMHO one very narrow specific use-case and if you just assume it\u0027s always a smell you can normally tell when you don\u0027t need it and you\u0027re actually [ab]using python\u0027s classes to do something that doesn\u0027t make sense in python (at at least over-complicates things).  Typically because you\u0027re used to languages that don\u0027t have easy to use module functions and objects - i.e. just write some functions and a static dict to look them up by name or as a list.\n\nFWIW the one (and IMHO only) place you can tell you need python\u0027s staticmethod is when you have to have an real object, but need subclasses to be able to override a function in a subclass that will be used in a context where they MUST NOT have an instance of the object.  As you can imagine that\u0027s a *really weird* specific use-case - and this ain\u0027t that by a mile.","commit_id":"7e5235894b4f590024d572f64ab0b3ba2b02c68b"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0155681cc6e8a683f86ea18f95ff366b92da2532","unresolved":true,"context_lines":[{"line_number":97,"context_line":"    except AttributeError:"},{"line_number":98,"context_line":"        label_modes \u003d ["},{"line_number":99,"context_line":"            f for f in LabeledFormats.__dict__"},{"line_number":100,"context_line":"            if not f.startswith(\u0027__\u0027)]"},{"line_number":101,"context_line":"        raise ValueError("},{"line_number":102,"context_line":"            \u0027unknown statsd_label_mode %r; \u0027"},{"line_number":103,"context_line":"            \u0027expected one of %r\u0027 % (label_mode, label_modes))"}],"source_content_type":"text/x-python","patch_set":53,"id":"d54ca5f4_9fa8dab9","line":100,"updated":"2025-04-03 21:19:45.000000000","message":"FWIW when this dispatch pattern comes up I *always* end up preferring an explicit dictionary.\n\n```\ndef dogstatsd(...):\n   ...\n   \nLABEL_FORMATS \u003d {\n    \u0027dogstatsd\u0027: dogstatsd,\n    ...\n}\n```\n\nOne reason that pattern is best is if you ever want to collapse registered implementations into a common factory:\n\n```\nLABEL_FORMATS \u003d {\n    \u0027dogstatsd\u0027: dogstatsd,\n    \u0027graphite\u0027: std_append_to_metric(sep\u003d\u0027;\u0027),\n    \u0027influxdb\u0027: std_append_to_metric(sep\u003d\u0027,\u0027),\n}\n```\n\nIt\u0027s very explicit and incredibly flexible.\n\nWith this \"fancy\" \"use a class for distpatch\" chosen here you have to write:\n\n\n```\nclass LabelFormats:\n    graphite \u003d staticmethod(std_append_to_metric(sep\u003d\u0027,\u0027))\n```\n\n... or something equally silly.","commit_id":"7e5235894b4f590024d572f64ab0b3ba2b02c68b"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0155681cc6e8a683f86ea18f95ff366b92da2532","unresolved":false,"context_lines":[{"line_number":148,"context_line":"    \"\"\""},{"line_number":149,"context_line":"    Get an instance of LabeledStatsdClient using config settings."},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"    **config and defaults**::"},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"        log_statsd_host \u003d (disabled)"},{"line_number":154,"context_line":"        log_statsd_port \u003d 8125"}],"source_content_type":"text/x-python","patch_set":53,"id":"4dba933e_e01581d0","line":151,"updated":"2025-04-03 21:19:45.000000000","message":"what are these asterisks?\n\nOIC, I guess it\u0027s just BOLD - cause why not?\n\nhttps://storage.gra.cloud.ovh.net/v1/AUTH_dcaab5e32b234d56b626f72581e3644c/zuul_opendev_logs_007/openstack/007ce9c68b524f45b51899e70ab4bb81/docs/misc.html#swift.common.statsd_client.get_labeled_statsd_client","commit_id":"7e5235894b4f590024d572f64ab0b3ba2b02c68b"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0155681cc6e8a683f86ea18f95ff366b92da2532","unresolved":true,"context_lines":[{"line_number":361,"context_line":""},{"line_number":362,"context_line":"        self._set_prefix(tail_prefix)"},{"line_number":363,"context_line":""},{"line_number":364,"context_line":"    def _send(self, metric, value, metric_type, sample_rate):"},{"line_number":365,"context_line":"        is_emitted, adjusted_sample_rate \u003d self._is_emitted(sample_rate)"},{"line_number":366,"context_line":"        if self.emit_legacy and is_emitted:"},{"line_number":367,"context_line":"            metric \u003d self._prefix + metric"}],"source_content_type":"text/x-python","patch_set":53,"id":"21530c2c_7b42c3b6","line":364,"updated":"2025-04-03 21:19:45.000000000","message":"sample_rate isn\u0027t a kwarg in either subclass of AbstractStastdClient - even tho it\u0027s optional on the user facing methods in both - why would label be optional in the `LabeledStatsdClient._send` and not `sample_rate`?","commit_id":"7e5235894b4f590024d572f64ab0b3ba2b02c68b"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0155681cc6e8a683f86ea18f95ff366b92da2532","unresolved":true,"context_lines":[{"line_number":431,"context_line":"    def transfer_rate(self, metric, elapsed_time, byte_xfer, sample_rate\u003dNone):"},{"line_number":432,"context_line":"        if byte_xfer:"},{"line_number":433,"context_line":"            return self.timing("},{"line_number":434,"context_line":"                metric, elapsed_time * 1000 / byte_xfer * 1000, sample_rate)"},{"line_number":435,"context_line":""},{"line_number":436,"context_line":""},{"line_number":437,"context_line":"class LabeledStatsdClient(AbstractStatsdClient):"}],"source_content_type":"text/x-python","patch_set":53,"id":"d2f9b6f6_3d2b83ff","line":434,"updated":"2025-04-03 21:19:45.000000000","message":"looks like unrelated code churn.","commit_id":"7e5235894b4f590024d572f64ab0b3ba2b02c68b"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0155681cc6e8a683f86ea18f95ff366b92da2532","unresolved":true,"context_lines":[{"line_number":498,"context_line":"            sorted(all_labels.items()))"},{"line_number":499,"context_line":""},{"line_number":500,"context_line":"    def update_stats(self, metric, value, labels\u003dNone, sample_rate\u003dNone):"},{"line_number":501,"context_line":"        return self._send(metric, value, \u0027c\u0027, sample_rate, labels\u003dlabels)"},{"line_number":502,"context_line":""},{"line_number":503,"context_line":"    def increment(self, metric, labels\u003dNone, sample_rate\u003dNone):"},{"line_number":504,"context_line":"        return self.update_stats(metric, 1, labels, sample_rate)"}],"source_content_type":"text/x-python","patch_set":53,"id":"2a5fb9d6_7267b4a4","line":501,"updated":"2025-04-03 21:19:45.000000000","message":"I\u0027m not sure if it it bugs me that sample_rate and labels get flipped here - or that the LabeledStatsdClient has label as an optional kwarg such that it\u0027s required argument signature is essentially exactly the same as StatsdClient\n\nI think since AbstractStatsdClient does not provide `_send` we should fix the signature order all the way down to the LabelFormat function to just be labels, sample_rate\n\n... with the labels argument \"disappearing\" when you finally get to _build_send_line","commit_id":"7e5235894b4f590024d572f64ab0b3ba2b02c68b"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0155681cc6e8a683f86ea18f95ff366b92da2532","unresolved":true,"context_lines":[{"line_number":509,"context_line":"    def _timing(self, metric, timing_ms, labels, sample_rate):"},{"line_number":510,"context_line":"        # This method was added to disagregate timing metrics when testing"},{"line_number":511,"context_line":"        return self._send(metric, round(timing_ms, 4), \u0027ms\u0027,"},{"line_number":512,"context_line":"                          sample_rate, labels\u003dlabels)"},{"line_number":513,"context_line":""},{"line_number":514,"context_line":"    def timing(self, metric, timing_ms, labels\u003dNone, sample_rate\u003dNone):"},{"line_number":515,"context_line":"        return self._timing(metric, timing_ms, labels, sample_rate)"}],"source_content_type":"text/x-python","patch_set":53,"id":"c4ad3fc5_220a8216","line":512,"updated":"2025-04-03 21:19:45.000000000","message":"they\u0027re flipped again; why is label even a kwarg on `_send`!?","commit_id":"7e5235894b4f590024d572f64ab0b3ba2b02c68b"}],"swift/common/utils/__init__.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ff3be5e397da876afc37db5f8e895e7e70e55734","unresolved":true,"context_lines":[{"line_number":1377,"context_line":"        return self"},{"line_number":1378,"context_line":""},{"line_number":1379,"context_line":""},{"line_number":1380,"context_line":"LabelModes \u003d ["},{"line_number":1381,"context_line":"    \u0027disabled\u0027,"},{"line_number":1382,"context_line":"    \u0027graphite\u0027,"},{"line_number":1383,"context_line":"    \u0027influxdb\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"ea34882a_67c4e9e1","line":1380,"updated":"2024-02-22 16:04:46.000000000","message":"I think LABLE_MODES \u003d {...} would be more idiomatic for a static unordered collection that is mainly used to test inclusion\n\nIf you want to use make it look like a class (TileCase) - then maybe use an enum:\n\nhttps://docs.python.org/3/library/enum.html","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"b88b14f58de391e903bd8cb3bbc903924ac45ce2","unresolved":false,"context_lines":[{"line_number":1377,"context_line":"        return self"},{"line_number":1378,"context_line":""},{"line_number":1379,"context_line":""},{"line_number":1380,"context_line":"LabelModes \u003d ["},{"line_number":1381,"context_line":"    \u0027disabled\u0027,"},{"line_number":1382,"context_line":"    \u0027graphite\u0027,"},{"line_number":1383,"context_line":"    \u0027influxdb\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"4a6af70e_99301e02","line":1380,"in_reply_to":"ea34882a_67c4e9e1","updated":"2024-02-23 15:59:39.000000000","message":"Acknowledged","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ff3be5e397da876afc37db5f8e895e7e70e55734","unresolved":true,"context_lines":[{"line_number":1402,"context_line":"        self.random \u003d random"},{"line_number":1403,"context_line":"        self.logger \u003d logger"},{"line_number":1404,"context_line":"        self.label_mode \u003d label_mode"},{"line_number":1405,"context_line":"        self.emit_legacy \u003d emit_legacy or not self.statsd_labeling_enabled"},{"line_number":1406,"context_line":""},{"line_number":1407,"context_line":"        # Determine if host is IPv4 or IPv6"},{"line_number":1408,"context_line":"        addr_info, self._sock_family \u003d self._determine_sock_family(host, port)"}],"source_content_type":"text/x-python","patch_set":1,"id":"c0fab56c_21f45d1a","line":1405,"updated":"2024-02-22 16:04:46.000000000","message":"is this the only place we use the statsd_labeling_enabled property?  To configure the emit_legacy attribute?  I think it would be more clear to just have the boolean logic all right here in the setup\n\nif it\u0027s \"complicated\" enough that we feel like we need a function to encapsulate all the interactions of the various values I wonder how ops is going to understand it?  Maybe we should try to make the configuration as explicit and obvious as possible and raise an ERROR if we don\u0027t think the configuration ops gave us is sufficienlty unambigious about what the want/expect.","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"b88b14f58de391e903bd8cb3bbc903924ac45ce2","unresolved":true,"context_lines":[{"line_number":1402,"context_line":"        self.random \u003d random"},{"line_number":1403,"context_line":"        self.logger \u003d logger"},{"line_number":1404,"context_line":"        self.label_mode \u003d label_mode"},{"line_number":1405,"context_line":"        self.emit_legacy \u003d emit_legacy or not self.statsd_labeling_enabled"},{"line_number":1406,"context_line":""},{"line_number":1407,"context_line":"        # Determine if host is IPv4 or IPv6"},{"line_number":1408,"context_line":"        addr_info, self._sock_family \u003d self._determine_sock_family(host, port)"}],"source_content_type":"text/x-python","patch_set":1,"id":"f48d5373_5816db7c","line":1405,"in_reply_to":"c0fab56c_21f45d1a","updated":"2024-02-23 15:59:39.000000000","message":"That\u0027s the only place using the property. The orignal patch uses it in more places. Agree about having explicit boolean logic.","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":false,"context_lines":[{"line_number":1402,"context_line":"        self.random \u003d random"},{"line_number":1403,"context_line":"        self.logger \u003d logger"},{"line_number":1404,"context_line":"        self.label_mode \u003d label_mode"},{"line_number":1405,"context_line":"        self.emit_legacy \u003d emit_legacy or not self.statsd_labeling_enabled"},{"line_number":1406,"context_line":""},{"line_number":1407,"context_line":"        # Determine if host is IPv4 or IPv6"},{"line_number":1408,"context_line":"        addr_info, self._sock_family \u003d self._determine_sock_family(host, port)"}],"source_content_type":"text/x-python","patch_set":1,"id":"f8e80c41_e7d29942","line":1405,"in_reply_to":"f48d5373_5816db7c","updated":"2024-03-14 19:39:51.000000000","message":"it looks like this property went away or got re-named.","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ff3be5e397da876afc37db5f8e895e7e70e55734","unresolved":true,"context_lines":[{"line_number":1427,"context_line":""},{"line_number":1428,"context_line":"    @property"},{"line_number":1429,"context_line":"    def build_line(self):"},{"line_number":1430,"context_line":"        return getattr(self, \u0027build_line_\u0027 + self.label_mode)"},{"line_number":1431,"context_line":""},{"line_number":1432,"context_line":"    @property"},{"line_number":1433,"context_line":"    def statsd_labeling_enabled(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"e1148786_0fcf62f0","line":1430,"updated":"2024-02-22 16:04:46.000000000","message":"this isn\u0027t bad; I could also see it being done once in `__init__`\n\n    build_line_map \u003d {\n        \u0027dogstatsd\u0027: self.build_line_statsd,\n        ...\n    }\n    self._build_line_f \u003d build_line_map[self.label_mode]\n    \nwhen calling `self._build_line_f` every metric it would be slightly more efficient for the interpreter to lookup the objects attrbiute (it\u0027s just one bytecode and done in C) than calling the property method, doing a string concat, and calling the getattr function (which still has to do the attribute lookup)\n\nAlso I think it\u0027d be slightly better on \"the grep test\" [1] - if I wanted to debug \"build_line_librato\" so I went to the function defintion and then bounced on the name in my editor to see where it was called from - I\u0027d discover it \"appears\" like it\u0027s not called from anywhere!?  However w/ build_line_map the name would bounce me up into __init__ (the only other place that specific string appears in the file) and then I would see it\u0027s aliased as _build_line_f - which I could then bounce on to see from where it\u0027s called.\n\n1. https://jamie-wong.com/2013/07/12/grep-test/","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":false,"context_lines":[{"line_number":1427,"context_line":""},{"line_number":1428,"context_line":"    @property"},{"line_number":1429,"context_line":"    def build_line(self):"},{"line_number":1430,"context_line":"        return getattr(self, \u0027build_line_\u0027 + self.label_mode)"},{"line_number":1431,"context_line":""},{"line_number":1432,"context_line":"    @property"},{"line_number":1433,"context_line":"    def statsd_labeling_enabled(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa773b50_b6a62481","line":1430,"in_reply_to":"52fb1b6c_45ab9674","updated":"2024-03-14 19:39:51.000000000","message":"Done","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"b88b14f58de391e903bd8cb3bbc903924ac45ce2","unresolved":true,"context_lines":[{"line_number":1427,"context_line":""},{"line_number":1428,"context_line":"    @property"},{"line_number":1429,"context_line":"    def build_line(self):"},{"line_number":1430,"context_line":"        return getattr(self, \u0027build_line_\u0027 + self.label_mode)"},{"line_number":1431,"context_line":""},{"line_number":1432,"context_line":"    @property"},{"line_number":1433,"context_line":"    def statsd_labeling_enabled(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"52fb1b6c_45ab9674","line":1430,"in_reply_to":"e1148786_0fcf62f0","updated":"2024-02-23 15:59:39.000000000","message":"Good point","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ff3be5e397da876afc37db5f8e895e7e70e55734","unresolved":true,"context_lines":[{"line_number":1471,"context_line":"        :param tail_prefix: The new value of tail_prefix"},{"line_number":1472,"context_line":"        \"\"\""},{"line_number":1473,"context_line":"        if tail_prefix:"},{"line_number":1474,"context_line":"            self.default_labels[\u0027log_name\u0027] \u003d tail_prefix"},{"line_number":1475,"context_line":"        else:"},{"line_number":1476,"context_line":"            self.default_labels.pop(\u0027log_name\u0027, None)"},{"line_number":1477,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"da9ec50e_928c6006","line":1474,"updated":"2024-02-22 16:04:46.000000000","message":"I think this sort of makes sense?  If you configure a \"tail_prefix\" for this statsd instance you probably want that to appear as part of the labels as opposed to part of the metric name\n\n... but why call the label log_name?  are we *overwriting* the log_name that was previously configured?","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":false,"context_lines":[{"line_number":1471,"context_line":"        :param tail_prefix: The new value of tail_prefix"},{"line_number":1472,"context_line":"        \"\"\""},{"line_number":1473,"context_line":"        if tail_prefix:"},{"line_number":1474,"context_line":"            self.default_labels[\u0027log_name\u0027] \u003d tail_prefix"},{"line_number":1475,"context_line":"        else:"},{"line_number":1476,"context_line":"            self.default_labels.pop(\u0027log_name\u0027, None)"},{"line_number":1477,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3ec5488e_32e8a4bd","line":1474,"in_reply_to":"26d4d08c_b6d867ff","updated":"2024-03-14 19:39:51.000000000","message":"I do think that the legacy metrics used some combination of log_name and tail prefix to namespace metric names; I\u0027m not sure how much if any of that makes sense in the context of labeled metrics which are:\n\n1) already namedspaced as `swift_XXX` in their names by convention\n2) able to be sub-catagorized with additional labels: `req_ctx\u003d[subrequest|client]`\n\nIt looks like we\u0027ve already added support for `log_statsd_userlabel_req_ctx \u003d subrequest` - what use-case remains for log-name/tail_prefix in labled metrics that couldn\u0027t be solved with `log_statsd_userlable_*`?","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"b88b14f58de391e903bd8cb3bbc903924ac45ce2","unresolved":true,"context_lines":[{"line_number":1471,"context_line":"        :param tail_prefix: The new value of tail_prefix"},{"line_number":1472,"context_line":"        \"\"\""},{"line_number":1473,"context_line":"        if tail_prefix:"},{"line_number":1474,"context_line":"            self.default_labels[\u0027log_name\u0027] \u003d tail_prefix"},{"line_number":1475,"context_line":"        else:"},{"line_number":1476,"context_line":"            self.default_labels.pop(\u0027log_name\u0027, None)"},{"line_number":1477,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"26d4d08c_b6d867ff","line":1474,"in_reply_to":"da9ec50e_928c6006","updated":"2024-02-23 15:59:39.000000000","message":"It seems that historically log_name was used in config files, which maps to tail_prefix in code. Might not be correct understanding though.","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ff3be5e397da876afc37db5f8e895e7e70e55734","unresolved":true,"context_lines":[{"line_number":1473,"context_line":"        if tail_prefix:"},{"line_number":1474,"context_line":"            self.default_labels[\u0027log_name\u0027] \u003d tail_prefix"},{"line_number":1475,"context_line":"        else:"},{"line_number":1476,"context_line":"            self.default_labels.pop(\u0027log_name\u0027, None)"},{"line_number":1477,"context_line":""},{"line_number":1478,"context_line":"        if tail_prefix and self._base_prefix:"},{"line_number":1479,"context_line":"            self._prefix \u003d \u0027.\u0027.join([self._base_prefix, tail_prefix, \u0027\u0027])"}],"source_content_type":"text/x-python","patch_set":1,"id":"f8a87584_5dea0333","line":1476,"updated":"2024-02-22 16:04:46.000000000","message":"it\u0027s not immediately obvious why NOT setting tail_prefix means you don\u0027t want log-name - why did log_name get added to default_labels in the first place; it sort of looks like we never let log_name \u003d log_name in the default labels?","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":true,"context_lines":[{"line_number":1473,"context_line":"        if tail_prefix:"},{"line_number":1474,"context_line":"            self.default_labels[\u0027log_name\u0027] \u003d tail_prefix"},{"line_number":1475,"context_line":"        else:"},{"line_number":1476,"context_line":"            self.default_labels.pop(\u0027log_name\u0027, None)"},{"line_number":1477,"context_line":""},{"line_number":1478,"context_line":"        if tail_prefix and self._base_prefix:"},{"line_number":1479,"context_line":"            self._prefix \u003d \u0027.\u0027.join([self._base_prefix, tail_prefix, \u0027\u0027])"}],"source_content_type":"text/x-python","patch_set":1,"id":"236fc312_065fbf2a","line":1476,"in_reply_to":"040e07bc_2dbc5e77","updated":"2024-03-14 19:39:51.000000000","message":"THIS patch adds \"setting tail_prefix remove log_name in default_labels\" - I think we should NOT add that behavior.\n\nIt *may* be reasonable for log_name to end up in default labels by default - but it also might be reasonable for us to require all userlabels to be set explicitly in the config (and we just provide examples in all the places we document the statsd config).","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"aaa43ce00736b5d62297250c5924a2cba2c3f42a","unresolved":false,"context_lines":[{"line_number":1473,"context_line":"        if tail_prefix:"},{"line_number":1474,"context_line":"            self.default_labels[\u0027log_name\u0027] \u003d tail_prefix"},{"line_number":1475,"context_line":"        else:"},{"line_number":1476,"context_line":"            self.default_labels.pop(\u0027log_name\u0027, None)"},{"line_number":1477,"context_line":""},{"line_number":1478,"context_line":"        if tail_prefix and self._base_prefix:"},{"line_number":1479,"context_line":"            self._prefix \u003d \u0027.\u0027.join([self._base_prefix, tail_prefix, \u0027\u0027])"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a1a8a54_7d304053","line":1476,"in_reply_to":"236fc312_065fbf2a","updated":"2024-03-22 13:59:31.000000000","message":"Acknowledged","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"b88b14f58de391e903bd8cb3bbc903924ac45ce2","unresolved":true,"context_lines":[{"line_number":1473,"context_line":"        if tail_prefix:"},{"line_number":1474,"context_line":"            self.default_labels[\u0027log_name\u0027] \u003d tail_prefix"},{"line_number":1475,"context_line":"        else:"},{"line_number":1476,"context_line":"            self.default_labels.pop(\u0027log_name\u0027, None)"},{"line_number":1477,"context_line":""},{"line_number":1478,"context_line":"        if tail_prefix and self._base_prefix:"},{"line_number":1479,"context_line":"            self._prefix \u003d \u0027.\u0027.join([self._base_prefix, tail_prefix, \u0027\u0027])"}],"source_content_type":"text/x-python","patch_set":1,"id":"040e07bc_2dbc5e77","line":1476,"in_reply_to":"f8a87584_5dea0333","updated":"2024-02-23 15:59:39.000000000","message":"Need to find out why not setting tail_prefix removes log_name in default_labels.","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ff3be5e397da876afc37db5f8e895e7e70e55734","unresolved":true,"context_lines":[{"line_number":1482,"context_line":"        elif self._base_prefix:"},{"line_number":1483,"context_line":"            self._prefix \u003d self._base_prefix + \u0027.\u0027"},{"line_number":1484,"context_line":"        else:"},{"line_number":1485,"context_line":"            self._prefix \u003d \u0027\u0027"},{"line_number":1486,"context_line":""},{"line_number":1487,"context_line":"    def set_prefix(self, tail_prefix):"},{"line_number":1488,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"23ea0864_825347db","line":1485,"updated":"2024-02-22 16:04:46.000000000","message":"what\u0027s all this _prefix, _base_prefix stuff - should any of that be a part of labels?","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":true,"context_lines":[{"line_number":1482,"context_line":"        elif self._base_prefix:"},{"line_number":1483,"context_line":"            self._prefix \u003d self._base_prefix + \u0027.\u0027"},{"line_number":1484,"context_line":"        else:"},{"line_number":1485,"context_line":"            self._prefix \u003d \u0027\u0027"},{"line_number":1486,"context_line":""},{"line_number":1487,"context_line":"    def set_prefix(self, tail_prefix):"},{"line_number":1488,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"78c0338d_6ddfa036","line":1485,"in_reply_to":"1b1a20c4_b9cdbfa1","updated":"2024-03-14 19:39:51.000000000","message":"I think the legacy format *needed* some way to add extra metric \"keys\" to the metric and doing a `\u0027.\u0027.join(parts)` for all these metric name and prefix parts made sense.\n\nSince labeled metrics will have userlabel it may NOT be reasonable for ops to ever \"reconfigure\" the labeled metric *name* (although they can annotate StatsdClient\u0027s emitted lableled metrics with whatever extra labels they need - which should be sufficient to filter/aggreate any lableled metrics by label even if they always get the same metric name)","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"b88b14f58de391e903bd8cb3bbc903924ac45ce2","unresolved":true,"context_lines":[{"line_number":1482,"context_line":"        elif self._base_prefix:"},{"line_number":1483,"context_line":"            self._prefix \u003d self._base_prefix + \u0027.\u0027"},{"line_number":1484,"context_line":"        else:"},{"line_number":1485,"context_line":"            self._prefix \u003d \u0027\u0027"},{"line_number":1486,"context_line":""},{"line_number":1487,"context_line":"    def set_prefix(self, tail_prefix):"},{"line_number":1488,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"1b1a20c4_b9cdbfa1","line":1485,"in_reply_to":"23ea0864_825347db","updated":"2024-02-23 15:59:39.000000000","message":"Thought that other than log_name, any existing base_prefix/tail_prefix would still be added to metric name, similar to swift_ namespace in labled format, not part of labels.","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"bdfc1334e9e68c8277f5552478f9550ffbee36f5","unresolved":false,"context_lines":[{"line_number":1482,"context_line":"        elif self._base_prefix:"},{"line_number":1483,"context_line":"            self._prefix \u003d self._base_prefix + \u0027.\u0027"},{"line_number":1484,"context_line":"        else:"},{"line_number":1485,"context_line":"            self._prefix \u003d \u0027\u0027"},{"line_number":1486,"context_line":""},{"line_number":1487,"context_line":"    def set_prefix(self, tail_prefix):"},{"line_number":1488,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"31d79804_4312e47d","line":1485,"in_reply_to":"78c0338d_6ddfa036","updated":"2024-03-22 17:06:51.000000000","message":"Ack, updating this","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ff3be5e397da876afc37db5f8e895e7e70e55734","unresolved":true,"context_lines":[{"line_number":1543,"context_line":"        return line"},{"line_number":1544,"context_line":""},{"line_number":1545,"context_line":"    def _send(self, m_name, m_value, m_type, sample_rate):"},{"line_number":1546,"context_line":"              #labels\u003dNone, legacy_format\u003dNone"},{"line_number":1547,"context_line":"        \"\"\""},{"line_number":1548,"context_line":"        :returns: bytes sent; if not sent due to sample rate"},{"line_number":1549,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"373feba3_2874bc49","line":1546,"updated":"2024-02-22 16:04:46.000000000","message":"this commented code is still getting flagged in my editor","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"b88b14f58de391e903bd8cb3bbc903924ac45ce2","unresolved":false,"context_lines":[{"line_number":1543,"context_line":"        return line"},{"line_number":1544,"context_line":""},{"line_number":1545,"context_line":"    def _send(self, m_name, m_value, m_type, sample_rate):"},{"line_number":1546,"context_line":"              #labels\u003dNone, legacy_format\u003dNone"},{"line_number":1547,"context_line":"        \"\"\""},{"line_number":1548,"context_line":"        :returns: bytes sent; if not sent due to sample rate"},{"line_number":1549,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"1391d70d_a612e71a","line":1546,"in_reply_to":"373feba3_2874bc49","updated":"2024-02-23 15:59:39.000000000","message":"Updated the patch","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ff3be5e397da876afc37db5f8e895e7e70e55734","unresolved":true,"context_lines":[{"line_number":1545,"context_line":"    def _send(self, m_name, m_value, m_type, sample_rate):"},{"line_number":1546,"context_line":"              #labels\u003dNone, legacy_format\u003dNone"},{"line_number":1547,"context_line":"        \"\"\""},{"line_number":1548,"context_line":"        :returns: bytes sent; if not sent due to sample rate"},{"line_number":1549,"context_line":"        \"\"\""},{"line_number":1550,"context_line":"        if sample_rate is None:"},{"line_number":1551,"context_line":"            sample_rate \u003d self._default_sample_rate"}],"source_content_type":"text/x-python","patch_set":1,"id":"f820f239_d4eecec9","line":1548,"updated":"2024-02-22 16:04:46.000000000","message":"this still reads to me like \"if bytes not sent due to sample rate then we return bytes sent else ???\"\n\nif the return type is a tuple - say so.","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"b88b14f58de391e903bd8cb3bbc903924ac45ce2","unresolved":false,"context_lines":[{"line_number":1545,"context_line":"    def _send(self, m_name, m_value, m_type, sample_rate):"},{"line_number":1546,"context_line":"              #labels\u003dNone, legacy_format\u003dNone"},{"line_number":1547,"context_line":"        \"\"\""},{"line_number":1548,"context_line":"        :returns: bytes sent; if not sent due to sample rate"},{"line_number":1549,"context_line":"        \"\"\""},{"line_number":1550,"context_line":"        if sample_rate is None:"},{"line_number":1551,"context_line":"            sample_rate \u003d self._default_sample_rate"}],"source_content_type":"text/x-python","patch_set":1,"id":"2d1d3b94_0508ddc0","line":1548,"in_reply_to":"f820f239_d4eecec9","updated":"2024-02-23 15:59:39.000000000","message":"Updated the patch","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ff3be5e397da876afc37db5f8e895e7e70e55734","unresolved":true,"context_lines":[{"line_number":1551,"context_line":"            sample_rate \u003d self._default_sample_rate"},{"line_number":1552,"context_line":"        sample_rate \u003d sample_rate * self._sample_rate_factor"},{"line_number":1553,"context_line":""},{"line_number":1554,"context_line":"        if not self.emit_legacy and self.label_mode !\u003d \"disabled\":"},{"line_number":1555,"context_line":"            return 0, False"},{"line_number":1556,"context_line":""},{"line_number":1557,"context_line":"        parts \u003d [\u0027%s%s:%s\u0027 % (self._prefix, m_name, m_value), m_type]"}],"source_content_type":"text/x-python","patch_set":1,"id":"f5d42047_3ddc7949","line":1554,"updated":"2024-02-22 16:04:46.000000000","message":"I\u0027m confused by label_mode !\u003d \u0027disbaled\u0027 - are we say the user *has* to have legacy statsd metrics even if not emit_legacy when they didn\u0027t configure labeled metrics?  maybe they just don\u0027t want statsd?  Also isn\u0027t label_model !\u003d disabled sort of already baked into emit_legacy via the property?\n\nOMM all tests pass if i remove the RHS and just say \"if not self.emit_legacy\"","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"50170394e9a2eab07d7c82825159949e3f510ddd","unresolved":false,"context_lines":[{"line_number":1551,"context_line":"            sample_rate \u003d self._default_sample_rate"},{"line_number":1552,"context_line":"        sample_rate \u003d sample_rate * self._sample_rate_factor"},{"line_number":1553,"context_line":""},{"line_number":1554,"context_line":"        if not self.emit_legacy and self.label_mode !\u003d \"disabled\":"},{"line_number":1555,"context_line":"            return 0, False"},{"line_number":1556,"context_line":""},{"line_number":1557,"context_line":"        parts \u003d [\u0027%s%s:%s\u0027 % (self._prefix, m_name, m_value), m_type]"}],"source_content_type":"text/x-python","patch_set":1,"id":"228c6098_0b58f9ce","line":1554,"in_reply_to":"0f745281_1d5e82cd","updated":"2024-03-22 19:59:56.000000000","message":"Acknowledged","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":true,"context_lines":[{"line_number":1551,"context_line":"            sample_rate \u003d self._default_sample_rate"},{"line_number":1552,"context_line":"        sample_rate \u003d sample_rate * self._sample_rate_factor"},{"line_number":1553,"context_line":""},{"line_number":1554,"context_line":"        if not self.emit_legacy and self.label_mode !\u003d \"disabled\":"},{"line_number":1555,"context_line":"            return 0, False"},{"line_number":1556,"context_line":""},{"line_number":1557,"context_line":"        parts \u003d [\u0027%s%s:%s\u0027 % (self._prefix, m_name, m_value), m_type]"}],"source_content_type":"text/x-python","patch_set":1,"id":"151b832e_d366ce19","line":1554,"in_reply_to":"1411b1d5_700e638d","updated":"2024-03-14 19:39:51.000000000","message":"existing code allows you to not have statsd by not configuring the statsd host; that will probably work in this new design also.  I\u0027m not sure if ops should be able to configure a statsd host but also set legacy\u003dFalse and label_mode\u003d\u0027disabled\u0027 - that may just be a config error.","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"aaa43ce00736b5d62297250c5924a2cba2c3f42a","unresolved":true,"context_lines":[{"line_number":1551,"context_line":"            sample_rate \u003d self._default_sample_rate"},{"line_number":1552,"context_line":"        sample_rate \u003d sample_rate * self._sample_rate_factor"},{"line_number":1553,"context_line":""},{"line_number":1554,"context_line":"        if not self.emit_legacy and self.label_mode !\u003d \"disabled\":"},{"line_number":1555,"context_line":"            return 0, False"},{"line_number":1556,"context_line":""},{"line_number":1557,"context_line":"        parts \u003d [\u0027%s%s:%s\u0027 % (self._prefix, m_name, m_value), m_type]"}],"source_content_type":"text/x-python","patch_set":1,"id":"0f745281_1d5e82cd","line":1554,"in_reply_to":"151b832e_d366ce19","updated":"2024-03-22 13:59:31.000000000","message":"Ack, updated parameter","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"b88b14f58de391e903bd8cb3bbc903924ac45ce2","unresolved":true,"context_lines":[{"line_number":1551,"context_line":"            sample_rate \u003d self._default_sample_rate"},{"line_number":1552,"context_line":"        sample_rate \u003d sample_rate * self._sample_rate_factor"},{"line_number":1553,"context_line":""},{"line_number":1554,"context_line":"        if not self.emit_legacy and self.label_mode !\u003d \"disabled\":"},{"line_number":1555,"context_line":"            return 0, False"},{"line_number":1556,"context_line":""},{"line_number":1557,"context_line":"        parts \u003d [\u0027%s%s:%s\u0027 % (self._prefix, m_name, m_value), m_type]"}],"source_content_type":"text/x-python","patch_set":1,"id":"1411b1d5_700e638d","line":1554,"in_reply_to":"f5d42047_3ddc7949","updated":"2024-02-23 15:59:39.000000000","message":"Thought that existing code never allows user to not want statsd, thus we might want to maintain the behavior. Updating this parameter","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ff3be5e397da876afc37db5f8e895e7e70e55734","unresolved":true,"context_lines":[{"line_number":1984,"context_line":"    def statsd_labeling_enabled(self):"},{"line_number":1985,"context_line":"        if getattr(self.logger, \u0027statsd_client\u0027):"},{"line_number":1986,"context_line":"            return self.logger.statsd_client.statsd_labeling_enabled"},{"line_number":1987,"context_line":"        return False"},{"line_number":1988,"context_line":""},{"line_number":1989,"context_line":""},{"line_number":1990,"context_line":"class SwiftLogFormatter(logging.Formatter):"}],"source_content_type":"text/x-python","patch_set":1,"id":"e279eadd_ae5de240","line":1987,"updated":"2024-02-22 16:04:46.000000000","message":"i don\u0027t think this is used in this module - so this is some sort of new public interface (maybe for tests?\n\nI can\u0027t find where this is used at all; I\u0027d prefer we not have review/merge un-used code.","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"b88b14f58de391e903bd8cb3bbc903924ac45ce2","unresolved":false,"context_lines":[{"line_number":1984,"context_line":"    def statsd_labeling_enabled(self):"},{"line_number":1985,"context_line":"        if getattr(self.logger, \u0027statsd_client\u0027):"},{"line_number":1986,"context_line":"            return self.logger.statsd_client.statsd_labeling_enabled"},{"line_number":1987,"context_line":"        return False"},{"line_number":1988,"context_line":""},{"line_number":1989,"context_line":""},{"line_number":1990,"context_line":"class SwiftLogFormatter(logging.Formatter):"}],"source_content_type":"text/x-python","patch_set":1,"id":"75fe85b2_00cb02b5","line":1987,"in_reply_to":"e279eadd_ae5de240","updated":"2024-02-23 15:59:39.000000000","message":"Acknowledged","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ff3be5e397da876afc37db5f8e895e7e70e55734","unresolved":true,"context_lines":[{"line_number":2175,"context_line":"        label_mode \u003d conf.get(\u0027log_statsd_label_mode\u0027, \u0027\u0027).lower()"},{"line_number":2176,"context_line":"        emit_legacy \u003d config_true_value(conf.get(\u0027log_statsd_emit_legacy\u0027, \u0027\u0027))"},{"line_number":2177,"context_line":"        if label_mode not in LabelModes:"},{"line_number":2178,"context_line":"            label_mode \u003d \u0027disabled\u0027"},{"line_number":2179,"context_line":"        statsd_client \u003d StatsdClient(statsd_host, statsd_port, base_prefix,"},{"line_number":2180,"context_line":"                                     statsd_tail_prefix, default_sample_rate,"},{"line_number":2181,"context_line":"                                     sample_rate_factor, logger\u003dlogger,"}],"source_content_type":"text/x-python","patch_set":1,"id":"c40d11cf_18c862a3","line":2178,"updated":"2024-02-22 16:04:46.000000000","message":"i\u0027d prefer\n\n    raise ValueError(\u0027unknown log_statsd_label_mode %r; expected one of %r\u0027 % (label_mode, LabelModes))","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"b88b14f58de391e903bd8cb3bbc903924ac45ce2","unresolved":false,"context_lines":[{"line_number":2175,"context_line":"        label_mode \u003d conf.get(\u0027log_statsd_label_mode\u0027, \u0027\u0027).lower()"},{"line_number":2176,"context_line":"        emit_legacy \u003d config_true_value(conf.get(\u0027log_statsd_emit_legacy\u0027, \u0027\u0027))"},{"line_number":2177,"context_line":"        if label_mode not in LabelModes:"},{"line_number":2178,"context_line":"            label_mode \u003d \u0027disabled\u0027"},{"line_number":2179,"context_line":"        statsd_client \u003d StatsdClient(statsd_host, statsd_port, base_prefix,"},{"line_number":2180,"context_line":"                                     statsd_tail_prefix, default_sample_rate,"},{"line_number":2181,"context_line":"                                     sample_rate_factor, logger\u003dlogger,"}],"source_content_type":"text/x-python","patch_set":1,"id":"ce85e6df_719d0e45","line":2178,"in_reply_to":"c40d11cf_18c862a3","updated":"2024-02-23 15:59:39.000000000","message":"Acknowledged","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":true,"context_lines":[{"line_number":1364,"context_line":""},{"line_number":1365,"context_line":"class StatsdClient(object):"},{"line_number":1366,"context_line":"    def __init__(self, host, port, base_prefix\u003d\u0027\u0027, tail_prefix\u003d\u0027\u0027,"},{"line_number":1367,"context_line":"                 default_sample_rate\u003d1, sample_rate_factor\u003d1, logger\u003dNone):"},{"line_number":1368,"context_line":"        self._host \u003d host"},{"line_number":1369,"context_line":"        self._port \u003d port"},{"line_number":1370,"context_line":"        self._base_prefix \u003d base_prefix"}],"source_content_type":"text/x-python","patch_set":5,"id":"a4a8f97c_6d1bfed1","side":"PARENT","line":1367,"updated":"2024-03-14 19:39:51.000000000","message":"If Al would object to changing StatsdClient to require passing in a dictionary instead of all the named kwargs I can\u0027t imagine he\u0027d be much happier having to pass in an instance of a ParsedStatsdClientConfig.\n\nI think I\u0027ve made my preference clear to pass in a conf dict like servers and deamons get; but a compromise that would most closely follow existing patterns is probably the \"get_logger\" and \"load_memcache\" helpers functions; which I think would also be fine.\n\nUnless I\u0027m missing prior art I think this ParsedThingConfig object is a new pattern, and if we\u0027re going to introduce a third way to do it I\u0027d be curious if you\u0027ve considered the plan to migrate either servers/deamons or get_logger/load_memcache helpers to this new 3rd way so we don\u0027t have a sprawl of patterns for \"creating objects from config dicts\" depending on what part of the code-base we\u0027re maintaining?  *Or* IF you\u0027re not necessarily that interested if blocking the progress of labeled metrics on redefining the \"one true way to parse config dicts\" maybe you may instead opt to choose one of the existing patterns (however deficient they may seem) in the interest of focusing on our objectives?\n\nI think it\u0027s laudible to move statsd config parsing out of get_logger; that\u0027s bad already but gets worse everytime we add a new statsd client config option - which this change does.  So, I think something has to be done - and might expect that something should probably be \"look around the swift code base and try to pick something that will be familiar to maintainers so that I can claim prior art\" and get on the rest of it.","commit_id":"eb61f57cf27900de6d9c157a677f88137be48da0"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"c74705f3992929fb36f3a2d6bbbe87f57ba888f9","unresolved":false,"context_lines":[{"line_number":1364,"context_line":""},{"line_number":1365,"context_line":"class StatsdClient(object):"},{"line_number":1366,"context_line":"    def __init__(self, host, port, base_prefix\u003d\u0027\u0027, tail_prefix\u003d\u0027\u0027,"},{"line_number":1367,"context_line":"                 default_sample_rate\u003d1, sample_rate_factor\u003d1, logger\u003dNone):"},{"line_number":1368,"context_line":"        self._host \u003d host"},{"line_number":1369,"context_line":"        self._port \u003d port"},{"line_number":1370,"context_line":"        self._base_prefix \u003d base_prefix"}],"source_content_type":"text/x-python","patch_set":5,"id":"56991638_e8413ec8","side":"PARENT","line":1367,"in_reply_to":"1629c3c5_0072cd4a","updated":"2024-03-19 22:53:38.000000000","message":"The sharder also grew the config object because we wanted s-m-s-r and the sharder to share the same configuration. Originally they weren\u0027t. So it was a way of sharing configuration and still have the attributes available directly.\n\nSo in this case what does having a config class give us over a simple config dict?\nSorry just slowly loading what\u0027s happening in the world of labeled metrics in my head 😊","commit_id":"eb61f57cf27900de6d9c157a677f88137be48da0"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"aaa43ce00736b5d62297250c5924a2cba2c3f42a","unresolved":false,"context_lines":[{"line_number":1364,"context_line":""},{"line_number":1365,"context_line":"class StatsdClient(object):"},{"line_number":1366,"context_line":"    def __init__(self, host, port, base_prefix\u003d\u0027\u0027, tail_prefix\u003d\u0027\u0027,"},{"line_number":1367,"context_line":"                 default_sample_rate\u003d1, sample_rate_factor\u003d1, logger\u003dNone):"},{"line_number":1368,"context_line":"        self._host \u003d host"},{"line_number":1369,"context_line":"        self._port \u003d port"},{"line_number":1370,"context_line":"        self._base_prefix \u003d base_prefix"}],"source_content_type":"text/x-python","patch_set":5,"id":"6c6c1590_75f9c09b","side":"PARENT","line":1367,"in_reply_to":"56991638_e8413ec8","updated":"2024-03-22 13:59:31.000000000","message":"Thanks for the insight, Matt! Had some discussion with Clay and Al on this. Thinking that if using a class, the StatsdClient constructor could have a conf instance, reducing the amount of kwargs on API. The API would be easier to maintain particularly if the kwargs have config and non-config parameters.","commit_id":"eb61f57cf27900de6d9c157a677f88137be48da0"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"6eeef183a57026449905c8cef525d621b0fd1d0b","unresolved":false,"context_lines":[{"line_number":1364,"context_line":""},{"line_number":1365,"context_line":"class StatsdClient(object):"},{"line_number":1366,"context_line":"    def __init__(self, host, port, base_prefix\u003d\u0027\u0027, tail_prefix\u003d\u0027\u0027,"},{"line_number":1367,"context_line":"                 default_sample_rate\u003d1, sample_rate_factor\u003d1, logger\u003dNone):"},{"line_number":1368,"context_line":"        self._host \u003d host"},{"line_number":1369,"context_line":"        self._port \u003d port"},{"line_number":1370,"context_line":"        self._base_prefix \u003d base_prefix"}],"source_content_type":"text/x-python","patch_set":5,"id":"1629c3c5_0072cd4a","side":"PARENT","line":1367,"in_reply_to":"a4a8f97c_6d1bfed1","updated":"2024-03-15 18:41:19.000000000","message":"it turns out 1) Al sort of likes this idead and 2) we\u0027ve already done something similar in sharder: https://github.com/NVIDIA/swift/blob/master/swift/container/sharder.py#L758\n\nN.B. in that case the constructor for Sharder still takes a config-dict and uses an instance-of pattern to ensure instances of the Sharder still have the configured attributes accesible on self.attribute directly w/o having to jump through a self.conf.attribute","commit_id":"eb61f57cf27900de6d9c157a677f88137be48da0"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":true,"context_lines":[{"line_number":1455,"context_line":"    def _send(self, m_name, m_value, m_type, sample_rate):"},{"line_number":1456,"context_line":"        if sample_rate is None:"},{"line_number":1457,"context_line":"            sample_rate \u003d self._default_sample_rate"},{"line_number":1458,"context_line":"        sample_rate \u003d sample_rate * self._sample_rate_factor"},{"line_number":1459,"context_line":"        parts \u003d [\u0027%s%s:%s\u0027 % (self._prefix, m_name, m_value), m_type]"},{"line_number":1460,"context_line":"        if sample_rate \u003c 1:"},{"line_number":1461,"context_line":"            if self.random() \u003c sample_rate:"}],"source_content_type":"text/x-python","patch_set":5,"id":"83c740cd_76490457","side":"PARENT","line":1458,"updated":"2024-03-14 19:39:51.000000000","message":"this mutation `self.\u003cattribute\u003e` to `self._pconf.\u003cattribute\u003e` doesn\u0027t obviously improve maintainability, IMHO","commit_id":"eb61f57cf27900de6d9c157a677f88137be48da0"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"bdfc1334e9e68c8277f5552478f9550ffbee36f5","unresolved":false,"context_lines":[{"line_number":1455,"context_line":"    def _send(self, m_name, m_value, m_type, sample_rate):"},{"line_number":1456,"context_line":"        if sample_rate is None:"},{"line_number":1457,"context_line":"            sample_rate \u003d self._default_sample_rate"},{"line_number":1458,"context_line":"        sample_rate \u003d sample_rate * self._sample_rate_factor"},{"line_number":1459,"context_line":"        parts \u003d [\u0027%s%s:%s\u0027 % (self._prefix, m_name, m_value), m_type]"},{"line_number":1460,"context_line":"        if sample_rate \u003c 1:"},{"line_number":1461,"context_line":"            if self.random() \u003c sample_rate:"}],"source_content_type":"text/x-python","patch_set":5,"id":"a49bf17c_43fd360a","side":"PARENT","line":1458,"in_reply_to":"83c740cd_76490457","updated":"2024-03-22 17:06:51.000000000","message":"Acknowledged","commit_id":"eb61f57cf27900de6d9c157a677f88137be48da0"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":true,"context_lines":[{"line_number":1489,"context_line":""},{"line_number":1490,"context_line":"    def _timing(self, metric, timing_ms, sample_rate):"},{"line_number":1491,"context_line":"        # This method was added to disagregate timing metrics when testing"},{"line_number":1492,"context_line":"        return self._send(metric, round(timing_ms, 4), \u0027ms\u0027, sample_rate)"},{"line_number":1493,"context_line":""},{"line_number":1494,"context_line":"    def timing(self, metric, timing_ms, sample_rate\u003dNone):"},{"line_number":1495,"context_line":"        return self._timing(metric, timing_ms, sample_rate)"}],"source_content_type":"text/x-python","patch_set":5,"id":"cb92946e_762dfbad","side":"PARENT","line":1492,"updated":"2024-03-14 19:39:51.000000000","message":"I can see that really only `_timing` and `update_stats` actually call `_send` - and they both get updated to route to either `_send` or `_send_tag`\n\nthe rest are updated to just \"pass through\" labels.\n\nMaybe they should *all* pass through labels and _send itself should decide to call `_build_line_tags_f` or `_build_line_legacy` based on the presense of labels kwarg?","commit_id":"eb61f57cf27900de6d9c157a677f88137be48da0"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"bdfc1334e9e68c8277f5552478f9550ffbee36f5","unresolved":false,"context_lines":[{"line_number":1489,"context_line":""},{"line_number":1490,"context_line":"    def _timing(self, metric, timing_ms, sample_rate):"},{"line_number":1491,"context_line":"        # This method was added to disagregate timing metrics when testing"},{"line_number":1492,"context_line":"        return self._send(metric, round(timing_ms, 4), \u0027ms\u0027, sample_rate)"},{"line_number":1493,"context_line":""},{"line_number":1494,"context_line":"    def timing(self, metric, timing_ms, sample_rate\u003dNone):"},{"line_number":1495,"context_line":"        return self._timing(metric, timing_ms, sample_rate)"}],"source_content_type":"text/x-python","patch_set":5,"id":"f4994c15_65498d7a","side":"PARENT","line":1492,"in_reply_to":"cb92946e_762dfbad","updated":"2024-03-22 17:06:51.000000000","message":"Acknowledged","commit_id":"eb61f57cf27900de6d9c157a677f88137be48da0"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":true,"context_lines":[{"line_number":1987,"context_line":"        default_sample_rate \u003d float(conf.get("},{"line_number":1988,"context_line":"            \u0027log_statsd_default_sample_rate\u0027, 1))"},{"line_number":1989,"context_line":"        sample_rate_factor \u003d float(conf.get("},{"line_number":1990,"context_line":"            \u0027log_statsd_sample_rate_factor\u0027, 1))"},{"line_number":1991,"context_line":"        if statsd_tail_prefix is None:"},{"line_number":1992,"context_line":"            statsd_tail_prefix \u003d name"},{"line_number":1993,"context_line":"        statsd_client \u003d StatsdClient(statsd_host, statsd_port, base_prefix,"}],"source_content_type":"text/x-python","patch_set":5,"id":"5b834465_6a6c57b9","side":"PARENT","line":1990,"updated":"2024-03-14 19:39:51.000000000","message":"I\u0027m glad to see this statsd config parsing getting removed for the get_logger function!  I wish we could get rid of *more* of it!","commit_id":"eb61f57cf27900de6d9c157a677f88137be48da0"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"bdfc1334e9e68c8277f5552478f9550ffbee36f5","unresolved":false,"context_lines":[{"line_number":1987,"context_line":"        default_sample_rate \u003d float(conf.get("},{"line_number":1988,"context_line":"            \u0027log_statsd_default_sample_rate\u0027, 1))"},{"line_number":1989,"context_line":"        sample_rate_factor \u003d float(conf.get("},{"line_number":1990,"context_line":"            \u0027log_statsd_sample_rate_factor\u0027, 1))"},{"line_number":1991,"context_line":"        if statsd_tail_prefix is None:"},{"line_number":1992,"context_line":"            statsd_tail_prefix \u003d name"},{"line_number":1993,"context_line":"        statsd_client \u003d StatsdClient(statsd_host, statsd_port, base_prefix,"}],"source_content_type":"text/x-python","patch_set":5,"id":"75d68a49_a8cef57b","side":"PARENT","line":1990,"in_reply_to":"5b834465_6a6c57b9","updated":"2024-03-22 17:06:51.000000000","message":"Acknowledged","commit_id":"eb61f57cf27900de6d9c157a677f88137be48da0"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":true,"context_lines":[{"line_number":1375,"context_line":"STATSD_CONF_USERLABEL_PREFIX \u003d \u0027log_statsd_userlabel_\u0027"},{"line_number":1376,"context_line":""},{"line_number":1377,"context_line":""},{"line_number":1378,"context_line":"class ParsedStatsdClientConfig(object):"},{"line_number":1379,"context_line":"    def __init__(self, conf, tail_prefix\u003d\u0027\u0027):"},{"line_number":1380,"context_line":"        self.host \u003d conf.get(\u0027log_statsd_host\u0027)"},{"line_number":1381,"context_line":"        self.port \u003d int(conf.get(\u0027log_statsd_port\u0027, 8125))"}],"source_content_type":"text/x-python","patch_set":5,"id":"6f79a0df_efaf8dc9","line":1378,"updated":"2024-03-14 19:39:51.000000000","message":"this was an interesting idea but I don\u0027t much care for it.\n\nplease don\u0027t get discouraged; iteration is part of the swift process:\n\nhttps://github.com/NVIDIA/swift/blob/master/CONTRIBUTING.rst#swift-design-principles","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"50170394e9a2eab07d7c82825159949e3f510ddd","unresolved":false,"context_lines":[{"line_number":1375,"context_line":"STATSD_CONF_USERLABEL_PREFIX \u003d \u0027log_statsd_userlabel_\u0027"},{"line_number":1376,"context_line":""},{"line_number":1377,"context_line":""},{"line_number":1378,"context_line":"class ParsedStatsdClientConfig(object):"},{"line_number":1379,"context_line":"    def __init__(self, conf, tail_prefix\u003d\u0027\u0027):"},{"line_number":1380,"context_line":"        self.host \u003d conf.get(\u0027log_statsd_host\u0027)"},{"line_number":1381,"context_line":"        self.port \u003d int(conf.get(\u0027log_statsd_port\u0027, 8125))"}],"source_content_type":"text/x-python","patch_set":5,"id":"7d5f7e3a_0968495e","line":1378,"in_reply_to":"6cca6b73_1e58c990","updated":"2024-03-22 19:59:56.000000000","message":"Acknowledged","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"aaa43ce00736b5d62297250c5924a2cba2c3f42a","unresolved":true,"context_lines":[{"line_number":1375,"context_line":"STATSD_CONF_USERLABEL_PREFIX \u003d \u0027log_statsd_userlabel_\u0027"},{"line_number":1376,"context_line":""},{"line_number":1377,"context_line":""},{"line_number":1378,"context_line":"class ParsedStatsdClientConfig(object):"},{"line_number":1379,"context_line":"    def __init__(self, conf, tail_prefix\u003d\u0027\u0027):"},{"line_number":1380,"context_line":"        self.host \u003d conf.get(\u0027log_statsd_host\u0027)"},{"line_number":1381,"context_line":"        self.port \u003d int(conf.get(\u0027log_statsd_port\u0027, 8125))"}],"source_content_type":"text/x-python","patch_set":5,"id":"6cca6b73_1e58c990","line":1378,"in_reply_to":"6f79a0df_efaf8dc9","updated":"2024-03-22 13:59:31.000000000","message":"As discussed, tail_prefix is not in config","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":true,"context_lines":[{"line_number":1376,"context_line":""},{"line_number":1377,"context_line":""},{"line_number":1378,"context_line":"class ParsedStatsdClientConfig(object):"},{"line_number":1379,"context_line":"    def __init__(self, conf, tail_prefix\u003d\u0027\u0027):"},{"line_number":1380,"context_line":"        self.host \u003d conf.get(\u0027log_statsd_host\u0027)"},{"line_number":1381,"context_line":"        self.port \u003d int(conf.get(\u0027log_statsd_port\u0027, 8125))"},{"line_number":1382,"context_line":"        self.base_prefix \u003d conf.get(\u0027log_statsd_metric_prefix\u0027, \u0027\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"fde3da77_2a86057c","line":1379,"updated":"2024-03-14 19:39:51.000000000","message":"why does tail_prefix get special treatment?  It\u0027s in the config dict too isn\u0027t it?!","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"50170394e9a2eab07d7c82825159949e3f510ddd","unresolved":false,"context_lines":[{"line_number":1376,"context_line":""},{"line_number":1377,"context_line":""},{"line_number":1378,"context_line":"class ParsedStatsdClientConfig(object):"},{"line_number":1379,"context_line":"    def __init__(self, conf, tail_prefix\u003d\u0027\u0027):"},{"line_number":1380,"context_line":"        self.host \u003d conf.get(\u0027log_statsd_host\u0027)"},{"line_number":1381,"context_line":"        self.port \u003d int(conf.get(\u0027log_statsd_port\u0027, 8125))"},{"line_number":1382,"context_line":"        self.base_prefix \u003d conf.get(\u0027log_statsd_metric_prefix\u0027, \u0027\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"f3954686_2fb51679","line":1379,"in_reply_to":"272f3a82_cf390887","updated":"2024-03-22 19:59:56.000000000","message":"Acknowledged","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"aaa43ce00736b5d62297250c5924a2cba2c3f42a","unresolved":true,"context_lines":[{"line_number":1376,"context_line":""},{"line_number":1377,"context_line":""},{"line_number":1378,"context_line":"class ParsedStatsdClientConfig(object):"},{"line_number":1379,"context_line":"    def __init__(self, conf, tail_prefix\u003d\u0027\u0027):"},{"line_number":1380,"context_line":"        self.host \u003d conf.get(\u0027log_statsd_host\u0027)"},{"line_number":1381,"context_line":"        self.port \u003d int(conf.get(\u0027log_statsd_port\u0027, 8125))"},{"line_number":1382,"context_line":"        self.base_prefix \u003d conf.get(\u0027log_statsd_metric_prefix\u0027, \u0027\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"272f3a82_cf390887","line":1379,"in_reply_to":"fde3da77_2a86057c","updated":"2024-03-22 13:59:31.000000000","message":"As discussed, tail_prefix is not in config","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":true,"context_lines":[{"line_number":1421,"context_line":"                self.tail_prefix \u003d\u003d other.tail_prefix and"},{"line_number":1422,"context_line":"                self.label_mode \u003d\u003d other.label_mode and"},{"line_number":1423,"context_line":"                self.emit_legacy \u003d\u003d other.emit_legacy and"},{"line_number":1424,"context_line":"                self.default_labels \u003d\u003d other.default_labels)"},{"line_number":1425,"context_line":""},{"line_number":1426,"context_line":""},{"line_number":1427,"context_line":"class StatsdClient(object):"}],"source_content_type":"text/x-python","patch_set":5,"id":"5ec9b57e_ecba7c15","line":1424,"updated":"2024-03-14 19:39:51.000000000","message":"boilerplate code like this is annoying to maintain.  Is this equality evaluation even used? (no test_utils fail if I remove it)\n\nIf we can\u0027t remove this behavior as a requirement, can we at least use a container base class like a namedtuple or argparse.Namespace that does this kind of equality evaluation for us for free.","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"bdfc1334e9e68c8277f5552478f9550ffbee36f5","unresolved":false,"context_lines":[{"line_number":1421,"context_line":"                self.tail_prefix \u003d\u003d other.tail_prefix and"},{"line_number":1422,"context_line":"                self.label_mode \u003d\u003d other.label_mode and"},{"line_number":1423,"context_line":"                self.emit_legacy \u003d\u003d other.emit_legacy and"},{"line_number":1424,"context_line":"                self.default_labels \u003d\u003d other.default_labels)"},{"line_number":1425,"context_line":""},{"line_number":1426,"context_line":""},{"line_number":1427,"context_line":"class StatsdClient(object):"}],"source_content_type":"text/x-python","patch_set":5,"id":"6edc80f2_e1ad5a30","line":1424,"in_reply_to":"5ec9b57e_ecba7c15","updated":"2024-03-22 17:06:51.000000000","message":"It\u0027s used in unit tests such as assertEqual with mocked StatsdClient.\nUpdating this","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":true,"context_lines":[{"line_number":1464,"context_line":""},{"line_number":1465,"context_line":"    @property"},{"line_number":1466,"context_line":"    def _build_line_f(self):"},{"line_number":1467,"context_line":"        return self.build_line_map[self._pconf.label_mode]"},{"line_number":1468,"context_line":""},{"line_number":1469,"context_line":"    def _determine_sock_family(self, host, port):"},{"line_number":1470,"context_line":"        addr_info \u003d sock_family \u003d None"}],"source_content_type":"text/x-python","patch_set":5,"id":"6661fb4b_861c7d0a","line":1467,"updated":"2024-03-14 19:39:51.000000000","message":"why is this dynamic?  Can the \"correct\" value for the _build_line_f change over the lifetime of this object?  I\u0027d suggest we set the attribute once in `__init__` and be done with it.","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"bdfc1334e9e68c8277f5552478f9550ffbee36f5","unresolved":true,"context_lines":[{"line_number":1464,"context_line":""},{"line_number":1465,"context_line":"    @property"},{"line_number":1466,"context_line":"    def _build_line_f(self):"},{"line_number":1467,"context_line":"        return self.build_line_map[self._pconf.label_mode]"},{"line_number":1468,"context_line":""},{"line_number":1469,"context_line":"    def _determine_sock_family(self, host, port):"},{"line_number":1470,"context_line":"        addr_info \u003d sock_family \u003d None"}],"source_content_type":"text/x-python","patch_set":5,"id":"b16db416_c5802d6b","line":1467,"in_reply_to":"6661fb4b_861c7d0a","updated":"2024-03-22 17:06:51.000000000","message":"In unit tests there are code directly changing StatsdClient label_mode for testing purpose. Need to think about how to restructure the unit tests. Also this would support dynamic reloading of config if needed","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"a0a734b73158987742caf8c9a22a24a947c1df42","unresolved":false,"context_lines":[{"line_number":1464,"context_line":""},{"line_number":1465,"context_line":"    @property"},{"line_number":1466,"context_line":"    def _build_line_f(self):"},{"line_number":1467,"context_line":"        return self.build_line_map[self._pconf.label_mode]"},{"line_number":1468,"context_line":""},{"line_number":1469,"context_line":"    def _determine_sock_family(self, host, port):"},{"line_number":1470,"context_line":"        addr_info \u003d sock_family \u003d None"}],"source_content_type":"text/x-python","patch_set":5,"id":"7c659d4b_28461366","line":1467,"in_reply_to":"b16db416_c5802d6b","updated":"2024-07-02 15:34:51.000000000","message":"Acknowledged","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":true,"context_lines":[{"line_number":1503,"context_line":"        :param tail_prefix: The new value of tail_prefix"},{"line_number":1504,"context_line":"        \"\"\""},{"line_number":1505,"context_line":"        if tail_prefix:"},{"line_number":1506,"context_line":"            self._pconf.default_labels[\u0027log_name\u0027] \u003d tail_prefix"},{"line_number":1507,"context_line":"        else:"},{"line_number":1508,"context_line":"            self._pconf.default_labels.pop(\u0027log_name\u0027, None)"},{"line_number":1509,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"b8b7395d_06c90a28","line":1506,"updated":"2024-03-14 19:39:51.000000000","message":"I thought we decided that tail_prefix was only going to effect legacy metric names and we\u0027d use a different interface (e.g. userlabel) for annotating labeled metrics with additional context like \"subrequest\"","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"bdfc1334e9e68c8277f5552478f9550ffbee36f5","unresolved":false,"context_lines":[{"line_number":1503,"context_line":"        :param tail_prefix: The new value of tail_prefix"},{"line_number":1504,"context_line":"        \"\"\""},{"line_number":1505,"context_line":"        if tail_prefix:"},{"line_number":1506,"context_line":"            self._pconf.default_labels[\u0027log_name\u0027] \u003d tail_prefix"},{"line_number":1507,"context_line":"        else:"},{"line_number":1508,"context_line":"            self._pconf.default_labels.pop(\u0027log_name\u0027, None)"},{"line_number":1509,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"e4d553a6_3e9d5847","line":1506,"in_reply_to":"b8b7395d_06c90a28","updated":"2024-03-22 17:06:51.000000000","message":"Ack, updating this","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":true,"context_lines":[{"line_number":1528,"context_line":"        )"},{"line_number":1529,"context_line":"        self._set_prefix(tail_prefix)"},{"line_number":1530,"context_line":""},{"line_number":1531,"context_line":"    @staticmethod"},{"line_number":1532,"context_line":"    def build_line_librato(name, labels, value, type, sample_rate):"},{"line_number":1533,"context_line":"        # https://www.librato.com/docs/kb/collect/collection_agents/stastd/#stat-level-tags"},{"line_number":1534,"context_line":"        name +\u003d \u0027#\u0027 + \u0027,\u0027.join(\u0027%s\u003d%s\u0027 % (k, v) for k, v in labels)"}],"source_content_type":"text/x-python","patch_set":5,"id":"b701afa6_19462947","line":1531,"updated":"2024-03-14 19:39:51.000000000","message":"why are these static methods?  Are they ever called from the class directly without an instance object?  Probably module level functions would be best:\n\nhttps://www.seporaitis.net/posts/2020/05/05/python-staticmethod-usage/","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"79ca9dcffb3129da088dec924c2466b33c25710b","unresolved":true,"context_lines":[{"line_number":1528,"context_line":"        )"},{"line_number":1529,"context_line":"        self._set_prefix(tail_prefix)"},{"line_number":1530,"context_line":""},{"line_number":1531,"context_line":"    @staticmethod"},{"line_number":1532,"context_line":"    def build_line_librato(name, labels, value, type, sample_rate):"},{"line_number":1533,"context_line":"        # https://www.librato.com/docs/kb/collect/collection_agents/stastd/#stat-level-tags"},{"line_number":1534,"context_line":"        name +\u003d \u0027#\u0027 + \u0027,\u0027.join(\u0027%s\u003d%s\u0027 % (k, v) for k, v in labels)"}],"source_content_type":"text/x-python","patch_set":5,"id":"ea45335e_f5060944","line":1531,"in_reply_to":"2c2dee82_66ffbac7","updated":"2024-04-05 15:33:20.000000000","message":"Good point, once statsd client is in its own module, these could be static methods","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"bdfc1334e9e68c8277f5552478f9550ffbee36f5","unresolved":true,"context_lines":[{"line_number":1528,"context_line":"        )"},{"line_number":1529,"context_line":"        self._set_prefix(tail_prefix)"},{"line_number":1530,"context_line":""},{"line_number":1531,"context_line":"    @staticmethod"},{"line_number":1532,"context_line":"    def build_line_librato(name, labels, value, type, sample_rate):"},{"line_number":1533,"context_line":"        # https://www.librato.com/docs/kb/collect/collection_agents/stastd/#stat-level-tags"},{"line_number":1534,"context_line":"        name +\u003d \u0027#\u0027 + \u0027,\u0027.join(\u0027%s\u003d%s\u0027 % (k, v) for k, v in labels)"}],"source_content_type":"text/x-python","patch_set":5,"id":"cc0f2053_b922b074","line":1531,"in_reply_to":"b701afa6_19462947","updated":"2024-03-22 17:06:51.000000000","message":"These could be module level functions, but are so tightly related to the class. Seems better in the class scope even though the article suggests other module could still import these?","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"4a5d69443a658c97f8dc12b57814767548d767e9","unresolved":true,"context_lines":[{"line_number":1528,"context_line":"        )"},{"line_number":1529,"context_line":"        self._set_prefix(tail_prefix)"},{"line_number":1530,"context_line":""},{"line_number":1531,"context_line":"    @staticmethod"},{"line_number":1532,"context_line":"    def build_line_librato(name, labels, value, type, sample_rate):"},{"line_number":1533,"context_line":"        # https://www.librato.com/docs/kb/collect/collection_agents/stastd/#stat-level-tags"},{"line_number":1534,"context_line":"        name +\u003d \u0027#\u0027 + \u0027,\u0027.join(\u0027%s\u003d%s\u0027 % (k, v) for k, v in labels)"}],"source_content_type":"text/x-python","patch_set":5,"id":"2c2dee82_66ffbac7","line":1531,"in_reply_to":"cc0f2053_b922b074","updated":"2024-03-26 19:25:55.000000000","message":"FWIW, I also have them as static methods in https://review.opendev.org/c/openstack/swift/+/896968 I also did it because there\u0027s more than enough module-level functions already in utils -- it was a reasonably handy way to namespace them.\n\nMaybe we could re-evaluate after https://review.opendev.org/c/openstack/swift/+/914029 ?","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"a0a734b73158987742caf8c9a22a24a947c1df42","unresolved":false,"context_lines":[{"line_number":1528,"context_line":"        )"},{"line_number":1529,"context_line":"        self._set_prefix(tail_prefix)"},{"line_number":1530,"context_line":""},{"line_number":1531,"context_line":"    @staticmethod"},{"line_number":1532,"context_line":"    def build_line_librato(name, labels, value, type, sample_rate):"},{"line_number":1533,"context_line":"        # https://www.librato.com/docs/kb/collect/collection_agents/stastd/#stat-level-tags"},{"line_number":1534,"context_line":"        name +\u003d \u0027#\u0027 + \u0027,\u0027.join(\u0027%s\u003d%s\u0027 % (k, v) for k, v in labels)"}],"source_content_type":"text/x-python","patch_set":5,"id":"cbaaa069_3cfc77b3","line":1531,"in_reply_to":"ea45335e_f5060944","updated":"2024-07-02 15:34:51.000000000","message":"Acknowledged","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":true,"context_lines":[{"line_number":1570,"context_line":"        # https://docs.datadoghq.com/developers/dogstatsd/datagram_shell/?tab\u003dmetrics"},{"line_number":1571,"context_line":"        line \u003d \u0027%s:%s|%s\u0027 % (name, value, type)"},{"line_number":1572,"context_line":"        if sample_rate \u003c 1:"},{"line_number":1573,"context_line":"            line +\u003d \u0027@%s\u0027 % (sample_rate,)"},{"line_number":1574,"context_line":"        line +\u003d \u0027|#\u0027 + \u0027,\u0027.join(\u0027%s:%s\u0027 % (k, v) for k, v in labels)"},{"line_number":1575,"context_line":"        return line"},{"line_number":1576,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"ad7f1291_f1862ca2","line":1573,"updated":"2024-03-14 19:39:51.000000000","message":"I\u0027m noticing these two lines show up in all the build_line functions - possibly not worth trying to extract for readability and efficiency.","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"bdfc1334e9e68c8277f5552478f9550ffbee36f5","unresolved":false,"context_lines":[{"line_number":1570,"context_line":"        # https://docs.datadoghq.com/developers/dogstatsd/datagram_shell/?tab\u003dmetrics"},{"line_number":1571,"context_line":"        line \u003d \u0027%s:%s|%s\u0027 % (name, value, type)"},{"line_number":1572,"context_line":"        if sample_rate \u003c 1:"},{"line_number":1573,"context_line":"            line +\u003d \u0027@%s\u0027 % (sample_rate,)"},{"line_number":1574,"context_line":"        line +\u003d \u0027|#\u0027 + \u0027,\u0027.join(\u0027%s:%s\u0027 % (k, v) for k, v in labels)"},{"line_number":1575,"context_line":"        return line"},{"line_number":1576,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"c6d5aaff_3b0411a5","line":1573,"in_reply_to":"ad7f1291_f1862ca2","updated":"2024-03-22 17:06:51.000000000","message":"Acknowledged","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":true,"context_lines":[{"line_number":1574,"context_line":"        line +\u003d \u0027|#\u0027 + \u0027,\u0027.join(\u0027%s:%s\u0027 % (k, v) for k, v in labels)"},{"line_number":1575,"context_line":"        return line"},{"line_number":1576,"context_line":""},{"line_number":1577,"context_line":"    def _send(self, m_name, m_value, m_type, sample_rate):"},{"line_number":1578,"context_line":"        if sample_rate is None:"},{"line_number":1579,"context_line":"            sample_rate \u003d self._pconf.default_sample_rate"},{"line_number":1580,"context_line":"        sample_rate \u003d sample_rate * self._pconf.sample_rate_factor"}],"source_content_type":"text/x-python","patch_set":5,"id":"17797eac_4d69b5fb","line":1577,"updated":"2024-03-14 19:39:51.000000000","message":"I wonder what would happen if this method just grew a labels kwarg","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"bdfc1334e9e68c8277f5552478f9550ffbee36f5","unresolved":false,"context_lines":[{"line_number":1574,"context_line":"        line +\u003d \u0027|#\u0027 + \u0027,\u0027.join(\u0027%s:%s\u0027 % (k, v) for k, v in labels)"},{"line_number":1575,"context_line":"        return line"},{"line_number":1576,"context_line":""},{"line_number":1577,"context_line":"    def _send(self, m_name, m_value, m_type, sample_rate):"},{"line_number":1578,"context_line":"        if sample_rate is None:"},{"line_number":1579,"context_line":"            sample_rate \u003d self._pconf.default_sample_rate"},{"line_number":1580,"context_line":"        sample_rate \u003d sample_rate * self._pconf.sample_rate_factor"}],"source_content_type":"text/x-python","patch_set":5,"id":"5ef90991_8a5dae97","line":1577,"in_reply_to":"17797eac_4d69b5fb","updated":"2024-03-22 17:06:51.000000000","message":"Acknowledged","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":true,"context_lines":[{"line_number":1587,"context_line":"            if self.random() \u003c sample_rate:"},{"line_number":1588,"context_line":"                parts.append(\u0027@%s\u0027 % (sample_rate,))"},{"line_number":1589,"context_line":"            else:"},{"line_number":1590,"context_line":"                return"},{"line_number":1591,"context_line":"        if six.PY3:"},{"line_number":1592,"context_line":"            parts \u003d [part.encode(\u0027utf-8\u0027) for part in parts]"},{"line_number":1593,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"ea45568b_73a063eb","line":1590,"updated":"2024-03-14 19:39:51.000000000","message":"I wonder if some of this logic should be extracted to a build_line_legacy helper for consistency with the rest of the formatting logic.","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"bdfc1334e9e68c8277f5552478f9550ffbee36f5","unresolved":false,"context_lines":[{"line_number":1587,"context_line":"            if self.random() \u003c sample_rate:"},{"line_number":1588,"context_line":"                parts.append(\u0027@%s\u0027 % (sample_rate,))"},{"line_number":1589,"context_line":"            else:"},{"line_number":1590,"context_line":"                return"},{"line_number":1591,"context_line":"        if six.PY3:"},{"line_number":1592,"context_line":"            parts \u003d [part.encode(\u0027utf-8\u0027) for part in parts]"},{"line_number":1593,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"a6fc7916_fe36c980","line":1590,"in_reply_to":"ea45568b_73a063eb","updated":"2024-03-22 17:06:51.000000000","message":"Acknowledged","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":true,"context_lines":[{"line_number":1635,"context_line":"                if self.logger:"},{"line_number":1636,"context_line":"                    self.logger.warning("},{"line_number":1637,"context_line":"                        \u0027Error sending UDP message to %(target)r: %(err)s\u0027,"},{"line_number":1638,"context_line":"                        {\u0027target\u0027: self._target, \u0027err\u0027: err})"},{"line_number":1639,"context_line":""},{"line_number":1640,"context_line":"    def _open_socket(self):"},{"line_number":1641,"context_line":"        return socket.socket(self._sock_family, socket.SOCK_DGRAM)"}],"source_content_type":"text/x-python","patch_set":5,"id":"7e0a2a81_d9555f23","line":1638,"updated":"2024-03-14 19:39:51.000000000","message":"this actual \"sock.send\" code is mostly duplicated with _send - it seems like these two functions could share some underlying method.","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"d2c33835b21188df24083bdef743ea60c3c98c66","unresolved":false,"context_lines":[{"line_number":1635,"context_line":"                if self.logger:"},{"line_number":1636,"context_line":"                    self.logger.warning("},{"line_number":1637,"context_line":"                        \u0027Error sending UDP message to %(target)r: %(err)s\u0027,"},{"line_number":1638,"context_line":"                        {\u0027target\u0027: self._target, \u0027err\u0027: err})"},{"line_number":1639,"context_line":""},{"line_number":1640,"context_line":"    def _open_socket(self):"},{"line_number":1641,"context_line":"        return socket.socket(self._sock_family, socket.SOCK_DGRAM)"}],"source_content_type":"text/x-python","patch_set":5,"id":"92f85d01_ef0e0dc0","line":1638,"in_reply_to":"6b621f2d_6f50cdfd","updated":"2024-04-05 15:34:01.000000000","message":"Acknowledged","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"bdfc1334e9e68c8277f5552478f9550ffbee36f5","unresolved":true,"context_lines":[{"line_number":1635,"context_line":"                if self.logger:"},{"line_number":1636,"context_line":"                    self.logger.warning("},{"line_number":1637,"context_line":"                        \u0027Error sending UDP message to %(target)r: %(err)s\u0027,"},{"line_number":1638,"context_line":"                        {\u0027target\u0027: self._target, \u0027err\u0027: err})"},{"line_number":1639,"context_line":""},{"line_number":1640,"context_line":"    def _open_socket(self):"},{"line_number":1641,"context_line":"        return socket.socket(self._sock_family, socket.SOCK_DGRAM)"}],"source_content_type":"text/x-python","patch_set":5,"id":"6b621f2d_6f50cdfd","line":1638,"in_reply_to":"7e0a2a81_d9555f23","updated":"2024-03-22 17:06:51.000000000","message":"This approach attempts to minimize the changes to existing non-labeled code, including this method. Tim\u0027s original patch actually changes this method to send either non-labeled or labeled format. Probably should try that here","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":true,"context_lines":[{"line_number":2059,"context_line":""},{"line_number":2060,"context_line":""},{"line_number":2061,"context_line":"def get_logger(conf, name\u003dNone, log_to_console\u003dFalse, log_route\u003dNone,"},{"line_number":2062,"context_line":"               fmt\u003d\"%(server)s: %(message)s\", statsd_tail_prefix\u003dNone):"},{"line_number":2063,"context_line":"    \"\"\""},{"line_number":2064,"context_line":"    Get the current system logger using config settings."},{"line_number":2065,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"d44d6d86_0c4db5ef","line":2062,"updated":"2024-03-14 19:39:51.000000000","message":"I\u0027m totally surprised to see statsd_tail_prefix part of get_logger\u0027s public signature!?\n\nThis history is probably best understood as a leaky abstraction:\n\n```\n        statsd_tail_prefix \u003d \u0027tempauth.%s\u0027 % (\n            self.reseller_prefix if self.reseller_prefix else \u0027NONE\u0027,)\n        self.logger \u003d get_logger(conf, log_route\u003d\u0027tempauth\u0027,\n                                 statsd_tail_prefix\u003dstatsd_tail_prefix)\n```\n\n^ from common.mw.tempauth\n\nPerhaps the way out is to start by making existing consumers of tail_prefix (there\u0027s only four) have this option become entirely configurable but default to their existing implementation when unconfigured.  The kwarg could be removed from get_logger signature as passed in as conf key all the way to StatsdClient which will respect the config option like it did the existing kwarg.\n\nWe then document the option, along with it\u0027s existing backwards compatible defaults and recommend ops \u0027ought not need change it - but SHOULD think about how they want to annotate their new labeled metrics using userlabels and we could provide some examples (if not out right defaults) for the same middlewares that previously wanted to annotate legacy format metrics with extra dotted keys in the metrics.","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"bdfc1334e9e68c8277f5552478f9550ffbee36f5","unresolved":false,"context_lines":[{"line_number":2059,"context_line":""},{"line_number":2060,"context_line":""},{"line_number":2061,"context_line":"def get_logger(conf, name\u003dNone, log_to_console\u003dFalse, log_route\u003dNone,"},{"line_number":2062,"context_line":"               fmt\u003d\"%(server)s: %(message)s\", statsd_tail_prefix\u003dNone):"},{"line_number":2063,"context_line":"    \"\"\""},{"line_number":2064,"context_line":"    Get the current system logger using config settings."},{"line_number":2065,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"fb21870d_2c8b3249","line":2062,"in_reply_to":"d44d6d86_0c4db5ef","updated":"2024-03-22 17:06:51.000000000","message":"Acknowledged","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":true,"context_lines":[{"line_number":2077,"context_line":"        log_statsd_default_sample_rate \u003d 1.0"},{"line_number":2078,"context_line":"        log_statsd_sample_rate_factor \u003d 1.0"},{"line_number":2079,"context_line":"        log_statsd_metric_prefix \u003d (empty-string)"},{"line_number":2080,"context_line":"        log_statsd_label_mode \u003d disabled"},{"line_number":2081,"context_line":""},{"line_number":2082,"context_line":"    :param conf: Configuration dict to read settings from"},{"line_number":2083,"context_line":"    :param name: This value is used to populate the ``server`` field in the log"}],"source_content_type":"text/x-python","patch_set":5,"id":"b76a7bc9_8fcf6f69","line":2080,"updated":"2024-03-14 19:39:51.000000000","message":"I wonder how much it really makes sense to try and keep this methods doc-string up-to-date with all the possible statsd config options; obviously as long as we\u0027re hanging a StatsdClient off a logger we need to create one; but maybe their enumeration of relavent options would look best on a `get_statsd_client` function (which we document get_logger as passing the config dict into)","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"50170394e9a2eab07d7c82825159949e3f510ddd","unresolved":false,"context_lines":[{"line_number":2077,"context_line":"        log_statsd_default_sample_rate \u003d 1.0"},{"line_number":2078,"context_line":"        log_statsd_sample_rate_factor \u003d 1.0"},{"line_number":2079,"context_line":"        log_statsd_metric_prefix \u003d (empty-string)"},{"line_number":2080,"context_line":"        log_statsd_label_mode \u003d disabled"},{"line_number":2081,"context_line":""},{"line_number":2082,"context_line":"    :param conf: Configuration dict to read settings from"},{"line_number":2083,"context_line":"    :param name: This value is used to populate the ``server`` field in the log"}],"source_content_type":"text/x-python","patch_set":5,"id":"c9c666f3_7c4a5c40","line":2080,"in_reply_to":"955288f4_55c160f0","updated":"2024-03-22 19:59:56.000000000","message":"Acknowledged","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"bdfc1334e9e68c8277f5552478f9550ffbee36f5","unresolved":true,"context_lines":[{"line_number":2077,"context_line":"        log_statsd_default_sample_rate \u003d 1.0"},{"line_number":2078,"context_line":"        log_statsd_sample_rate_factor \u003d 1.0"},{"line_number":2079,"context_line":"        log_statsd_metric_prefix \u003d (empty-string)"},{"line_number":2080,"context_line":"        log_statsd_label_mode \u003d disabled"},{"line_number":2081,"context_line":""},{"line_number":2082,"context_line":"    :param conf: Configuration dict to read settings from"},{"line_number":2083,"context_line":"    :param name: This value is used to populate the ``server`` field in the log"}],"source_content_type":"text/x-python","patch_set":5,"id":"955288f4_55c160f0","line":2080,"in_reply_to":"b76a7bc9_8fcf6f69","updated":"2024-03-22 17:06:51.000000000","message":"Ack. Should move this to the parsing method or class","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":true,"context_lines":[{"line_number":2163,"context_line":"        getattr(logging, conf.get(\u0027log_level\u0027, \u0027INFO\u0027).upper(), logging.INFO))"},{"line_number":2164,"context_line":""},{"line_number":2165,"context_line":"    # Setup logger with a StatsD client if so configured"},{"line_number":2166,"context_line":"    statsd_host \u003d conf.get(\u0027log_statsd_host\u0027)"},{"line_number":2167,"context_line":"    if statsd_host:"},{"line_number":2168,"context_line":"        if statsd_tail_prefix is None:"},{"line_number":2169,"context_line":"            statsd_tail_prefix \u003d name"}],"source_content_type":"text/x-python","patch_set":5,"id":"35d88121_b08ff60f","line":2166,"updated":"2024-03-14 19:39:51.000000000","message":"I could imagine a `get_statsd_client` function that just returns None when `log_statsd_host` is not set and `get_logger` could always call:\n\n    logger.statsd_client \u003d get_statsd_client(conf)","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"bdfc1334e9e68c8277f5552478f9550ffbee36f5","unresolved":false,"context_lines":[{"line_number":2163,"context_line":"        getattr(logging, conf.get(\u0027log_level\u0027, \u0027INFO\u0027).upper(), logging.INFO))"},{"line_number":2164,"context_line":""},{"line_number":2165,"context_line":"    # Setup logger with a StatsD client if so configured"},{"line_number":2166,"context_line":"    statsd_host \u003d conf.get(\u0027log_statsd_host\u0027)"},{"line_number":2167,"context_line":"    if statsd_host:"},{"line_number":2168,"context_line":"        if statsd_tail_prefix is None:"},{"line_number":2169,"context_line":"            statsd_tail_prefix \u003d name"}],"source_content_type":"text/x-python","patch_set":5,"id":"bae242f3_68442780","line":2166,"in_reply_to":"35d88121_b08ff60f","updated":"2024-03-22 17:06:51.000000000","message":"Acknowledged","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":true,"context_lines":[{"line_number":2169,"context_line":"            statsd_tail_prefix \u003d name"},{"line_number":2170,"context_line":"        statsd_client \u003d StatsdClient(ParsedStatsdClientConfig("},{"line_number":2171,"context_line":"            conf,"},{"line_number":2172,"context_line":"            tail_prefix\u003dstatsd_tail_prefix"},{"line_number":2173,"context_line":"        ), logger\u003dlogger)"},{"line_number":2174,"context_line":"        logger.statsd_client \u003d statsd_client"},{"line_number":2175,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":5,"id":"f864eb40_22d2ef6f","line":2172,"updated":"2024-03-14 19:39:51.000000000","message":"boy that statsd_tail_prefix really stands out like a sore thumb here doesn\u0027t it.","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"50170394e9a2eab07d7c82825159949e3f510ddd","unresolved":false,"context_lines":[{"line_number":2169,"context_line":"            statsd_tail_prefix \u003d name"},{"line_number":2170,"context_line":"        statsd_client \u003d StatsdClient(ParsedStatsdClientConfig("},{"line_number":2171,"context_line":"            conf,"},{"line_number":2172,"context_line":"            tail_prefix\u003dstatsd_tail_prefix"},{"line_number":2173,"context_line":"        ), logger\u003dlogger)"},{"line_number":2174,"context_line":"        logger.statsd_client \u003d statsd_client"},{"line_number":2175,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":5,"id":"2661d5fd_87fddd98","line":2172,"in_reply_to":"08aa8d5c_624fe3f4","updated":"2024-03-22 19:59:56.000000000","message":"Acknowledged","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"bdfc1334e9e68c8277f5552478f9550ffbee36f5","unresolved":true,"context_lines":[{"line_number":2169,"context_line":"            statsd_tail_prefix \u003d name"},{"line_number":2170,"context_line":"        statsd_client \u003d StatsdClient(ParsedStatsdClientConfig("},{"line_number":2171,"context_line":"            conf,"},{"line_number":2172,"context_line":"            tail_prefix\u003dstatsd_tail_prefix"},{"line_number":2173,"context_line":"        ), logger\u003dlogger)"},{"line_number":2174,"context_line":"        logger.statsd_client \u003d statsd_client"},{"line_number":2175,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":5,"id":"08aa8d5c_624fe3f4","line":2172,"in_reply_to":"f864eb40_22d2ef6f","updated":"2024-03-22 17:06:51.000000000","message":"Indeed","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"4a5d69443a658c97f8dc12b57814767548d767e9","unresolved":true,"context_lines":[{"line_number":21,"context_line":"import binascii"},{"line_number":22,"context_line":"import bisect"},{"line_number":23,"context_line":"import collections"},{"line_number":24,"context_line":"from enum import Enum"},{"line_number":25,"context_line":"import errno"},{"line_number":26,"context_line":"import fcntl"},{"line_number":27,"context_line":"import grp"}],"source_content_type":"text/x-python","patch_set":8,"id":"e9930fd6_7ecf4bd6","line":24,"updated":"2024-03-26 19:25:55.000000000","message":"This isn\u0027t in stdlib on py2; we generally pull it in as a transitive dep by way of pykmip, but we should list `enum-compat`/`enum34` in `requirements.txt` now (particularly since pykmip is an optional dep).","commit_id":"1e67567fda21b3f1197765b0f5963e6f3f3d4bc0"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"a0a734b73158987742caf8c9a22a24a947c1df42","unresolved":false,"context_lines":[{"line_number":21,"context_line":"import binascii"},{"line_number":22,"context_line":"import bisect"},{"line_number":23,"context_line":"import collections"},{"line_number":24,"context_line":"from enum import Enum"},{"line_number":25,"context_line":"import errno"},{"line_number":26,"context_line":"import fcntl"},{"line_number":27,"context_line":"import grp"}],"source_content_type":"text/x-python","patch_set":8,"id":"6e63bb4d_3e42593a","line":24,"in_reply_to":"a7661609_7e12eaf4","updated":"2024-07-02 15:34:51.000000000","message":"Acknowledged","commit_id":"1e67567fda21b3f1197765b0f5963e6f3f3d4bc0"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"79ca9dcffb3129da088dec924c2466b33c25710b","unresolved":true,"context_lines":[{"line_number":21,"context_line":"import binascii"},{"line_number":22,"context_line":"import bisect"},{"line_number":23,"context_line":"import collections"},{"line_number":24,"context_line":"from enum import Enum"},{"line_number":25,"context_line":"import errno"},{"line_number":26,"context_line":"import fcntl"},{"line_number":27,"context_line":"import grp"}],"source_content_type":"text/x-python","patch_set":8,"id":"a7661609_7e12eaf4","line":24,"in_reply_to":"e9930fd6_7ecf4bd6","updated":"2024-04-05 15:33:20.000000000","message":"Ack. Updated requirements.txt","commit_id":"1e67567fda21b3f1197765b0f5963e6f3f3d4bc0"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"4a5d69443a658c97f8dc12b57814767548d767e9","unresolved":true,"context_lines":[{"line_number":1436,"context_line":"            conf_label \u003d k[len(STATSD_CONF_USERLABEL_PREFIX):]"},{"line_number":1437,"context_line":"            conf_val \u003d conf.get(k)"},{"line_number":1438,"context_line":"            userlabels[conf_label] \u003d conf_val"},{"line_number":1439,"context_line":"        self.default_labels.update(userlabels)"},{"line_number":1440,"context_line":""},{"line_number":1441,"context_line":""},{"line_number":1442,"context_line":"class StatsdClient(StatsdClientConf, object):"}],"source_content_type":"text/x-python","patch_set":8,"id":"c5e6158a_68124883","line":1439,"updated":"2024-03-26 19:25:55.000000000","message":"Maybe reword:\n```\nfor k, v in conf.items():\n    if not k.startswith(STATSD_CONF_USERLABEL_PREFIX):\n        continue\n    self.default_labels[k[len(STATSD_CONF_USERLABEL_PREFIX):]] \u003d v\n```\n\nWe probably ought to do some kind of sanitization/validation, too -- I could see bad outcomes if someone had an entry like\n```\nstatsd_userlabel_foo \u003d \"\n sneaky_stat:1|c\n \"\n```","commit_id":"1e67567fda21b3f1197765b0f5963e6f3f3d4bc0"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"a0a734b73158987742caf8c9a22a24a947c1df42","unresolved":false,"context_lines":[{"line_number":1436,"context_line":"            conf_label \u003d k[len(STATSD_CONF_USERLABEL_PREFIX):]"},{"line_number":1437,"context_line":"            conf_val \u003d conf.get(k)"},{"line_number":1438,"context_line":"            userlabels[conf_label] \u003d conf_val"},{"line_number":1439,"context_line":"        self.default_labels.update(userlabels)"},{"line_number":1440,"context_line":""},{"line_number":1441,"context_line":""},{"line_number":1442,"context_line":"class StatsdClient(StatsdClientConf, object):"}],"source_content_type":"text/x-python","patch_set":8,"id":"ccf52da6_a0f973b4","line":1439,"in_reply_to":"9978fef6_e2186c91","updated":"2024-07-02 15:34:51.000000000","message":"Acknowledged","commit_id":"1e67567fda21b3f1197765b0f5963e6f3f3d4bc0"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"79ca9dcffb3129da088dec924c2466b33c25710b","unresolved":true,"context_lines":[{"line_number":1436,"context_line":"            conf_label \u003d k[len(STATSD_CONF_USERLABEL_PREFIX):]"},{"line_number":1437,"context_line":"            conf_val \u003d conf.get(k)"},{"line_number":1438,"context_line":"            userlabels[conf_label] \u003d conf_val"},{"line_number":1439,"context_line":"        self.default_labels.update(userlabels)"},{"line_number":1440,"context_line":""},{"line_number":1441,"context_line":""},{"line_number":1442,"context_line":"class StatsdClient(StatsdClientConf, object):"}],"source_content_type":"text/x-python","patch_set":8,"id":"9978fef6_e2186c91","line":1439,"in_reply_to":"c5e6158a_68124883","updated":"2024-04-05 15:33:20.000000000","message":"Ack. Haven\u0027t thought about string sanitization/validation in config files. Wonder if there are similar concerns for other config options like prefix etc.?","commit_id":"1e67567fda21b3f1197765b0f5963e6f3f3d4bc0"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"4a5d69443a658c97f8dc12b57814767548d767e9","unresolved":true,"context_lines":[{"line_number":1439,"context_line":"        self.default_labels.update(userlabels)"},{"line_number":1440,"context_line":""},{"line_number":1441,"context_line":""},{"line_number":1442,"context_line":"class StatsdClient(StatsdClientConf, object):"},{"line_number":1443,"context_line":"    def __init__(self, conf, tail_prefix\u003d\u0027\u0027, logger\u003dNone):"},{"line_number":1444,"context_line":"        StatsdClientConf.__init__(self, conf, tail_prefix\u003dtail_prefix)"},{"line_number":1445,"context_line":"        self.random \u003d random"}],"source_content_type":"text/x-python","patch_set":8,"id":"db34018b_899dbe16","line":1442,"updated":"2024-03-26 19:25:55.000000000","message":"Oh, interesting -- IDK that I\u0027ve seen that sort of a pattern before, to have a thing be a subclass of its config...\n\nThe `, object` should be unnecessary, though.","commit_id":"1e67567fda21b3f1197765b0f5963e6f3f3d4bc0"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"79ca9dcffb3129da088dec924c2466b33c25710b","unresolved":false,"context_lines":[{"line_number":1439,"context_line":"        self.default_labels.update(userlabels)"},{"line_number":1440,"context_line":""},{"line_number":1441,"context_line":""},{"line_number":1442,"context_line":"class StatsdClient(StatsdClientConf, object):"},{"line_number":1443,"context_line":"    def __init__(self, conf, tail_prefix\u003d\u0027\u0027, logger\u003dNone):"},{"line_number":1444,"context_line":"        StatsdClientConf.__init__(self, conf, tail_prefix\u003dtail_prefix)"},{"line_number":1445,"context_line":"        self.random \u003d random"}],"source_content_type":"text/x-python","patch_set":8,"id":"10cd7f58_714f90d8","line":1442,"in_reply_to":"db34018b_899dbe16","updated":"2024-04-05 15:33:20.000000000","message":"Ack. Al pointed out that the pattern was similar to ContainerSharderConf class","commit_id":"1e67567fda21b3f1197765b0f5963e6f3f3d4bc0"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"4a5d69443a658c97f8dc12b57814767548d767e9","unresolved":true,"context_lines":[{"line_number":1603,"context_line":"            return"},{"line_number":1604,"context_line":""},{"line_number":1605,"context_line":"        if labels is not None and self.label_mode \u003d\u003d \"disabled\":"},{"line_number":1606,"context_line":"            return"},{"line_number":1607,"context_line":""},{"line_number":1608,"context_line":"        if labels is None:"},{"line_number":1609,"context_line":"            line \u003d self.build_line_legacy_format("}],"source_content_type":"text/x-python","patch_set":8,"id":"692f7877_5ed22c10","line":1606,"updated":"2024-03-26 19:25:55.000000000","message":"I\u0027m torn about these -- on the one hand, it\u0027s nice to have all the early returns gathered, but I\u0027m still drawn toward something more like\n```\nif labels is None:\n    # Legacy metric\n    if not self.emit_legacy:\n        return\n    line \u003d ...\nelse:\n    # Labeled\n    if self.label_mode \u003d\u003d \"disabled\":\n        return\n    line \u003d ...\n```","commit_id":"1e67567fda21b3f1197765b0f5963e6f3f3d4bc0"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"79ca9dcffb3129da088dec924c2466b33c25710b","unresolved":false,"context_lines":[{"line_number":1603,"context_line":"            return"},{"line_number":1604,"context_line":""},{"line_number":1605,"context_line":"        if labels is not None and self.label_mode \u003d\u003d \"disabled\":"},{"line_number":1606,"context_line":"            return"},{"line_number":1607,"context_line":""},{"line_number":1608,"context_line":"        if labels is None:"},{"line_number":1609,"context_line":"            line \u003d self.build_line_legacy_format("}],"source_content_type":"text/x-python","patch_set":8,"id":"389250fa_34756edd","line":1606,"in_reply_to":"692f7877_5ed22c10","updated":"2024-04-05 15:33:20.000000000","message":"Acknowledged","commit_id":"1e67567fda21b3f1197765b0f5963e6f3f3d4bc0"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"4a5d69443a658c97f8dc12b57814767548d767e9","unresolved":true,"context_lines":[{"line_number":1609,"context_line":"            line \u003d self.build_line_legacy_format("},{"line_number":1610,"context_line":"                self._prefix, m_name, m_value, m_type, sample_rate)"},{"line_number":1611,"context_line":"        else:"},{"line_number":1612,"context_line":"            labels \u003d dict(self.default_labels, **(labels or {}))"},{"line_number":1613,"context_line":"            if self.base_prefix:"},{"line_number":1614,"context_line":"                m_name \u003d self.base_prefix + \u0027_\u0027 + m_name"},{"line_number":1615,"context_line":"            line \u003d self._build_line_f("}],"source_content_type":"text/x-python","patch_set":8,"id":"ada644a0_ecf1cf15","line":1612,"range":{"start_line":1612,"start_character":50,"end_line":1612,"end_character":62},"updated":"2024-03-26 19:25:55.000000000","message":"We\u0027ve got guards now against `labels` being `None`; I think we could just use `dict(self.default_labels, **labels)`","commit_id":"1e67567fda21b3f1197765b0f5963e6f3f3d4bc0"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"d2c33835b21188df24083bdef743ea60c3c98c66","unresolved":false,"context_lines":[{"line_number":1609,"context_line":"            line \u003d self.build_line_legacy_format("},{"line_number":1610,"context_line":"                self._prefix, m_name, m_value, m_type, sample_rate)"},{"line_number":1611,"context_line":"        else:"},{"line_number":1612,"context_line":"            labels \u003d dict(self.default_labels, **(labels or {}))"},{"line_number":1613,"context_line":"            if self.base_prefix:"},{"line_number":1614,"context_line":"                m_name \u003d self.base_prefix + \u0027_\u0027 + m_name"},{"line_number":1615,"context_line":"            line \u003d self._build_line_f("}],"source_content_type":"text/x-python","patch_set":8,"id":"eb9a54e0_b6c172fa","line":1612,"range":{"start_line":1612,"start_character":50,"end_line":1612,"end_character":62},"in_reply_to":"ada644a0_ecf1cf15","updated":"2024-04-05 15:34:01.000000000","message":"Acknowledged","commit_id":"1e67567fda21b3f1197765b0f5963e6f3f3d4bc0"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"4a5d69443a658c97f8dc12b57814767548d767e9","unresolved":true,"context_lines":[{"line_number":1611,"context_line":"        else:"},{"line_number":1612,"context_line":"            labels \u003d dict(self.default_labels, **(labels or {}))"},{"line_number":1613,"context_line":"            if self.base_prefix:"},{"line_number":1614,"context_line":"                m_name \u003d self.base_prefix + \u0027_\u0027 + m_name"},{"line_number":1615,"context_line":"            line \u003d self._build_line_f("},{"line_number":1616,"context_line":"                m_name,"},{"line_number":1617,"context_line":"                sorted(labels.items()),"}],"source_content_type":"text/x-python","patch_set":8,"id":"b67fb2be_af7d07b0","line":1614,"updated":"2024-03-26 19:25:55.000000000","message":"Do we still want this? I thought in the sample config we said\n```\n# Note that non-labeled option \u0027log_statsd_metric_prefix\u0027 does not apply to\n# labeled metrics.\n```","commit_id":"1e67567fda21b3f1197765b0f5963e6f3f3d4bc0"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"79ca9dcffb3129da088dec924c2466b33c25710b","unresolved":false,"context_lines":[{"line_number":1611,"context_line":"        else:"},{"line_number":1612,"context_line":"            labels \u003d dict(self.default_labels, **(labels or {}))"},{"line_number":1613,"context_line":"            if self.base_prefix:"},{"line_number":1614,"context_line":"                m_name \u003d self.base_prefix + \u0027_\u0027 + m_name"},{"line_number":1615,"context_line":"            line \u003d self._build_line_f("},{"line_number":1616,"context_line":"                m_name,"},{"line_number":1617,"context_line":"                sorted(labels.items()),"}],"source_content_type":"text/x-python","patch_set":8,"id":"00297934_394aac4a","line":1614,"in_reply_to":"b67fb2be_af7d07b0","updated":"2024-04-05 15:33:20.000000000","message":"Agreed. Was going to address this in an update","commit_id":"1e67567fda21b3f1197765b0f5963e6f3f3d4bc0"}],"test/debug_logger.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ff3be5e397da876afc37db5f8e895e7e70e55734","unresolved":true,"context_lines":[{"line_number":66,"context_line":""},{"line_number":67,"context_line":"        return argparse.Namespace("},{"line_number":68,"context_line":"            #sendto\u003dlambda payload, address: self.sendto_calls.append("},{"line_number":69,"context_line":"            #    SendtoCall(payload, address)),"},{"line_number":70,"context_line":"            sendto\u003dfakeSendto,"},{"line_number":71,"context_line":"            close\u003dlambda: None,"},{"line_number":72,"context_line":"        )"}],"source_content_type":"text/x-python","patch_set":1,"id":"31e74600_d56c3146","line":69,"updated":"2024-02-22 16:04:46.000000000","message":"please just delete these lines","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"b88b14f58de391e903bd8cb3bbc903924ac45ce2","unresolved":false,"context_lines":[{"line_number":66,"context_line":""},{"line_number":67,"context_line":"        return argparse.Namespace("},{"line_number":68,"context_line":"            #sendto\u003dlambda payload, address: self.sendto_calls.append("},{"line_number":69,"context_line":"            #    SendtoCall(payload, address)),"},{"line_number":70,"context_line":"            sendto\u003dfakeSendto,"},{"line_number":71,"context_line":"            close\u003dlambda: None,"},{"line_number":72,"context_line":"        )"}],"source_content_type":"text/x-python","patch_set":1,"id":"a1716f2e_aeb1cc85","line":69,"in_reply_to":"31e74600_d56c3146","updated":"2024-02-23 15:59:39.000000000","message":"Acknowledged","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ff3be5e397da876afc37db5f8e895e7e70e55734","unresolved":true,"context_lines":[{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def _send_tag(self, *args, **kwargs):"},{"line_number":79,"context_line":"        self.send_calls.append((args, kwargs))"},{"line_number":80,"context_line":"        super(FakeStatsdClient, self)._send_tag(*args, **kwargs)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def clear(self):"},{"line_number":83,"context_line":"        self.send_calls \u003d []"}],"source_content_type":"text/x-python","patch_set":1,"id":"884bab92_8f2fb708","line":80,"updated":"2024-02-22 16:04:46.000000000","message":"this is kind of a smell to me\n\nmy initial reaction is that there should be a single method that our Fake could stop *above* the routing to _send vs _send_tag that could be used to capture all calls\n\nMaybe it becomes significant later than the send_calls appended in _send already have labels\u003dNone stripped off (e.g. less churn in pre-existing tests)","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"b88b14f58de391e903bd8cb3bbc903924ac45ce2","unresolved":true,"context_lines":[{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def _send_tag(self, *args, **kwargs):"},{"line_number":79,"context_line":"        self.send_calls.append((args, kwargs))"},{"line_number":80,"context_line":"        super(FakeStatsdClient, self)._send_tag(*args, **kwargs)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def clear(self):"},{"line_number":83,"context_line":"        self.send_calls \u003d []"}],"source_content_type":"text/x-python","patch_set":1,"id":"c43f6ef1_98b658dc","line":80,"in_reply_to":"884bab92_8f2fb708","updated":"2024-02-23 15:59:39.000000000","message":"Need to think about capturing calls","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"bdfc1334e9e68c8277f5552478f9550ffbee36f5","unresolved":false,"context_lines":[{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def _send_tag(self, *args, **kwargs):"},{"line_number":79,"context_line":"        self.send_calls.append((args, kwargs))"},{"line_number":80,"context_line":"        super(FakeStatsdClient, self)._send_tag(*args, **kwargs)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def clear(self):"},{"line_number":83,"context_line":"        self.send_calls \u003d []"}],"source_content_type":"text/x-python","patch_set":1,"id":"489c6a1f_dbf22bce","line":80,"in_reply_to":"b0df1482_aee42c96","updated":"2024-03-22 17:06:51.000000000","message":"Acknowledged","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":true,"context_lines":[{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def _send_tag(self, *args, **kwargs):"},{"line_number":79,"context_line":"        self.send_calls.append((args, kwargs))"},{"line_number":80,"context_line":"        super(FakeStatsdClient, self)._send_tag(*args, **kwargs)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def clear(self):"},{"line_number":83,"context_line":"        self.send_calls \u003d []"}],"source_content_type":"text/x-python","patch_set":1,"id":"b0df1482_aee42c96","line":80,"in_reply_to":"c43f6ef1_98b658dc","updated":"2024-03-14 19:39:51.000000000","message":"I like that this Fake has the flexibility of capturing calls at the socket level (self.sendto_calls).\n\nI can imagine it might be helpful in some contexts to make assertions at the \"api\" level as well \"assert update_timing calls _send with these args\"\n\nI think it\u0027s a smell that both _send and _send_tag stuff the call args into the same \"send_calls\" list - it really highlights to me that _send should just be extended to accept a lablels kwarg and call the appropirate `_build_line_tags_f` or `_build_line_legacy` based on `labels is None`","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":true,"context_lines":[{"line_number":59,"context_line":"        return None, None"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def _open_socket(self):"},{"line_number":62,"context_line":"        def fakeSendto(payload, address):"},{"line_number":63,"context_line":"            self.sendto_calls.append("},{"line_number":64,"context_line":"                SendtoCall(payload, address))"},{"line_number":65,"context_line":"            return len(payload)"}],"source_content_type":"text/x-python","patch_set":5,"id":"821044de_c65c83d4","line":62,"updated":"2024-03-14 19:39:51.000000000","message":"i like using the inline def instead of the lambda - kudos\n\nI think python naming conventions would expect this function to be named \u0027fake_send_to\u0027 [1]\n\n1. https://peps.python.org/pep-0008/#function-and-variable-names","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"bdfc1334e9e68c8277f5552478f9550ffbee36f5","unresolved":false,"context_lines":[{"line_number":59,"context_line":"        return None, None"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def _open_socket(self):"},{"line_number":62,"context_line":"        def fakeSendto(payload, address):"},{"line_number":63,"context_line":"            self.sendto_calls.append("},{"line_number":64,"context_line":"                SendtoCall(payload, address))"},{"line_number":65,"context_line":"            return len(payload)"}],"source_content_type":"text/x-python","patch_set":5,"id":"df56e8f8_1d4eb76a","line":62,"in_reply_to":"821044de_c65c83d4","updated":"2024-03-22 17:06:51.000000000","message":"Acknowledged","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0155681cc6e8a683f86ea18f95ff366b92da2532","unresolved":true,"context_lines":[{"line_number":155,"context_line":""},{"line_number":156,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":157,"context_line":"        self._clear()"},{"line_number":158,"context_line":"        self.name \u003d kwargs.get(\u0027name\u0027) or \u0027swift.unit.fake_logger\u0027"},{"line_number":159,"context_line":"        self.level \u003d logging.NOTSET"},{"line_number":160,"context_line":"        if \u0027facility\u0027 in kwargs:"},{"line_number":161,"context_line":"            self.facility \u003d kwargs[\u0027facility\u0027]"}],"source_content_type":"text/x-python","patch_set":53,"id":"1a14c7d4_df0bca6e","line":158,"updated":"2025-04-03 21:19:45.000000000","message":"would this be more obvious if we just named the kwarg log_route to match the new kwarg accepted into `get_debug_logger`?\n\nOr at *least* named it `log_name` to match the value passed in to `get_swift_logger` via the config by default!?\n\n```\n    if name is None:\n        name \u003d conf.get(\u0027log_name\u0027, \u0027swift\u0027)\n    if not log_route:\n        log_route \u003d name\n    logger \u003d logging.getLogger(log_route)\n    ...\n    adapted_logger \u003d SwiftLogAdapter(logger, name)\n```\n\nIt\u0027s actually not even possible to create a stdlib logger w/o a `name` argument:\n\n```\nclass Logger(Filterer):\n...\n    def __init__(self, name, level\u003dNOTSET):\n        \"\"\"\n        Initialize the logger with a name and an optional level.\n        \"\"\"\n```\n\n^ which is funny cause I guess `FakeLogger` never calls `super().__init__(*args, **kwargs)` - otherwise it would already have blow up for missing a required positional arg.\n\nHaving the adapter have *one* name and the logger having *different* name (that\u0027s actually the route) is confusing enough - having `get_debug_logger` making up a different kwarg name for the required log_route name and naming it name is... idk probably worse somehow.","commit_id":"7e5235894b4f590024d572f64ab0b3ba2b02c68b"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0155681cc6e8a683f86ea18f95ff366b92da2532","unresolved":true,"context_lines":[{"line_number":272,"context_line":""},{"line_number":273,"context_line":"def debug_logger(name\u003d\u0027test\u0027, log_route\u003dNone):"},{"line_number":274,"context_line":"    \"\"\"get a named adapted debug logger\"\"\""},{"line_number":275,"context_line":"    log_route \u003d log_route or name"},{"line_number":276,"context_line":"    adapted_logger \u003d DebugLogAdapter(DebugLogger(name\u003dlog_route), name)"},{"line_number":277,"context_line":"    utils._patch_statsd_methods(adapted_logger, adapted_logger.logger)"},{"line_number":278,"context_line":"    return adapted_logger"}],"source_content_type":"text/x-python","patch_set":53,"id":"a8edb99b_14e1a023","line":275,"updated":"2025-04-03 21:19:45.000000000","message":"are these a drive-by?  DebugLogger *is* a FakeLogger","commit_id":"7e5235894b4f590024d572f64ab0b3ba2b02c68b"}],"test/unit/account/test_auditor.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"11e44436167bd0af814619080ea7811c1533ae9f","unresolved":true,"context_lines":[{"line_number":79,"context_line":"        self.logger \u003d debug_logger()"},{"line_number":80,"context_line":"        # really, this would come by way of base_prefix/tail_prefix in"},{"line_number":81,"context_line":"        # get_logger, ultimately tracing back to section_name in daemon..."},{"line_number":82,"context_line":"        self.logger.statsd_client._prefix \u003d \u0027account-auditor.\u0027"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    @with_tempdir"},{"line_number":85,"context_line":"    def test_db_validate_fails(self, tempdir):"}],"source_content_type":"text/x-python","patch_set":22,"id":"d7418048_b835100a","line":82,"updated":"2024-06-25 18:40:03.000000000","message":"I thought this change had something to do with the facade change... but I guess debug logger always supported the nested name lookup:\n\n```\n\u003e /home/vagrant/swift/test/unit/account/test_auditor.py(84)setUp()\n-\u003e self.logger.statsd_client._prefix \u003d \u0027account-auditor.\u0027\n(Pdb) self.logger\n\u003cDebugLogAdapter swift.unit.fake_logger (NOTSET)\u003e\n(Pdb) self.logger.statsd_client\n\u003ctest.debug_logger.FakeStatsdClient object at 0x7f7f158584f0\u003e\n(Pdb) self.logger.logger\n\u003cDebugLogger swift.unit.fake_logger (NOTSET)\u003e\n(Pdb) self.logger.logger.statsd_client\n\u003ctest.debug_logger.FakeStatsdClient object at 0x7f7f158584f0\u003e\n```\n\nhttps://github.com/NVIDIA/swift/blob/master/test/debug_logger.py#L260","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"a0a734b73158987742caf8c9a22a24a947c1df42","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        self.logger \u003d debug_logger()"},{"line_number":80,"context_line":"        # really, this would come by way of base_prefix/tail_prefix in"},{"line_number":81,"context_line":"        # get_logger, ultimately tracing back to section_name in daemon..."},{"line_number":82,"context_line":"        self.logger.statsd_client._prefix \u003d \u0027account-auditor.\u0027"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    @with_tempdir"},{"line_number":85,"context_line":"    def test_db_validate_fails(self, tempdir):"}],"source_content_type":"text/x-python","patch_set":22,"id":"7a8470ef_c45dc3ad","line":82,"in_reply_to":"d7418048_b835100a","updated":"2024-07-02 15:34:51.000000000","message":"Acknowledged","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"}],"test/unit/common/middleware/test_proxy_logging.py":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"db4cdb44d3c2884ebb34f429f9877dc8ff6a51ee","unresolved":true,"context_lines":[{"line_number":123,"context_line":"        # really, this would come by way of base_prefix/tail_prefix in"},{"line_number":124,"context_line":"        # get_logger, ultimately tracing back to our hard-coded"},{"line_number":125,"context_line":"        # statsd_tail_prefix"},{"line_number":126,"context_line":"        self.logger.statsd_client._prefix \u003d \u0027proxy-server.\u0027"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"    def _log_parts(self, app, should_be_empty\u003dFalse):"},{"line_number":129,"context_line":"        info_calls \u003d app.access_logger.log_dict[\u0027info\u0027]"}],"source_content_type":"text/x-python","patch_set":30,"id":"53e4b3e2_fbf06faf","line":126,"updated":"2024-07-25 15:33:35.000000000","message":"I was surpised to find any change in this module, and this doesn\u0027t seem to be a necessary change. AFAICT it works by way of ``DebugLogAdapter.__getattribute__``","commit_id":"17382f672a5fd3a99781f3d5599887ee2725033d"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"6f796e8c939945bdcee41fe6c436771290f19e2c","unresolved":true,"context_lines":[{"line_number":123,"context_line":"        # really, this would come by way of base_prefix/tail_prefix in"},{"line_number":124,"context_line":"        # get_logger, ultimately tracing back to our hard-coded"},{"line_number":125,"context_line":"        # statsd_tail_prefix"},{"line_number":126,"context_line":"        self.logger.statsd_client._prefix \u003d \u0027proxy-server.\u0027"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"    def _log_parts(self, app, should_be_empty\u003dFalse):"},{"line_number":129,"context_line":"        info_calls \u003d app.access_logger.log_dict[\u0027info\u0027]"}],"source_content_type":"text/x-python","patch_set":30,"id":"aa651531_030b5a1f","line":126,"in_reply_to":"28edcc0a_103308ed","updated":"2024-08-02 16:55:07.000000000","message":"But the real LogAdapter doesn\u0027t have a statsd_client prefix so to my mind this is confusing","commit_id":"17382f672a5fd3a99781f3d5599887ee2725033d"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"d005adb00a62faf9a3888b985c10ffdb92fdacd2","unresolved":false,"context_lines":[{"line_number":123,"context_line":"        # really, this would come by way of base_prefix/tail_prefix in"},{"line_number":124,"context_line":"        # get_logger, ultimately tracing back to our hard-coded"},{"line_number":125,"context_line":"        # statsd_tail_prefix"},{"line_number":126,"context_line":"        self.logger.statsd_client._prefix \u003d \u0027proxy-server.\u0027"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"    def _log_parts(self, app, should_be_empty\u003dFalse):"},{"line_number":129,"context_line":"        info_calls \u003d app.access_logger.log_dict[\u0027info\u0027]"}],"source_content_type":"text/x-python","patch_set":30,"id":"28edcc0a_103308ed","line":126,"in_reply_to":"53e4b3e2_fbf06faf","updated":"2024-07-30 16:22:36.000000000","message":"Agreed not necessary. Although think that Clay was suggesting the change","commit_id":"17382f672a5fd3a99781f3d5599887ee2725033d"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"5a4ec86f9501e46cd834db332031f2027a15c924","unresolved":false,"context_lines":[{"line_number":123,"context_line":"        # really, this would come by way of base_prefix/tail_prefix in"},{"line_number":124,"context_line":"        # get_logger, ultimately tracing back to our hard-coded"},{"line_number":125,"context_line":"        # statsd_tail_prefix"},{"line_number":126,"context_line":"        self.logger.statsd_client._prefix \u003d \u0027proxy-server.\u0027"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"    def _log_parts(self, app, should_be_empty\u003dFalse):"},{"line_number":129,"context_line":"        info_calls \u003d app.access_logger.log_dict[\u0027info\u0027]"}],"source_content_type":"text/x-python","patch_set":30,"id":"81251ee4_74d36bb4","line":126,"in_reply_to":"aa651531_030b5a1f","updated":"2024-09-05 15:33:20.000000000","message":"Acknowledged","commit_id":"17382f672a5fd3a99781f3d5599887ee2725033d"}],"test/unit/common/test_statsd_client.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"11e44436167bd0af814619080ea7811c1533ae9f","unresolved":true,"context_lines":[{"line_number":86,"context_line":"            conf\u003d{\u0027log_statsd_host\u0027: \u0027myhost1\u0027,"},{"line_number":87,"context_line":"                  \u0027log_statsd_port\u0027: 1235})"},{"line_number":88,"context_line":"        with mock.patch.object(client, \u0027_open_socket\u0027) as mock_open:"},{"line_number":89,"context_line":"            rv \u003d client.increment(\u0027tunafish\u0027)"},{"line_number":90,"context_line":"            self.assertIs(rv[0],"},{"line_number":91,"context_line":"                          mock_open.return_value.sendto.return_value)"},{"line_number":92,"context_line":"            self.assertFalse(rv[1])"}],"source_content_type":"text/x-python","patch_set":22,"id":"f70a9d46_f7415efd","line":89,"updated":"2024-06-25 18:40:03.000000000","message":"increment now returns a tuple!","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"a0a734b73158987742caf8c9a22a24a947c1df42","unresolved":false,"context_lines":[{"line_number":86,"context_line":"            conf\u003d{\u0027log_statsd_host\u0027: \u0027myhost1\u0027,"},{"line_number":87,"context_line":"                  \u0027log_statsd_port\u0027: 1235})"},{"line_number":88,"context_line":"        with mock.patch.object(client, \u0027_open_socket\u0027) as mock_open:"},{"line_number":89,"context_line":"            rv \u003d client.increment(\u0027tunafish\u0027)"},{"line_number":90,"context_line":"            self.assertIs(rv[0],"},{"line_number":91,"context_line":"                          mock_open.return_value.sendto.return_value)"},{"line_number":92,"context_line":"            self.assertFalse(rv[1])"}],"source_content_type":"text/x-python","patch_set":22,"id":"64e2fc6e_5e8d2331","line":89,"in_reply_to":"f70a9d46_f7415efd","updated":"2024-07-02 15:34:51.000000000","message":"Acknowledged","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"11e44436167bd0af814619080ea7811c1533ae9f","unresolved":true,"context_lines":[{"line_number":579,"context_line":"            try:"},{"line_number":580,"context_line":"                payload \u003d self.sock.recv(4096)"},{"line_number":581,"context_line":"                if payload and b\u0027STOP\u0027 in payload:"},{"line_number":582,"context_line":"                    return 42"},{"line_number":583,"context_line":"                self.queue.put(payload)"},{"line_number":584,"context_line":"            except Exception as e:"},{"line_number":585,"context_line":"                sys.stderr.write(\u0027statsd_reader thread: %r\u0027 % (e,))"}],"source_content_type":"text/x-python","patch_set":22,"id":"cc09c664_68caeef4","line":582,"updated":"2024-06-25 18:40:03.000000000","message":"wat?","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"6765b3d46e86eae7b8af4cbf088cd17e59ce67d3","unresolved":false,"context_lines":[{"line_number":579,"context_line":"            try:"},{"line_number":580,"context_line":"                payload \u003d self.sock.recv(4096)"},{"line_number":581,"context_line":"                if payload and b\u0027STOP\u0027 in payload:"},{"line_number":582,"context_line":"                    return 42"},{"line_number":583,"context_line":"                self.queue.put(payload)"},{"line_number":584,"context_line":"            except Exception as e:"},{"line_number":585,"context_line":"                sys.stderr.write(\u0027statsd_reader thread: %r\u0027 % (e,))"}],"source_content_type":"text/x-python","patch_set":22,"id":"53593b20_5e7750a7","line":582,"in_reply_to":"50a7e04d_75e1534d","updated":"2024-07-11 16:23:01.000000000","message":"Acknowledged","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"ec8ecaccd38283b3be5deaedfb4ac65db7dcdc88","unresolved":true,"context_lines":[{"line_number":579,"context_line":"            try:"},{"line_number":580,"context_line":"                payload \u003d self.sock.recv(4096)"},{"line_number":581,"context_line":"                if payload and b\u0027STOP\u0027 in payload:"},{"line_number":582,"context_line":"                    return 42"},{"line_number":583,"context_line":"                self.queue.put(payload)"},{"line_number":584,"context_line":"            except Exception as e:"},{"line_number":585,"context_line":"                sys.stderr.write(\u0027statsd_reader thread: %r\u0027 % (e,))"}],"source_content_type":"text/x-python","patch_set":22,"id":"50a7e04d_75e1534d","line":582,"in_reply_to":"cc09c664_68caeef4","updated":"2024-07-11 16:22:43.000000000","message":"Existing unittest code","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"9a07b6cea740d0198eab982cf07267a13b560f12","unresolved":false,"context_lines":[{"line_number":579,"context_line":"            try:"},{"line_number":580,"context_line":"                payload \u003d self.sock.recv(4096)"},{"line_number":581,"context_line":"                if payload and b\u0027STOP\u0027 in payload:"},{"line_number":582,"context_line":"                    return 42"},{"line_number":583,"context_line":"                self.queue.put(payload)"},{"line_number":584,"context_line":"            except Exception as e:"},{"line_number":585,"context_line":"                sys.stderr.write(\u0027statsd_reader thread: %r\u0027 % (e,))"}],"source_content_type":"text/x-python","patch_set":22,"id":"5a46a499_a1a86a1e","line":582,"in_reply_to":"cc09c664_68caeef4","updated":"2024-07-15 20:33:09.000000000","message":"unrelated, this test infra should be less used in the latest change anyway.","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"11e44436167bd0af814619080ea7811c1533ae9f","unresolved":true,"context_lines":[{"line_number":589,"context_line":"        \"\"\""},{"line_number":590,"context_line":"        Because the client library may not actually send a packet with"},{"line_number":591,"context_line":"        sample_rate \u003c 1, we keep trying until we get one through."},{"line_number":592,"context_line":"        \"\"\""},{"line_number":593,"context_line":"        got \u003d None"},{"line_number":594,"context_line":"        while not got:"},{"line_number":595,"context_line":"            bytes, retry_sample_rate \u003d sender_fn(*args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":22,"id":"212f939f_87963e56","line":592,"updated":"2024-06-25 18:40:03.000000000","message":"maybe a better approach would be to mock random.random to always `return 0` so that when we call assertStat with sample_rate we always send a packet and can always count on it being recieved?","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"a0a734b73158987742caf8c9a22a24a947c1df42","unresolved":false,"context_lines":[{"line_number":589,"context_line":"        \"\"\""},{"line_number":590,"context_line":"        Because the client library may not actually send a packet with"},{"line_number":591,"context_line":"        sample_rate \u003c 1, we keep trying until we get one through."},{"line_number":592,"context_line":"        \"\"\""},{"line_number":593,"context_line":"        got \u003d None"},{"line_number":594,"context_line":"        while not got:"},{"line_number":595,"context_line":"            bytes, retry_sample_rate \u003d sender_fn(*args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":22,"id":"c81f7593_2f52f446","line":592,"in_reply_to":"212f939f_87963e56","updated":"2024-07-02 15:34:51.000000000","message":"Acknowledged","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"11e44436167bd0af814619080ea7811c1533ae9f","unresolved":true,"context_lines":[{"line_number":592,"context_line":"        \"\"\""},{"line_number":593,"context_line":"        got \u003d None"},{"line_number":594,"context_line":"        while not got:"},{"line_number":595,"context_line":"            bytes, retry_sample_rate \u003d sender_fn(*args, **kwargs)"},{"line_number":596,"context_line":"            if not bytes and not retry_sample_rate:"},{"line_number":597,"context_line":"                break"},{"line_number":598,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":22,"id":"8f615e40_06a947a4","line":595,"updated":"2024-06-25 18:40:03.000000000","message":"bytes is a builtin in python\n\n```\n\u003e\u003e\u003e bytes(3)\nb\u0027\\x00\\x00\\x00\u0027\n```\n\ngenerally it\u0027s better to try and avoid shadowing a builtin with a variable name","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"a0a734b73158987742caf8c9a22a24a947c1df42","unresolved":false,"context_lines":[{"line_number":592,"context_line":"        \"\"\""},{"line_number":593,"context_line":"        got \u003d None"},{"line_number":594,"context_line":"        while not got:"},{"line_number":595,"context_line":"            bytes, retry_sample_rate \u003d sender_fn(*args, **kwargs)"},{"line_number":596,"context_line":"            if not bytes and not retry_sample_rate:"},{"line_number":597,"context_line":"                break"},{"line_number":598,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":22,"id":"a66a0ab0_b605c5bf","line":595,"in_reply_to":"8f615e40_06a947a4","updated":"2024-07-02 15:34:51.000000000","message":"Acknowledged","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"11e44436167bd0af814619080ea7811c1533ae9f","unresolved":true,"context_lines":[{"line_number":593,"context_line":"        got \u003d None"},{"line_number":594,"context_line":"        while not got:"},{"line_number":595,"context_line":"            bytes, retry_sample_rate \u003d sender_fn(*args, **kwargs)"},{"line_number":596,"context_line":"            if not bytes and not retry_sample_rate:"},{"line_number":597,"context_line":"                break"},{"line_number":598,"context_line":"            try:"},{"line_number":599,"context_line":"                got \u003d self.queue.get(timeout\u003d0.5)"}],"source_content_type":"text/x-python","patch_set":22,"id":"5b0ccf7f_2d7b9bf9","line":596,"updated":"2024-06-25 18:40:03.000000000","message":"i generally rephrase `(not and not)` to `not (or)`\n\n... if I\u0027m doing my boolean logic correctly: this will short-circut to a break when the sender_fn indicates a short circut because of sample_rate.\n\nWhich I think matches the docstring:\n\n\u003e we keep trying until we get one through","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"a0a734b73158987742caf8c9a22a24a947c1df42","unresolved":false,"context_lines":[{"line_number":593,"context_line":"        got \u003d None"},{"line_number":594,"context_line":"        while not got:"},{"line_number":595,"context_line":"            bytes, retry_sample_rate \u003d sender_fn(*args, **kwargs)"},{"line_number":596,"context_line":"            if not bytes and not retry_sample_rate:"},{"line_number":597,"context_line":"                break"},{"line_number":598,"context_line":"            try:"},{"line_number":599,"context_line":"                got \u003d self.queue.get(timeout\u003d0.5)"}],"source_content_type":"text/x-python","patch_set":22,"id":"d4e0aff7_3b47e9d0","line":596,"in_reply_to":"5b0ccf7f_2d7b9bf9","updated":"2024-07-02 15:34:51.000000000","message":"Acknowledged","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"11e44436167bd0af814619080ea7811c1533ae9f","unresolved":true,"context_lines":[{"line_number":600,"context_line":"            except Empty:"},{"line_number":601,"context_line":"                pass"},{"line_number":602,"context_line":"        if got and six.PY3:"},{"line_number":603,"context_line":"            got \u003d got.decode(\u0027utf-8\u0027)"},{"line_number":604,"context_line":"        return got"},{"line_number":605,"context_line":""},{"line_number":606,"context_line":"    def assertStat(self, expected, sender_fn, *args, **kwargs):"}],"source_content_type":"text/x-python","patch_set":22,"id":"adedb7d6_2eb7a53b","line":603,"updated":"2024-06-25 18:40:03.000000000","message":"ok, so the queue is our fake statsd server, recv\u0027ing on the statsd packges - so it always gets bytes and returns them directly (or 42?!) - here we\u0027re just moving the normlization up a level; because apparently somtimes we emit stats that are non-ascii!?  or maybe it just saves us having to append `b\u0027foo\u0027 \u003d\u003d revd` onto our strings.","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"a0a734b73158987742caf8c9a22a24a947c1df42","unresolved":false,"context_lines":[{"line_number":600,"context_line":"            except Empty:"},{"line_number":601,"context_line":"                pass"},{"line_number":602,"context_line":"        if got and six.PY3:"},{"line_number":603,"context_line":"            got \u003d got.decode(\u0027utf-8\u0027)"},{"line_number":604,"context_line":"        return got"},{"line_number":605,"context_line":""},{"line_number":606,"context_line":"    def assertStat(self, expected, sender_fn, *args, **kwargs):"}],"source_content_type":"text/x-python","patch_set":22,"id":"7f46a452_1dc3bd0d","line":603,"in_reply_to":"adedb7d6_2eb7a53b","updated":"2024-07-02 15:34:51.000000000","message":"Seems to avoid having to decode bytes buffer at various places at call sites","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"11e44436167bd0af814619080ea7811c1533ae9f","unresolved":true,"context_lines":[{"line_number":685,"context_line":"        self.assertStat("},{"line_number":686,"context_line":"            \u0027pfx.some.hi-res.operation:3141.5927|ms|@0.367879441171\u0027,"},{"line_number":687,"context_line":"            self.logger.timing, \u0027some.hi-res.operation\u0027,"},{"line_number":688,"context_line":"            3.141592653589793 * 1000, sample_rate\u003d0.367879441171)"},{"line_number":689,"context_line":"        self.assertStatMatches(r\u0027pfx\\.another\\.op:\\d+\\.\\d+\\|ms|@0.972\u0027,"},{"line_number":690,"context_line":"                               self.logger.timing_since, \u0027another.op\u0027,"},{"line_number":691,"context_line":"                               time.time(), sample_rate\u003d0.972)"}],"source_content_type":"text/x-python","patch_set":22,"id":"9e99a444_d1106560","line":688,"updated":"2024-06-25 18:40:03.000000000","message":"I had to get into a debugger to understand how these still work - after three loops in `_send_and_get` I saw `retry_sample_rate \u003d False` and the loop will break.","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"a0a734b73158987742caf8c9a22a24a947c1df42","unresolved":false,"context_lines":[{"line_number":685,"context_line":"        self.assertStat("},{"line_number":686,"context_line":"            \u0027pfx.some.hi-res.operation:3141.5927|ms|@0.367879441171\u0027,"},{"line_number":687,"context_line":"            self.logger.timing, \u0027some.hi-res.operation\u0027,"},{"line_number":688,"context_line":"            3.141592653589793 * 1000, sample_rate\u003d0.367879441171)"},{"line_number":689,"context_line":"        self.assertStatMatches(r\u0027pfx\\.another\\.op:\\d+\\.\\d+\\|ms|@0.972\u0027,"},{"line_number":690,"context_line":"                               self.logger.timing_since, \u0027another.op\u0027,"},{"line_number":691,"context_line":"                               time.time(), sample_rate\u003d0.972)"}],"source_content_type":"text/x-python","patch_set":22,"id":"75e195e6_10ddd03a","line":688,"in_reply_to":"9e99a444_d1106560","updated":"2024-07-02 15:34:51.000000000","message":"Acknowledged","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"11e44436167bd0af814619080ea7811c1533ae9f","unresolved":true,"context_lines":[{"line_number":810,"context_line":"            \u0027statsd_emit_legacy\u0027: \u0027false\u0027,"},{"line_number":811,"context_line":"        }, \u0027pfx\u0027)"},{"line_number":812,"context_line":"        # Any pre-labeled-metrics callers should not emit legacy metrics"},{"line_number":813,"context_line":"        self.assertStat(None, self.logger.increment, \u0027some.counter\u0027)"},{"line_number":814,"context_line":"        self.assertStat(None, self.logger.decrement, \u0027some.counter\u0027)"},{"line_number":815,"context_line":"        self.assertStat(None, self.logger.timing, \u0027some.timing\u0027, 6.28 * 1000)"},{"line_number":816,"context_line":"        self.assertStat(None, self.logger.update_stats, \u0027some.stat\u0027, 3)"}],"source_content_type":"text/x-python","patch_set":22,"id":"22467c2e_2eec7800","line":813,"updated":"2024-06-25 18:40:03.000000000","message":"maybe this is a weird way to test this?  Maybe rather than not sending the package and verying it didn\u0027t get *recieved* - the assertion might look stronger if we patch the socket module and verify `socket.sendto` is never called?","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"a0a734b73158987742caf8c9a22a24a947c1df42","unresolved":false,"context_lines":[{"line_number":810,"context_line":"            \u0027statsd_emit_legacy\u0027: \u0027false\u0027,"},{"line_number":811,"context_line":"        }, \u0027pfx\u0027)"},{"line_number":812,"context_line":"        # Any pre-labeled-metrics callers should not emit legacy metrics"},{"line_number":813,"context_line":"        self.assertStat(None, self.logger.increment, \u0027some.counter\u0027)"},{"line_number":814,"context_line":"        self.assertStat(None, self.logger.decrement, \u0027some.counter\u0027)"},{"line_number":815,"context_line":"        self.assertStat(None, self.logger.timing, \u0027some.timing\u0027, 6.28 * 1000)"},{"line_number":816,"context_line":"        self.assertStat(None, self.logger.update_stats, \u0027some.stat\u0027, 3)"}],"source_content_type":"text/x-python","patch_set":22,"id":"d9382e8a_8baba452","line":813,"in_reply_to":"22467c2e_2eec7800","updated":"2024-07-02 15:34:51.000000000","message":"Acknowledged","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"11e44436167bd0af814619080ea7811c1533ae9f","unresolved":true,"context_lines":[{"line_number":867,"context_line":"            \u0027statsd_label_mode\u0027: \u0027invalid\u0027,"},{"line_number":868,"context_line":"            \u0027statsd_emit_legacy\u0027: \u0027true\u0027,"},{"line_number":869,"context_line":"        }"},{"line_number":870,"context_line":"        self.assertRaises(ValueError, utils.get_logger, conf, \u0027pfx\u0027)"},{"line_number":871,"context_line":""},{"line_number":872,"context_line":"    def test_delegate_methods_with_labels_no_tail_prefix(self):"},{"line_number":873,"context_line":"        self.logger \u003d utils.get_logger({"}],"source_content_type":"text/x-python","patch_set":22,"id":"0dc62700_eb81cc1a","line":870,"updated":"2024-06-25 18:40:03.000000000","message":"do we want to exercise get_logger here or get_statsd_client?","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"a0a734b73158987742caf8c9a22a24a947c1df42","unresolved":false,"context_lines":[{"line_number":867,"context_line":"            \u0027statsd_label_mode\u0027: \u0027invalid\u0027,"},{"line_number":868,"context_line":"            \u0027statsd_emit_legacy\u0027: \u0027true\u0027,"},{"line_number":869,"context_line":"        }"},{"line_number":870,"context_line":"        self.assertRaises(ValueError, utils.get_logger, conf, \u0027pfx\u0027)"},{"line_number":871,"context_line":""},{"line_number":872,"context_line":"    def test_delegate_methods_with_labels_no_tail_prefix(self):"},{"line_number":873,"context_line":"        self.logger \u003d utils.get_logger({"}],"source_content_type":"text/x-python","patch_set":22,"id":"e87cc830_e5d378b0","line":870,"in_reply_to":"0dc62700_eb81cc1a","updated":"2024-07-02 15:34:51.000000000","message":"Acknowledged","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"11e44436167bd0af814619080ea7811c1533ae9f","unresolved":true,"context_lines":[{"line_number":928,"context_line":"        labels_update_args \u003d (\u0027the_stat\u0027, 3)"},{"line_number":929,"context_line":"        labels \u003d {\u0027action\u0027: \u0027some\u0027, \u0027result\u0027: \u0027ok\u0027}"},{"line_number":930,"context_line":"        self.assertStat("},{"line_number":931,"context_line":"            \u0027the_counter:1|c|#action:some,result:ok\u0027,"},{"line_number":932,"context_line":"            self.logger.increment, *labels_inc_dec_args, labels\u003dlabels)"},{"line_number":933,"context_line":"        self.assertStat("},{"line_number":934,"context_line":"            \u0027the_counter:-1|c|#action:some,result:ok\u0027,"}],"source_content_type":"text/x-python","patch_set":22,"id":"c7915ad3_74d51eb3","line":931,"updated":"2024-06-25 18:40:03.000000000","message":"so the labeled metric format does not include the `log_statsd_metric_prefix \u003d my_prefix` NOR the `logger_name \u003d pfx`\n\nI feel like maybe the \"name\" part might be a significant label?  But perhaps we imagine that use-case would be better handled with user labels?","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"a0a734b73158987742caf8c9a22a24a947c1df42","unresolved":false,"context_lines":[{"line_number":928,"context_line":"        labels_update_args \u003d (\u0027the_stat\u0027, 3)"},{"line_number":929,"context_line":"        labels \u003d {\u0027action\u0027: \u0027some\u0027, \u0027result\u0027: \u0027ok\u0027}"},{"line_number":930,"context_line":"        self.assertStat("},{"line_number":931,"context_line":"            \u0027the_counter:1|c|#action:some,result:ok\u0027,"},{"line_number":932,"context_line":"            self.logger.increment, *labels_inc_dec_args, labels\u003dlabels)"},{"line_number":933,"context_line":"        self.assertStat("},{"line_number":934,"context_line":"            \u0027the_counter:-1|c|#action:some,result:ok\u0027,"}],"source_content_type":"text/x-python","patch_set":22,"id":"ad0a3ad7_057878db","line":931,"in_reply_to":"c7915ad3_74d51eb3","updated":"2024-07-02 15:34:51.000000000","message":"Per our discussion earlier, not using the prefix or tail prefix in labels, instead using user labels for similar effect. Tim\u0027s original patch was using the prefix in metric name, and log_name in labels.","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"49971256edaffded3fbbe4bceb93c03bb66306e2","unresolved":true,"context_lines":[{"line_number":628,"context_line":"    def _send_and_get(self, sender_fn, *args, **kwargs):"},{"line_number":629,"context_line":"        \"\"\""},{"line_number":630,"context_line":"        Because the client library may not actually send a packet with"},{"line_number":631,"context_line":"        sample_rate \u003c 1, we keep trying until we get one through."},{"line_number":632,"context_line":"        \"\"\""},{"line_number":633,"context_line":"        got \u003d None"},{"line_number":634,"context_line":"        while not got:"}],"source_content_type":"text/x-python","patch_set":27,"id":"69e53d03_55dc8a59","line":631,"updated":"2024-07-12 12:28:17.000000000","message":"hmmm, so a test can hang forever rather than fail (as I discovered!) - maybe we can put a timeout in here?","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"6c73dd8c1e232f1daf1102296162d639e8c85583","unresolved":true,"context_lines":[{"line_number":628,"context_line":"    def _send_and_get(self, sender_fn, *args, **kwargs):"},{"line_number":629,"context_line":"        \"\"\""},{"line_number":630,"context_line":"        Because the client library may not actually send a packet with"},{"line_number":631,"context_line":"        sample_rate \u003c 1, we keep trying until we get one through."},{"line_number":632,"context_line":"        \"\"\""},{"line_number":633,"context_line":"        got \u003d None"},{"line_number":634,"context_line":"        while not got:"}],"source_content_type":"text/x-python","patch_set":27,"id":"f06a5b73_e825bed5","line":631,"in_reply_to":"69e53d03_55dc8a59","updated":"2024-07-15 19:02:11.000000000","message":"😬 Makes me wonder a couple things:\n\n- How many tests actually need to worry about sample_rate? Can we just patch random instead?\n- Can we get the timeout on the queue down lower than a half second? I would have thought a tenth of that should be fine.","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"aa3d6fb7c80733c1ca9e5b515a39d00acec91c79","unresolved":false,"context_lines":[{"line_number":628,"context_line":"    def _send_and_get(self, sender_fn, *args, **kwargs):"},{"line_number":629,"context_line":"        \"\"\""},{"line_number":630,"context_line":"        Because the client library may not actually send a packet with"},{"line_number":631,"context_line":"        sample_rate \u003c 1, we keep trying until we get one through."},{"line_number":632,"context_line":"        \"\"\""},{"line_number":633,"context_line":"        got \u003d None"},{"line_number":634,"context_line":"        while not got:"}],"source_content_type":"text/x-python","patch_set":27,"id":"2292ff8c_9d254a74","line":631,"in_reply_to":"c77d9921_03b2a1d5","updated":"2024-07-19 16:33:39.000000000","message":"Acknowledged","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"e83e4e4599c665eb2ef2b9c6ef7f9755151af0c3","unresolved":true,"context_lines":[{"line_number":628,"context_line":"    def _send_and_get(self, sender_fn, *args, **kwargs):"},{"line_number":629,"context_line":"        \"\"\""},{"line_number":630,"context_line":"        Because the client library may not actually send a packet with"},{"line_number":631,"context_line":"        sample_rate \u003c 1, we keep trying until we get one through."},{"line_number":632,"context_line":"        \"\"\""},{"line_number":633,"context_line":"        got \u003d None"},{"line_number":634,"context_line":"        while not got:"}],"source_content_type":"text/x-python","patch_set":27,"id":"c77d9921_03b2a1d5","line":631,"in_reply_to":"f06a5b73_e825bed5","updated":"2024-07-15 21:44:38.000000000","message":"that\u0027s three good ideas!","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"49971256edaffded3fbbe4bceb93c03bb66306e2","unresolved":true,"context_lines":[{"line_number":825,"context_line":"                        sample_rate\u003d0.9912)"},{"line_number":826,"context_line":""},{"line_number":827,"context_line":"    def test_delegate_methods_with_labels_and_legacy_disabled(self):"},{"line_number":828,"context_line":"        logger \u003d utils.get_logger({"},{"line_number":829,"context_line":"            \u0027log_statsd_host\u0027: \u0027localhost\u0027,"},{"line_number":830,"context_line":"            \u0027log_statsd_port\u0027: str(self.port),"},{"line_number":831,"context_line":"            \u0027log_statsd_metric_prefix\u0027: \u0027my_prefix\u0027,"}],"source_content_type":"text/x-python","patch_set":27,"id":"70c08497_034332eb","line":828,"updated":"2024-07-12 12:28:17.000000000","message":"I think that we should be using get_statsd_client to instantiate the test object, at least for new tests that are added to this module.\n\nAlso \"delegate_methods\" has nothing to do with StatsdClient","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"aa3d6fb7c80733c1ca9e5b515a39d00acec91c79","unresolved":false,"context_lines":[{"line_number":825,"context_line":"                        sample_rate\u003d0.9912)"},{"line_number":826,"context_line":""},{"line_number":827,"context_line":"    def test_delegate_methods_with_labels_and_legacy_disabled(self):"},{"line_number":828,"context_line":"        logger \u003d utils.get_logger({"},{"line_number":829,"context_line":"            \u0027log_statsd_host\u0027: \u0027localhost\u0027,"},{"line_number":830,"context_line":"            \u0027log_statsd_port\u0027: str(self.port),"},{"line_number":831,"context_line":"            \u0027log_statsd_metric_prefix\u0027: \u0027my_prefix\u0027,"}],"source_content_type":"text/x-python","patch_set":27,"id":"45343e43_b90fbae4","line":828,"in_reply_to":"70c08497_034332eb","updated":"2024-07-19 16:33:39.000000000","message":"Acknowledged","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"49971256edaffded3fbbe4bceb93c03bb66306e2","unresolved":true,"context_lines":[{"line_number":834,"context_line":"        }, \u0027pfx\u0027)"},{"line_number":835,"context_line":"        labels_inc_dec_args \u003d (\u0027the_counter\u0027, )"},{"line_number":836,"context_line":"        labels_timing_args \u003d (\u0027the_timing\u0027, 6.28 * 1000)"},{"line_number":837,"context_line":"        labels_update_args \u003d (\u0027the_stat\u0027, 3)"},{"line_number":838,"context_line":"        labels \u003d {\u0027action\u0027: \u0027some\u0027, \u0027result\u0027: \u0027ok\u0027}"},{"line_number":839,"context_line":"        with mock.patch.object(logger.logger.statsd_client,"},{"line_number":840,"context_line":"                               \u0027_open_socket\u0027) as mock_open:"}],"source_content_type":"text/x-python","patch_set":27,"id":"77cbeb0f_6c59e419","line":837,"updated":"2024-07-12 12:28:17.000000000","message":"why are these args defined here and not just declared inline with the method call? I find it hard to read","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"aa3d6fb7c80733c1ca9e5b515a39d00acec91c79","unresolved":false,"context_lines":[{"line_number":834,"context_line":"        }, \u0027pfx\u0027)"},{"line_number":835,"context_line":"        labels_inc_dec_args \u003d (\u0027the_counter\u0027, )"},{"line_number":836,"context_line":"        labels_timing_args \u003d (\u0027the_timing\u0027, 6.28 * 1000)"},{"line_number":837,"context_line":"        labels_update_args \u003d (\u0027the_stat\u0027, 3)"},{"line_number":838,"context_line":"        labels \u003d {\u0027action\u0027: \u0027some\u0027, \u0027result\u0027: \u0027ok\u0027}"},{"line_number":839,"context_line":"        with mock.patch.object(logger.logger.statsd_client,"},{"line_number":840,"context_line":"                               \u0027_open_socket\u0027) as mock_open:"}],"source_content_type":"text/x-python","patch_set":27,"id":"2455d407_dae7bcce","line":837,"in_reply_to":"77cbeb0f_6c59e419","updated":"2024-07-19 16:33:39.000000000","message":"Acknowledged","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"49971256edaffded3fbbe4bceb93c03bb66306e2","unresolved":true,"context_lines":[{"line_number":891,"context_line":"        self.assertRaises(ValueError, statsd_client.get_statsd_client,"},{"line_number":892,"context_line":"                          conf, \u0027pfx\u0027)"},{"line_number":893,"context_line":""},{"line_number":894,"context_line":"    def test_delegate_methods_with_labels_no_tail_prefix(self):"},{"line_number":895,"context_line":"        self.logger \u003d utils.get_logger({"},{"line_number":896,"context_line":"            \u0027log_statsd_host\u0027: \u0027localhost\u0027,"},{"line_number":897,"context_line":"            \u0027log_statsd_port\u0027: str(self.port),"}],"source_content_type":"text/x-python","patch_set":27,"id":"b0140454_7af3f000","line":894,"updated":"2024-07-12 12:28:17.000000000","message":"this test seems to be covering the behavior of get_logger w.r.t the name arg and doesn\u0027t otherwise add anything to do with labeled metrics? Should it be in test_logs and in a separate patch if it is just a drive by test coverage?","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"aa3d6fb7c80733c1ca9e5b515a39d00acec91c79","unresolved":false,"context_lines":[{"line_number":891,"context_line":"        self.assertRaises(ValueError, statsd_client.get_statsd_client,"},{"line_number":892,"context_line":"                          conf, \u0027pfx\u0027)"},{"line_number":893,"context_line":""},{"line_number":894,"context_line":"    def test_delegate_methods_with_labels_no_tail_prefix(self):"},{"line_number":895,"context_line":"        self.logger \u003d utils.get_logger({"},{"line_number":896,"context_line":"            \u0027log_statsd_host\u0027: \u0027localhost\u0027,"},{"line_number":897,"context_line":"            \u0027log_statsd_port\u0027: str(self.port),"}],"source_content_type":"text/x-python","patch_set":27,"id":"850075a7_4f6b311f","line":894,"in_reply_to":"b0140454_7af3f000","updated":"2024-07-19 16:33:39.000000000","message":"Clay was suggesting to add some test for labels and tail prefix. Seems more related to statsd client?","commit_id":"16dc6b371026e911e0b3175cea1a02d94041dc1b"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"db4cdb44d3c2884ebb34f429f9877dc8ff6a51ee","unresolved":true,"context_lines":[{"line_number":824,"context_line":"                        self.logger.update_stats, \u0027another.counter\u0027, 3,"},{"line_number":825,"context_line":"                        sample_rate\u003d0.9912)"},{"line_number":826,"context_line":""},{"line_number":827,"context_line":"    def test_delegate_methods_with_labels_and_legacy_disabled(self):"},{"line_number":828,"context_line":"        conf \u003d {"},{"line_number":829,"context_line":"            \u0027log_statsd_host\u0027: \u0027localhost\u0027,"},{"line_number":830,"context_line":"            \u0027log_statsd_port\u0027: str(self.port),"}],"source_content_type":"text/x-python","patch_set":30,"id":"7772325d_5c8f405d","line":827,"range":{"start_line":827,"start_character":13,"end_line":827,"end_character":29},"updated":"2024-07-25 15:33:35.000000000","message":"I don\u0027t understand the use of ``delegate_methods`` in the test names. It reminds me of the logger delegate ``increment`` etc but we\u0027re not testing those here","commit_id":"17382f672a5fd3a99781f3d5599887ee2725033d"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"d005adb00a62faf9a3888b985c10ffdb92fdacd2","unresolved":false,"context_lines":[{"line_number":824,"context_line":"                        self.logger.update_stats, \u0027another.counter\u0027, 3,"},{"line_number":825,"context_line":"                        sample_rate\u003d0.9912)"},{"line_number":826,"context_line":""},{"line_number":827,"context_line":"    def test_delegate_methods_with_labels_and_legacy_disabled(self):"},{"line_number":828,"context_line":"        conf \u003d {"},{"line_number":829,"context_line":"            \u0027log_statsd_host\u0027: \u0027localhost\u0027,"},{"line_number":830,"context_line":"            \u0027log_statsd_port\u0027: str(self.port),"}],"source_content_type":"text/x-python","patch_set":30,"id":"3d8d5414_5dfa16ec","line":827,"range":{"start_line":827,"start_character":13,"end_line":827,"end_character":29},"in_reply_to":"7772325d_5c8f405d","updated":"2024-07-30 16:22:36.000000000","message":"Acknowledged","commit_id":"17382f672a5fd3a99781f3d5599887ee2725033d"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"db4cdb44d3c2884ebb34f429f9877dc8ff6a51ee","unresolved":true,"context_lines":[{"line_number":1106,"context_line":"        labeled_statsd \u003d statsd_client.get_labeled_statsd_client(conf)"},{"line_number":1107,"context_line":"        self.assertStat("},{"line_number":1108,"context_line":"            \u0027simple_counter:1|c\u0027,"},{"line_number":1109,"context_line":"            labeled_statsd.increment, \u0027simple_counter\u0027, labels\u003d{})"},{"line_number":1110,"context_line":""},{"line_number":1111,"context_line":""},{"line_number":1112,"context_line":"class TestModuleFunctions(unittest.TestCase):"}],"source_content_type":"text/x-python","patch_set":30,"id":"f7b44454_dd8eebcd","line":1109,"updated":"2024-07-25 15:33:35.000000000","message":"I wonder if we ought to split the ``StatsdClient`` and ``LabeledStatsdClient`` tests to separate ``TestCases``","commit_id":"17382f672a5fd3a99781f3d5599887ee2725033d"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"d005adb00a62faf9a3888b985c10ffdb92fdacd2","unresolved":false,"context_lines":[{"line_number":1106,"context_line":"        labeled_statsd \u003d statsd_client.get_labeled_statsd_client(conf)"},{"line_number":1107,"context_line":"        self.assertStat("},{"line_number":1108,"context_line":"            \u0027simple_counter:1|c\u0027,"},{"line_number":1109,"context_line":"            labeled_statsd.increment, \u0027simple_counter\u0027, labels\u003d{})"},{"line_number":1110,"context_line":""},{"line_number":1111,"context_line":""},{"line_number":1112,"context_line":"class TestModuleFunctions(unittest.TestCase):"}],"source_content_type":"text/x-python","patch_set":30,"id":"0b3dcd41_a8eae9de","line":1109,"in_reply_to":"f7b44454_dd8eebcd","updated":"2024-07-30 16:22:36.000000000","message":"Acknowledged","commit_id":"17382f672a5fd3a99781f3d5599887ee2725033d"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"ca8a986d5442eaa683a72b98e62de37e241ed16e","unresolved":true,"context_lines":[{"line_number":114,"context_line":"        self.assertFalse(mock_open1.mock_calls)"},{"line_number":115,"context_line":"        self.assertFalse(self.getaddrinfo_calls)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def test_user_label(self):"},{"line_number":118,"context_line":"        conf \u003d {"},{"line_number":119,"context_line":"            \u0027log_statsd_host\u0027: \u0027myhost1\u0027,"},{"line_number":120,"context_line":"            \u0027log_statsd_port\u0027: 1235,"}],"source_content_type":"text/x-python","patch_set":46,"id":"72b640f7_a27548ca","line":117,"updated":"2025-03-21 15:23:29.000000000","message":"these tests have been added to the class TestStatsdClient which is intended to be tests on the legacy StatsdClient.\n\nI\u0027d like to see a new TestLabeledStatsdClient as a home for new tests that target LabeledStatsdClient","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"b08838abde9daf9270d067d77fcff08bb0a4d087","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        self.assertFalse(mock_open1.mock_calls)"},{"line_number":115,"context_line":"        self.assertFalse(self.getaddrinfo_calls)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def test_user_label(self):"},{"line_number":118,"context_line":"        conf \u003d {"},{"line_number":119,"context_line":"            \u0027log_statsd_host\u0027: \u0027myhost1\u0027,"},{"line_number":120,"context_line":"            \u0027log_statsd_port\u0027: 1235,"}],"source_content_type":"text/x-python","patch_set":46,"id":"fc09a6bc_f94f41a4","line":117,"in_reply_to":"72b640f7_a27548ca","updated":"2025-03-25 10:35:27.000000000","message":"Done","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"ca8a986d5442eaa683a72b98e62de37e241ed16e","unresolved":true,"context_lines":[{"line_number":466,"context_line":"                               [got, expected_regexp])"},{"line_number":467,"context_line":""},{"line_number":468,"context_line":""},{"line_number":469,"context_line":"class TestStatsdLoggingDelegation(BaseTestStatsdClientOutput):"},{"line_number":470,"context_line":"    def test_methods_are_no_ops_when_not_enabled(self):"},{"line_number":471,"context_line":"        self.client \u003d get_statsd_client({"},{"line_number":472,"context_line":"            # No \"log_statsd_host\" means \"disabled\""}],"source_content_type":"text/x-python","patch_set":46,"id":"478fd1c4_e42fcde7","line":469,"range":{"start_line":469,"start_character":6,"end_line":469,"end_character":33},"updated":"2025-03-21 15:23:29.000000000","message":"I don\u0027t understand why the name included \"LoggingDelegation\"?\n\nI *think* that perhaps the intention here was to break out sub-classes for each of get_statsd_client and get_labeled_statsd_client, so this should perhaps be named TestStatsdClientOutput and then we add a TestLabeledStatsdClientOutput.\n\nBut I\u0027m not sure why on master we have *two* test classes per-client i.e. TestStatsdClient and TestStatsdClientOutput - maybe one was testing basic init if the class and the other tests the various stats lines that get emitted?\n\nIt feels like we have a somewhat confused test organisation on master and it\u0027s becoming more confused as we add another client. Maybe because when this patch first started there wasn\u0027t yet a clear separation of labeled and legacy clients??? IDK","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"b08838abde9daf9270d067d77fcff08bb0a4d087","unresolved":false,"context_lines":[{"line_number":466,"context_line":"                               [got, expected_regexp])"},{"line_number":467,"context_line":""},{"line_number":468,"context_line":""},{"line_number":469,"context_line":"class TestStatsdLoggingDelegation(BaseTestStatsdClientOutput):"},{"line_number":470,"context_line":"    def test_methods_are_no_ops_when_not_enabled(self):"},{"line_number":471,"context_line":"        self.client \u003d get_statsd_client({"},{"line_number":472,"context_line":"            # No \"log_statsd_host\" means \"disabled\""}],"source_content_type":"text/x-python","patch_set":46,"id":"a046ccd1_5085b8d9","line":469,"range":{"start_line":469,"start_character":6,"end_line":469,"end_character":33},"in_reply_to":"478fd1c4_e42fcde7","updated":"2025-03-25 10:35:27.000000000","message":"Done","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"ca8a986d5442eaa683a72b98e62de37e241ed16e","unresolved":true,"context_lines":[{"line_number":642,"context_line":"                        sample_rate\u003d0.9912)"},{"line_number":643,"context_line":""},{"line_number":644,"context_line":""},{"line_number":645,"context_line":"class TestStatsdMethods(BaseTestStatsdClientOutput):"},{"line_number":646,"context_line":"    def test_statsd_methods_with_labels_and_legacy_disabled(self):"},{"line_number":647,"context_line":"        conf \u003d {"},{"line_number":648,"context_line":"            \u0027log_statsd_host\u0027: \u0027localhost\u0027,"}],"source_content_type":"text/x-python","patch_set":46,"id":"e61ae425_a6e834b1","line":645,"range":{"start_line":645,"start_character":6,"end_line":645,"end_character":23},"updated":"2025-03-21 15:23:29.000000000","message":"Let\u0027s have the class name relate to what it covers e.g. TestLabeledStatsdClient\n\nI expected this new test case to be covering the newly added LabeledStatsdClient, which it does, but there\u0027s also calls to get_statsd_client - I\u0027d like to have a clean separation of tests for the two different clients.\n\nIf there was missing test coverage for the legacy client then let\u0027s get that merged to master as a pre-requisite, but IDK if the legacy client assertions added here might just be duplicating the existing tests??","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"b08838abde9daf9270d067d77fcff08bb0a4d087","unresolved":false,"context_lines":[{"line_number":642,"context_line":"                        sample_rate\u003d0.9912)"},{"line_number":643,"context_line":""},{"line_number":644,"context_line":""},{"line_number":645,"context_line":"class TestStatsdMethods(BaseTestStatsdClientOutput):"},{"line_number":646,"context_line":"    def test_statsd_methods_with_labels_and_legacy_disabled(self):"},{"line_number":647,"context_line":"        conf \u003d {"},{"line_number":648,"context_line":"            \u0027log_statsd_host\u0027: \u0027localhost\u0027,"}],"source_content_type":"text/x-python","patch_set":46,"id":"f3ba6b8d_8d1fe89a","line":645,"range":{"start_line":645,"start_character":6,"end_line":645,"end_character":23},"in_reply_to":"e61ae425_a6e834b1","updated":"2025-03-25 10:35:27.000000000","message":"Done","commit_id":"e6000ffb4174cf9cd6bf467d6f85e547545f7003"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"4d38b7c50c75136349cfc352a3804f9a4d242eda","unresolved":true,"context_lines":[{"line_number":651,"context_line":"            \u0027statsd_label_mode\u0027: \u0027disabled\u0027,"},{"line_number":652,"context_line":"            \u0027statsd_emit_legacy\u0027: \u0027false\u0027,"},{"line_number":653,"context_line":"        }"},{"line_number":654,"context_line":"        statsd \u003d statsd_client.get_statsd_client(conf, tail_prefix\u003d\u0027pfx\u0027)"},{"line_number":655,"context_line":"        labeled_statsd \u003d statsd_client.get_labeled_statsd_client(conf)"},{"line_number":656,"context_line":"        with mock.patch.object(statsd,"},{"line_number":657,"context_line":"                               \u0027_open_socket\u0027) as mock_open:"},{"line_number":658,"context_line":"            # Any pre-labeled-metrics callers should not emit legacy metrics"}],"source_content_type":"text/x-python","patch_set":47,"id":"7423c757_65a5cd1f","line":655,"range":{"start_line":654,"start_character":8,"end_line":655,"end_character":70},"updated":"2025-03-21 18:43:16.000000000","message":"so these tests seem to be testing two orthogonal things at the same time i.e. a StatsdClient and a LabeledStatsdClient, which I find confusing to read, but also suspect there\u0027s a lot of duplication.\n\nI don\u0027t think we need the two sets of assertions to be coupled?","commit_id":"b9ef50c32b28d5b361bca13e599f11e2c8c1559f"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"b08838abde9daf9270d067d77fcff08bb0a4d087","unresolved":false,"context_lines":[{"line_number":651,"context_line":"            \u0027statsd_label_mode\u0027: \u0027disabled\u0027,"},{"line_number":652,"context_line":"            \u0027statsd_emit_legacy\u0027: \u0027false\u0027,"},{"line_number":653,"context_line":"        }"},{"line_number":654,"context_line":"        statsd \u003d statsd_client.get_statsd_client(conf, tail_prefix\u003d\u0027pfx\u0027)"},{"line_number":655,"context_line":"        labeled_statsd \u003d statsd_client.get_labeled_statsd_client(conf)"},{"line_number":656,"context_line":"        with mock.patch.object(statsd,"},{"line_number":657,"context_line":"                               \u0027_open_socket\u0027) as mock_open:"},{"line_number":658,"context_line":"            # Any pre-labeled-metrics callers should not emit legacy metrics"}],"source_content_type":"text/x-python","patch_set":47,"id":"2a1a60ca_b0b47777","line":655,"range":{"start_line":654,"start_character":8,"end_line":655,"end_character":70},"in_reply_to":"7423c757_65a5cd1f","updated":"2025-03-25 10:35:27.000000000","message":"Done","commit_id":"b9ef50c32b28d5b361bca13e599f11e2c8c1559f"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"b08838abde9daf9270d067d77fcff08bb0a4d087","unresolved":true,"context_lines":[{"line_number":204,"context_line":""},{"line_number":205,"context_line":"class TestGetLabeledStatsdClientConfParsing(BaseTestStatsdClient):"},{"line_number":206,"context_line":"    \"\"\""},{"line_number":207,"context_line":"    Tests here use get_labeled_statsd_client to make a StatsdClient."},{"line_number":208,"context_line":"    \"\"\""},{"line_number":209,"context_line":"    def test_conf_defaults(self):"},{"line_number":210,"context_line":"        # no options configured"}],"source_content_type":"text/x-python","patch_set":48,"id":"27ef7b45_edabef85","line":207,"updated":"2025-03-25 10:35:27.000000000","message":"LabeledStatsdClient","commit_id":"99a195fe9cbef9cfcdeafd57e8e9310c02afbc89"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"593028f17009a618dccd3bd88bb84541521fd9f4","unresolved":false,"context_lines":[{"line_number":204,"context_line":""},{"line_number":205,"context_line":"class TestGetLabeledStatsdClientConfParsing(BaseTestStatsdClient):"},{"line_number":206,"context_line":"    \"\"\""},{"line_number":207,"context_line":"    Tests here use get_labeled_statsd_client to make a StatsdClient."},{"line_number":208,"context_line":"    \"\"\""},{"line_number":209,"context_line":"    def test_conf_defaults(self):"},{"line_number":210,"context_line":"        # no options configured"}],"source_content_type":"text/x-python","patch_set":48,"id":"cb2b714a_efb168f5","line":207,"in_reply_to":"27ef7b45_edabef85","updated":"2025-04-02 14:35:53.000000000","message":"Done","commit_id":"99a195fe9cbef9cfcdeafd57e8e9310c02afbc89"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0155681cc6e8a683f86ea18f95ff366b92da2532","unresolved":true,"context_lines":[{"line_number":367,"context_line":""},{"line_number":368,"context_line":"class TestGetStatsdClientSocket(BaseTestStatsdClient):"},{"line_number":369,"context_line":"    def make_test_client(self, conf, *args, **kwargs):"},{"line_number":370,"context_line":"        return statsd_client.get_statsd_client(conf, *args, **kwargs)"},{"line_number":371,"context_line":""},{"line_number":372,"context_line":"    def test_ipv4_or_ipv6_hostname_defaults_to_ipv4(self):"},{"line_number":373,"context_line":"        def stub_getaddrinfo_both_ipv4_and_ipv6(host, port, family, *rest):"}],"source_content_type":"text/x-python","patch_set":53,"id":"d93ee570_09bb6043","line":370,"updated":"2025-04-03 21:19:45.000000000","message":"ok, I might have made a `BaseTestSocket` to raise NotImplemented in `make_test_client` and write all the tests, so that `TestGetStatsdClientSocket` was more a shell like `TestGetLabeledStatsdClientSocket` - but this is ok too.","commit_id":"7e5235894b4f590024d572f64ab0b3ba2b02c68b"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"995fdade1da8d47044fb80ab0d74d123b9e134ea","unresolved":true,"context_lines":[{"line_number":451,"context_line":"            client \u003d self.make_test_client({"},{"line_number":452,"context_line":"                \u0027log_statsd_host\u0027: \u0027i-am-not-a-hostname-or-ip\u0027,"},{"line_number":453,"context_line":"                \u0027log_statsd_port\u0027: \u00279876\u0027,"},{"line_number":454,"context_line":"            }, \u0027some-name\u0027, logger\u003dself.logger)"},{"line_number":455,"context_line":""},{"line_number":456,"context_line":"        self.assertEqual(client._sock_family, socket.AF_INET)"},{"line_number":457,"context_line":"        self.assertEqual(client._target,"}],"source_content_type":"text/x-python","patch_set":53,"id":"14c4cf3e_0d77a2c9","line":454,"updated":"2025-04-03 22:44:52.000000000","message":"I\u0027m not sure I can understand what `get_labeled_statsd_client` does with `some-name`","commit_id":"7e5235894b4f590024d572f64ab0b3ba2b02c68b"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"995fdade1da8d47044fb80ab0d74d123b9e134ea","unresolved":true,"context_lines":[{"line_number":467,"context_line":""},{"line_number":468,"context_line":"class TestGetLabeledStatsdClientSocket(TestGetStatsdClientSocket):"},{"line_number":469,"context_line":"    def make_test_client(self, conf, *args, logger\u003dNone):"},{"line_number":470,"context_line":"        return statsd_client.get_labeled_statsd_client(conf, logger\u003dlogger)"},{"line_number":471,"context_line":""},{"line_number":472,"context_line":""},{"line_number":473,"context_line":"class TestGetStatsdClientSending(BaseTestStatsdClient):"}],"source_content_type":"text/x-python","patch_set":53,"id":"abf7454c_55cf01a7","line":470,"updated":"2025-04-03 22:44:52.000000000","message":"none of these tests pass in a conf with any statsd_label_mode option set - so I think they\u0027re telling us we always do `_set_sock_family_and_target` twice even tho they can\u0027t be configured differently and you may have one or both of them disabled.\n\noic, it ignores `args` - clutch","commit_id":"7e5235894b4f590024d572f64ab0b3ba2b02c68b"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0155681cc6e8a683f86ea18f95ff366b92da2532","unresolved":true,"context_lines":[{"line_number":473,"context_line":"class TestGetStatsdClientSending(BaseTestStatsdClient):"},{"line_number":474,"context_line":"    \"\"\""},{"line_number":475,"context_line":"    Tests here use get_statsd_client to make a StatsdClient."},{"line_number":476,"context_line":"    \"\"\""},{"line_number":477,"context_line":"    def test_sending_ipv6(self):"},{"line_number":478,"context_line":"        def fake_getaddrinfo(host, port, *args):"},{"line_number":479,"context_line":"            # this is what a real getaddrinfo(\u0027::1\u0027, port,"}],"source_content_type":"text/x-python","patch_set":53,"id":"a4937d15_6609d60a","line":476,"updated":"2025-04-03 21:19:45.000000000","message":"```\nclass TestGetStatsdClientConfParsing(BaseTestStatsdClient):\n    \"\"\"\n    Tests here use get_statsd_client to make a StatsdClient.\n    \"\"\"\n```\n\nohkay...","commit_id":"7e5235894b4f590024d572f64ab0b3ba2b02c68b"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0155681cc6e8a683f86ea18f95ff366b92da2532","unresolved":true,"context_lines":[{"line_number":627,"context_line":"    def assertStatMatches(self, expected_regexp, sender_fn, *args, **kwargs):"},{"line_number":628,"context_line":"        got \u003d self._send_and_get(sender_fn, *args, **kwargs)"},{"line_number":629,"context_line":"        return self.assertTrue(re.search(expected_regexp, got),"},{"line_number":630,"context_line":"                               [got, expected_regexp])"},{"line_number":631,"context_line":""},{"line_number":632,"context_line":""},{"line_number":633,"context_line":"class TestGetStatsdClientOutput(BaseTestStatsdClientOutput):"}],"source_content_type":"text/x-python","patch_set":53,"id":"8e2e51e9_72ee2b2d","line":630,"updated":"2025-04-03 21:19:45.000000000","message":"ok, there\u0027s now shared base tests in `BaseTestStatsdClientOutput`","commit_id":"7e5235894b4f590024d572f64ab0b3ba2b02c68b"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"995fdade1da8d47044fb80ab0d74d123b9e134ea","unresolved":true,"context_lines":[{"line_number":1028,"context_line":"        labels \u003d {\u0027action\u0027: \u0027some\u0027, \u0027result\u0027: \u0027ok\u0027}"},{"line_number":1029,"context_line":"        self.assertStat("},{"line_number":1030,"context_line":"            \u0027the_counter[action\u003dsome,result\u003dok]:1|c|@0.45\u0027,"},{"line_number":1031,"context_line":"            labeled_statsd.increment, \u0027the_counter\u0027, labels\u003dlabels)"},{"line_number":1032,"context_line":""},{"line_number":1033,"context_line":"    def _do_test_statsd_methods_no_labels(self, label_mode):"},{"line_number":1034,"context_line":"        conf \u003d {"}],"source_content_type":"text/x-python","patch_set":53,"id":"37cda6be_afc9d5a6","line":1031,"updated":"2025-04-03 22:44:52.000000000","message":"oic, so the `default_sample_rate` *config* is tested, just maybe not passing in sample_rate from the call","commit_id":"7e5235894b4f590024d572f64ab0b3ba2b02c68b"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0155681cc6e8a683f86ea18f95ff366b92da2532","unresolved":true,"context_lines":[{"line_number":1056,"context_line":"        self.assertStat(\u0027the.stat:3|c\u0027,"},{"line_number":1057,"context_line":"                        labeled_statsd.update_stats, \u0027the.stat\u0027, 3)"},{"line_number":1058,"context_line":"        self.assertStat(\u0027the.stat:500.0|ms\u0027,"},{"line_number":1059,"context_line":"                        labeled_statsd.transfer_rate, \u0027the.stat\u0027, 3.3, 6600)"},{"line_number":1060,"context_line":""},{"line_number":1061,"context_line":"    def test_statsd_methods_dogstatsd_no_labels(self):"},{"line_number":1062,"context_line":"        self._do_test_statsd_methods_no_labels(\u0027dogstatsd\u0027)"}],"source_content_type":"text/x-python","patch_set":53,"id":"dd202b1d_6b49d6a5","line":1059,"updated":"2025-04-03 21:19:45.000000000","message":"this would probably be a good place to add some validation of the sample_rate kwarg; which otherwise seem only tested with `get_statsd_client`\n\nwith this diff:\n\n```\ndiff --git a/swift/common/statsd_client.py b/swift/common/statsd_client.py\nindex a55a5d3a2..092e1f9bc 100644\n--- a/swift/common/statsd_client.py\n+++ b/swift/common/statsd_client.py\n@@ -362,7 +362,7 @@ class StatsdClient(AbstractStatsdClient):\n         self._set_prefix(tail_prefix)\n \n     def _send(self, metric, value, metric_type, sample_rate):\n-        is_emitted, adjusted_sample_rate \u003d self._is_emitted(sample_rate)\n+        is_emitted, adjusted_sample_rate \u003d self._is_emitted(None)\n         if self.emit_legacy and is_emitted:\n             metric \u003d self._prefix + metric\n             line \u003d _build_line_parts(\n@@ -481,7 +481,7 @@ class LabeledStatsdClient(AbstractStatsdClient):\n         if not self.label_formatter:\n             return\n \n-        is_emitted, adjusted_sample_rate \u003d self._is_emitted(sample_rate)\n+        is_emitted, adjusted_sample_rate \u003d self._is_emitted(None)\n         if is_emitted:\n             return self._send_line(self._build_line(\n                 metric, value, metric_type, adjusted_sample_rate, labels))\n```\n\nI only get failures for the legacy client\n\n```\nFAILED swift/test/unit/common/test_statsd_client.py::TestGetStatsdClientSending::test_sample_rates - AssertionError: 12 is not None\nFAILED swift/test/unit/common/test_statsd_client.py::TestGetStatsdClientSending::test_sample_rates_with_sample_rate_factor - AssertionError: False is not true : b\u0027tribbles:1|c|@0.7462\u0027\nFAILED swift/test/unit/common/test_statsd_client.py::TestGetStatsdClientOutput::test_delegate_methods_with_default_sample_rate - AssertionError: \u0027pfx.some.counter:1|c|@0.9912\u0027 !\u003d \u0027pfx.some.counter:1|c|@0.93\u0027\nFAILED swift/test/unit/common/test_statsd_client.py::TestGetStatsdClientOutput::test_delegate_methods_with_metric_prefix - AssertionError: \u0027alpha.beta.some.counter:1|c|@0.9912\u0027 !\u003d \u0027alpha.beta.some.counter:1|c\u0027\nFAILED swift/test/unit/common/test_statsd_client.py::TestGetStatsdClientOutput::test_delegate_methods_with_no_default_sample_rate - AssertionError: \u0027pfx.some.counter:1|c|@0.972\u0027 !\u003d \u0027pfx.some.counter:1|c\u0027\n```","commit_id":"7e5235894b4f590024d572f64ab0b3ba2b02c68b"}],"test/unit/common/test_utils.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ff3be5e397da876afc37db5f8e895e7e70e55734","unresolved":true,"context_lines":[{"line_number":5543,"context_line":"        Because the client library may not actually send a packet with"},{"line_number":5544,"context_line":"        sample_rate \u003c 1, we keep trying until we get one through."},{"line_number":5545,"context_line":"        \"\"\""},{"line_number":5546,"context_line":"        got \u003d []"},{"line_number":5547,"context_line":"        while not got:"},{"line_number":5548,"context_line":"            bytes, retrySample \u003d sender_fn(*args, **kwargs)"},{"line_number":5549,"context_line":"            if not bytes and not retrySample:"}],"source_content_type":"text/x-python","patch_set":1,"id":"ced1d04d_e3fb8dd9","line":5546,"updated":"2024-02-22 16:04:46.000000000","message":"why did this default change?  you used to either get a string a None\n\nnow you get eihter a string or an empty list?","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"b88b14f58de391e903bd8cb3bbc903924ac45ce2","unresolved":false,"context_lines":[{"line_number":5543,"context_line":"        Because the client library may not actually send a packet with"},{"line_number":5544,"context_line":"        sample_rate \u003c 1, we keep trying until we get one through."},{"line_number":5545,"context_line":"        \"\"\""},{"line_number":5546,"context_line":"        got \u003d []"},{"line_number":5547,"context_line":"        while not got:"},{"line_number":5548,"context_line":"            bytes, retrySample \u003d sender_fn(*args, **kwargs)"},{"line_number":5549,"context_line":"            if not bytes and not retrySample:"}],"source_content_type":"text/x-python","patch_set":1,"id":"7ece30fa_cc8d1b49","line":5546,"in_reply_to":"ced1d04d_e3fb8dd9","updated":"2024-02-23 15:59:39.000000000","message":"Updated the patch","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ff3be5e397da876afc37db5f8e895e7e70e55734","unresolved":true,"context_lines":[{"line_number":5545,"context_line":"        \"\"\""},{"line_number":5546,"context_line":"        got \u003d []"},{"line_number":5547,"context_line":"        while not got:"},{"line_number":5548,"context_line":"            bytes, retrySample \u003d sender_fn(*args, **kwargs)"},{"line_number":5549,"context_line":"            if not bytes and not retrySample:"},{"line_number":5550,"context_line":"                break"},{"line_number":5551,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"6a226480_ff5e7ae1","line":5548,"updated":"2024-02-22 16:04:46.000000000","message":"bytes is a builtin keyword/function - please use a different variable name\n\nfor variable names idomatic python prefers snake_case with a few expections:\n\nhttps://peps.python.org/pep-0008/#function-and-variable-names\n\nin this case retry_sample would be prefered","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"b88b14f58de391e903bd8cb3bbc903924ac45ce2","unresolved":false,"context_lines":[{"line_number":5545,"context_line":"        \"\"\""},{"line_number":5546,"context_line":"        got \u003d []"},{"line_number":5547,"context_line":"        while not got:"},{"line_number":5548,"context_line":"            bytes, retrySample \u003d sender_fn(*args, **kwargs)"},{"line_number":5549,"context_line":"            if not bytes and not retrySample:"},{"line_number":5550,"context_line":"                break"},{"line_number":5551,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"8cdc8cc4_f22890ff","line":5548,"in_reply_to":"6a226480_ff5e7ae1","updated":"2024-02-23 15:59:39.000000000","message":"Updated the patch","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ff3be5e397da876afc37db5f8e895e7e70e55734","unresolved":true,"context_lines":[{"line_number":5555,"context_line":"                pass"},{"line_number":5556,"context_line":"        if six.PY3:"},{"line_number":5557,"context_line":"            got \u003d [x.decode(\u0027utf-8\u0027) for x in got]"},{"line_number":5558,"context_line":"        if len(got) \u003d\u003d 1:"},{"line_number":5559,"context_line":"            got \u003d got[0]"},{"line_number":5560,"context_line":"        return got"},{"line_number":5561,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"25022db9_2a590cc3","line":5558,"updated":"2024-02-22 16:04:46.000000000","message":"FWIW on my machine len(got) is always 0 or 1","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"b88b14f58de391e903bd8cb3bbc903924ac45ce2","unresolved":false,"context_lines":[{"line_number":5555,"context_line":"                pass"},{"line_number":5556,"context_line":"        if six.PY3:"},{"line_number":5557,"context_line":"            got \u003d [x.decode(\u0027utf-8\u0027) for x in got]"},{"line_number":5558,"context_line":"        if len(got) \u003d\u003d 1:"},{"line_number":5559,"context_line":"            got \u003d got[0]"},{"line_number":5560,"context_line":"        return got"},{"line_number":5561,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"f5fdf2c6_6691fb96","line":5558,"in_reply_to":"25022db9_2a590cc3","updated":"2024-02-23 15:59:39.000000000","message":"Updated the patch","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ff3be5e397da876afc37db5f8e895e7e70e55734","unresolved":true,"context_lines":[{"line_number":5742,"context_line":"                        self.logger.update_stats, \u0027another.counter\u0027, 3,"},{"line_number":5743,"context_line":"                        sample_rate\u003d0.9912)"},{"line_number":5744,"context_line":""},{"line_number":5745,"context_line":"    def test_delegate_methods_with_labels_and_prefix_disabled(self):"},{"line_number":5746,"context_line":"        loggers \u003d ["},{"line_number":5747,"context_line":"            utils.get_logger({"},{"line_number":5748,"context_line":"                \u0027log_statsd_host\u0027: \u0027localhost\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"5ba795f6_6ea922a3","line":5745,"updated":"2024-02-22 16:04:46.000000000","message":"i don\u0027t understand this test name \"prefix_disabled\" seems strnage because all of these configs have a \"log_statsd_metric_prefix\" of \"my_prefix\" as well as the \"pfx\" arg (log_name?)\n\nI think this test would be more like:\n\n    test_emit_legacy_option_does_not_work_with_label_mode_disabled","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"b88b14f58de391e903bd8cb3bbc903924ac45ce2","unresolved":false,"context_lines":[{"line_number":5742,"context_line":"                        self.logger.update_stats, \u0027another.counter\u0027, 3,"},{"line_number":5743,"context_line":"                        sample_rate\u003d0.9912)"},{"line_number":5744,"context_line":""},{"line_number":5745,"context_line":"    def test_delegate_methods_with_labels_and_prefix_disabled(self):"},{"line_number":5746,"context_line":"        loggers \u003d ["},{"line_number":5747,"context_line":"            utils.get_logger({"},{"line_number":5748,"context_line":"                \u0027log_statsd_host\u0027: \u0027localhost\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"b59125cc_efef408e","line":5745,"in_reply_to":"5ba795f6_6ea922a3","updated":"2024-02-23 15:59:39.000000000","message":"Updated the patch","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ff3be5e397da876afc37db5f8e895e7e70e55734","unresolved":true,"context_lines":[{"line_number":5756,"context_line":"                \u0027log_statsd_port\u0027: str(self.port),"},{"line_number":5757,"context_line":"                \u0027log_statsd_metric_prefix\u0027: \u0027my_prefix\u0027,"},{"line_number":5758,"context_line":"                \u0027log_statsd_label_mode\u0027: \u0027disabled\u0027,"},{"line_number":5759,"context_line":"                \u0027log_statsd_emit_legacy\u0027: \u0027false\u0027,"},{"line_number":5760,"context_line":"            }, \u0027pfx\u0027),"},{"line_number":5761,"context_line":"            utils.get_logger({"},{"line_number":5762,"context_line":"                \u0027log_statsd_host\u0027: \u0027localhost\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"536868f7_21027aa2","line":5759,"updated":"2024-02-22 16:04:46.000000000","message":"to me the behavior of this configuraiton is surprising - we assert it\u0027s the same as not setting the value, but also below we configure the behavior setting it to true - it looks like this option has no effect\n\n... which I guess it doesn\u0027t when log_statsd_lable_mode \u003d\u003d \u0027disabled\u0027 - but that\u0027s kind of surprising; seems like a big gatcha for ops.","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":true,"context_lines":[{"line_number":5756,"context_line":"                \u0027log_statsd_port\u0027: str(self.port),"},{"line_number":5757,"context_line":"                \u0027log_statsd_metric_prefix\u0027: \u0027my_prefix\u0027,"},{"line_number":5758,"context_line":"                \u0027log_statsd_label_mode\u0027: \u0027disabled\u0027,"},{"line_number":5759,"context_line":"                \u0027log_statsd_emit_legacy\u0027: \u0027false\u0027,"},{"line_number":5760,"context_line":"            }, \u0027pfx\u0027),"},{"line_number":5761,"context_line":"            utils.get_logger({"},{"line_number":5762,"context_line":"                \u0027log_statsd_host\u0027: \u0027localhost\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"5ad3d283_07625b55","line":5759,"in_reply_to":"19491e1b_cde865bb","updated":"2024-03-14 19:39:51.000000000","message":"I feel like this diff:\n\n    diff --git a/swift/common/utils/__init__.py b/swift/common/utils/__init__.py\n    index 8b7b14501..0e3c8d855 100644\n    --- a/swift/common/utils/__init__.py\n    +++ b/swift/common/utils/__init__.py\n    @@ -1389,6 +1389,8 @@ class ParsedStatsdClientConfig(object):\n                 \u0027log_statsd_label_mode\u0027, LabelModes.DISABLED.value).lower()\n             self.emit_legacy \u003d config_true_value(conf.get(\n                 \u0027log_statsd_emit_legacy\u0027, \u0027true\u0027))\n    +        if not self.emit_legacy:\n    +            raise Exception(\u0027untested?\u0027)\n     \n             try:\n                 self.label_mode \u003d LabelModes(label_mode)\n\n\nshould cause some test_utils tests to blow up - but I think on the latest patch it does not?","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"b88b14f58de391e903bd8cb3bbc903924ac45ce2","unresolved":true,"context_lines":[{"line_number":5756,"context_line":"                \u0027log_statsd_port\u0027: str(self.port),"},{"line_number":5757,"context_line":"                \u0027log_statsd_metric_prefix\u0027: \u0027my_prefix\u0027,"},{"line_number":5758,"context_line":"                \u0027log_statsd_label_mode\u0027: \u0027disabled\u0027,"},{"line_number":5759,"context_line":"                \u0027log_statsd_emit_legacy\u0027: \u0027false\u0027,"},{"line_number":5760,"context_line":"            }, \u0027pfx\u0027),"},{"line_number":5761,"context_line":"            utils.get_logger({"},{"line_number":5762,"context_line":"                \u0027log_statsd_host\u0027: \u0027localhost\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"19491e1b_cde865bb","line":5759,"in_reply_to":"536868f7_21027aa2","updated":"2024-02-23 15:59:39.000000000","message":"Updating this parameter","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"bdfc1334e9e68c8277f5552478f9550ffbee36f5","unresolved":true,"context_lines":[{"line_number":5756,"context_line":"                \u0027log_statsd_port\u0027: str(self.port),"},{"line_number":5757,"context_line":"                \u0027log_statsd_metric_prefix\u0027: \u0027my_prefix\u0027,"},{"line_number":5758,"context_line":"                \u0027log_statsd_label_mode\u0027: \u0027disabled\u0027,"},{"line_number":5759,"context_line":"                \u0027log_statsd_emit_legacy\u0027: \u0027false\u0027,"},{"line_number":5760,"context_line":"            }, \u0027pfx\u0027),"},{"line_number":5761,"context_line":"            utils.get_logger({"},{"line_number":5762,"context_line":"                \u0027log_statsd_host\u0027: \u0027localhost\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"d8865082_ee560470","line":5759,"in_reply_to":"5ad3d283_07625b55","updated":"2024-03-22 17:06:51.000000000","message":"In previous version of this patch there was a unit test for this, although it requires changing existing test utils. Should try add that back","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"50170394e9a2eab07d7c82825159949e3f510ddd","unresolved":false,"context_lines":[{"line_number":5756,"context_line":"                \u0027log_statsd_port\u0027: str(self.port),"},{"line_number":5757,"context_line":"                \u0027log_statsd_metric_prefix\u0027: \u0027my_prefix\u0027,"},{"line_number":5758,"context_line":"                \u0027log_statsd_label_mode\u0027: \u0027disabled\u0027,"},{"line_number":5759,"context_line":"                \u0027log_statsd_emit_legacy\u0027: \u0027false\u0027,"},{"line_number":5760,"context_line":"            }, \u0027pfx\u0027),"},{"line_number":5761,"context_line":"            utils.get_logger({"},{"line_number":5762,"context_line":"                \u0027log_statsd_host\u0027: \u0027localhost\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"2c5b9e62_4cef6669","line":5759,"in_reply_to":"d8865082_ee560470","updated":"2024-03-22 19:59:56.000000000","message":"Acknowledged","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ff3be5e397da876afc37db5f8e895e7e70e55734","unresolved":true,"context_lines":[{"line_number":5784,"context_line":"            # Any labeled-metrics callers should not emit any metrics"},{"line_number":5785,"context_line":"            self.assertStat([], #\u0027my_prefix.pfx.some.counter:1|c\u0027,"},{"line_number":5786,"context_line":"                            self.logger.increment, *inc_dec_args, labels\u003dlabels)"},{"line_number":5787,"context_line":"                            #legacy_format\u003d\u0027{action}.counter\u0027"},{"line_number":5788,"context_line":"            self.assertStat([], #\u0027my_prefix.pfx.some.counter:-1|c\u0027,"},{"line_number":5789,"context_line":"                            self.logger.decrement, *inc_dec_args, labels\u003dlabels)"},{"line_number":5790,"context_line":"                            #legacy_format\u003d\u0027{action}.counter\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"d9d5fc26_243e77c9","line":5787,"updated":"2024-02-22 16:04:46.000000000","message":"not sure why empty list a better expected value than None\n\nstill annoyed by the commented code","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"b88b14f58de391e903bd8cb3bbc903924ac45ce2","unresolved":false,"context_lines":[{"line_number":5784,"context_line":"            # Any labeled-metrics callers should not emit any metrics"},{"line_number":5785,"context_line":"            self.assertStat([], #\u0027my_prefix.pfx.some.counter:1|c\u0027,"},{"line_number":5786,"context_line":"                            self.logger.increment, *inc_dec_args, labels\u003dlabels)"},{"line_number":5787,"context_line":"                            #legacy_format\u003d\u0027{action}.counter\u0027"},{"line_number":5788,"context_line":"            self.assertStat([], #\u0027my_prefix.pfx.some.counter:-1|c\u0027,"},{"line_number":5789,"context_line":"                            self.logger.decrement, *inc_dec_args, labels\u003dlabels)"},{"line_number":5790,"context_line":"                            #legacy_format\u003d\u0027{action}.counter\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"d2218ae6_b74fc4a9","line":5787,"in_reply_to":"d9d5fc26_243e77c9","updated":"2024-02-23 15:59:39.000000000","message":"Updated the patch","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":true,"context_lines":[{"line_number":5824,"context_line":"        labels_update_args \u003d (\u0027the_stat\u0027, 3)"},{"line_number":5825,"context_line":"        labels \u003d {\u0027action\u0027: \u0027some\u0027, \u0027result\u0027: \u0027ok\u0027}"},{"line_number":5826,"context_line":"        self.assertStat("},{"line_number":5827,"context_line":"            \u0027my_prefix_the_counter;action\u003dsome;log_name\u003dpfx;result\u003dok:1|c\u0027,"},{"line_number":5828,"context_line":"            self.logger.increment, *labels_inc_dec_args, labels\u003dlabels)"},{"line_number":5829,"context_line":"        self.assertStat("},{"line_number":5830,"context_line":"            \u0027my_prefix_the_counter;action\u003dsome;log_name\u003dpfx;result\u003dok:-1|c\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"6e7b66df_868159ca","line":5827,"updated":"2024-03-14 19:39:51.000000000","message":"I\u0027m skeptical that the existing log_statsd_metric_prefix option should apply to new labeled metric names; but I could easily be convinced if ops says they *need* to be able to configure it in swift.\n\ncurrently the only use-case I see in our production configs is subrequest/internal; which in labeled metrics would be better handled by userlabel.\n\nIf ops *does* need to mutate the emited metric *names* in some way (beyond sub-deviding multiple instances of the same metric coming from different deamons/middlewares) they can probably use an exporter/collector mapping file.","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"bdfc1334e9e68c8277f5552478f9550ffbee36f5","unresolved":false,"context_lines":[{"line_number":5824,"context_line":"        labels_update_args \u003d (\u0027the_stat\u0027, 3)"},{"line_number":5825,"context_line":"        labels \u003d {\u0027action\u0027: \u0027some\u0027, \u0027result\u0027: \u0027ok\u0027}"},{"line_number":5826,"context_line":"        self.assertStat("},{"line_number":5827,"context_line":"            \u0027my_prefix_the_counter;action\u003dsome;log_name\u003dpfx;result\u003dok:1|c\u0027,"},{"line_number":5828,"context_line":"            self.logger.increment, *labels_inc_dec_args, labels\u003dlabels)"},{"line_number":5829,"context_line":"        self.assertStat("},{"line_number":5830,"context_line":"            \u0027my_prefix_the_counter;action\u003dsome;log_name\u003dpfx;result\u003dok:-1|c\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"c099c21c_95629119","line":5827,"in_reply_to":"6e7b66df_868159ca","updated":"2024-03-22 17:06:51.000000000","message":"Acknowledged","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":true,"context_lines":[{"line_number":5909,"context_line":"        self.logger \u003d utils.get_logger({"},{"line_number":5910,"context_line":"            \u0027log_statsd_host\u0027: \u0027localhost\u0027,"},{"line_number":5911,"context_line":"            \u0027log_statsd_port\u0027: str(self.port),"},{"line_number":5912,"context_line":"            \u0027log_statsd_metric_prefix\u0027: \u0027my_prefix\u0027,"},{"line_number":5913,"context_line":"            \u0027log_statsd_label_mode\u0027: \u0027signalfx\u0027,"},{"line_number":5914,"context_line":"            \u0027log_statsd_emit_legacy\u0027: \u0027true\u0027,"},{"line_number":5915,"context_line":"        }, \u0027pfx\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"67e63a63_3615f629","line":5912,"updated":"2024-03-14 19:39:51.000000000","message":"since this option is optional/off-by-default it might be nice to have *some* tests that exercise the new labels format without it.","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"bdfc1334e9e68c8277f5552478f9550ffbee36f5","unresolved":false,"context_lines":[{"line_number":5909,"context_line":"        self.logger \u003d utils.get_logger({"},{"line_number":5910,"context_line":"            \u0027log_statsd_host\u0027: \u0027localhost\u0027,"},{"line_number":5911,"context_line":"            \u0027log_statsd_port\u0027: str(self.port),"},{"line_number":5912,"context_line":"            \u0027log_statsd_metric_prefix\u0027: \u0027my_prefix\u0027,"},{"line_number":5913,"context_line":"            \u0027log_statsd_label_mode\u0027: \u0027signalfx\u0027,"},{"line_number":5914,"context_line":"            \u0027log_statsd_emit_legacy\u0027: \u0027true\u0027,"},{"line_number":5915,"context_line":"        }, \u0027pfx\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"339885e3_4bf7b28e","line":5912,"in_reply_to":"67e63a63_3615f629","updated":"2024-03-22 17:06:51.000000000","message":"Acknowledged","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":true,"context_lines":[{"line_number":5912,"context_line":"            \u0027log_statsd_metric_prefix\u0027: \u0027my_prefix\u0027,"},{"line_number":5913,"context_line":"            \u0027log_statsd_label_mode\u0027: \u0027signalfx\u0027,"},{"line_number":5914,"context_line":"            \u0027log_statsd_emit_legacy\u0027: \u0027true\u0027,"},{"line_number":5915,"context_line":"        }, \u0027pfx\u0027)"},{"line_number":5916,"context_line":"        self.assertStat(\u0027my_prefix.pfx.some.counter:1|c\u0027,"},{"line_number":5917,"context_line":"                        self.logger.increment, \u0027some.counter\u0027)"},{"line_number":5918,"context_line":"        self.assertStat(\u0027my_prefix.pfx.some.counter:-1|c\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"a0a2b7be_1d61480a","line":5915,"updated":"2024-03-14 19:39:51.000000000","message":"having the tail be named pfx and show up as a log_name label is mind-warping; i\u0027m thankful we have these tests to demonstrate this behavior or else I might not be able to understand what the config options and code is doing at all.","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"bdfc1334e9e68c8277f5552478f9550ffbee36f5","unresolved":false,"context_lines":[{"line_number":5912,"context_line":"            \u0027log_statsd_metric_prefix\u0027: \u0027my_prefix\u0027,"},{"line_number":5913,"context_line":"            \u0027log_statsd_label_mode\u0027: \u0027signalfx\u0027,"},{"line_number":5914,"context_line":"            \u0027log_statsd_emit_legacy\u0027: \u0027true\u0027,"},{"line_number":5915,"context_line":"        }, \u0027pfx\u0027)"},{"line_number":5916,"context_line":"        self.assertStat(\u0027my_prefix.pfx.some.counter:1|c\u0027,"},{"line_number":5917,"context_line":"                        self.logger.increment, \u0027some.counter\u0027)"},{"line_number":5918,"context_line":"        self.assertStat(\u0027my_prefix.pfx.some.counter:-1|c\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"3b19d530_cb406638","line":5915,"in_reply_to":"a0a2b7be_1d61480a","updated":"2024-03-22 17:06:51.000000000","message":"Acknowledged","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"}],"test/unit/proxy/test_server.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ff3be5e397da876afc37db5f8e895e7e70e55734","unresolved":true,"context_lines":[{"line_number":2351,"context_line":"        mock_statsd.assert_called_once_with("},{"line_number":2352,"context_line":"            \u0027example.com\u0027, 8125, \u0027\u0027, \u0027proxy-server\u0027, 1.0, 1.0,"},{"line_number":2353,"context_line":"            logger\u003dapp.logger.logger, label_mode\u003d\u0027disabled\u0027,"},{"line_number":2354,"context_line":"            emit_legacy\u003dFalse)"},{"line_number":2355,"context_line":""},{"line_number":2356,"context_line":""},{"line_number":2357,"context_line":"class TestProxyServerConfigStringLoading(TestProxyServerConfigLoading):"}],"source_content_type":"text/x-python","patch_set":1,"id":"79cc39db_85d4a280","line":2354,"updated":"2024-02-22 16:04:46.000000000","message":"since we have to change the StatsdClient signature anyway; maybe it would make more sense just to pass it the whole \"conf\" and let it parse out the values it wants instead of having the LogAdapter parse them and pass them in as kwargs.","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"b88b14f58de391e903bd8cb3bbc903924ac45ce2","unresolved":false,"context_lines":[{"line_number":2351,"context_line":"        mock_statsd.assert_called_once_with("},{"line_number":2352,"context_line":"            \u0027example.com\u0027, 8125, \u0027\u0027, \u0027proxy-server\u0027, 1.0, 1.0,"},{"line_number":2353,"context_line":"            logger\u003dapp.logger.logger, label_mode\u003d\u0027disabled\u0027,"},{"line_number":2354,"context_line":"            emit_legacy\u003dFalse)"},{"line_number":2355,"context_line":""},{"line_number":2356,"context_line":""},{"line_number":2357,"context_line":"class TestProxyServerConfigStringLoading(TestProxyServerConfigLoading):"}],"source_content_type":"text/x-python","patch_set":1,"id":"128bcdb0_b4cd5c13","line":2354,"in_reply_to":"79cc39db_85d4a280","updated":"2024-02-23 15:59:39.000000000","message":"Acknowledged","commit_id":"fd51b09fbccff64d5e20982881a5b6c697560fbe"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":true,"context_lines":[{"line_number":2303,"context_line":"        pconf.port \u003d 8125"},{"line_number":2304,"context_line":"        pconf.tail_prefix \u003d \u0027proxy-server\u0027"},{"line_number":2305,"context_line":"        mock_statsd.assert_called_once_with("},{"line_number":2306,"context_line":"            pconf,"},{"line_number":2307,"context_line":"            logger\u003dapp.logger.logger)"},{"line_number":2308,"context_line":""},{"line_number":2309,"context_line":"        conf_sections \u003d \"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"535a52c6_7a535f53","line":2306,"updated":"2024-03-14 19:39:51.000000000","message":"oic, this will trigger equality comparision; yuk\n\nI think ideally we\u0027d just mock `swift.common.utils.get_statsd_client` - and then assert it\u0027s `conf` argument\u0027s `[\u0027log_statsd_host\u0027]` value was \u0027example.com\u0027","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"bdfc1334e9e68c8277f5552478f9550ffbee36f5","unresolved":false,"context_lines":[{"line_number":2303,"context_line":"        pconf.port \u003d 8125"},{"line_number":2304,"context_line":"        pconf.tail_prefix \u003d \u0027proxy-server\u0027"},{"line_number":2305,"context_line":"        mock_statsd.assert_called_once_with("},{"line_number":2306,"context_line":"            pconf,"},{"line_number":2307,"context_line":"            logger\u003dapp.logger.logger)"},{"line_number":2308,"context_line":""},{"line_number":2309,"context_line":"        conf_sections \u003d \"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"1f92449f_cda14b92","line":2306,"in_reply_to":"535a52c6_7a535f53","updated":"2024-03-22 17:06:51.000000000","message":"Acknowledged","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f13fbf230154021dee46ee0efddac55dfefec27c","unresolved":true,"context_lines":[{"line_number":2368,"context_line":"            \u0027anotherlabel\u0027: \u0027anothervalue\u0027}"},{"line_number":2369,"context_line":"        mock_statsd.assert_called_once_with("},{"line_number":2370,"context_line":"            pconf,"},{"line_number":2371,"context_line":"            logger\u003dapp.logger.logger)"},{"line_number":2372,"context_line":""},{"line_number":2373,"context_line":""},{"line_number":2374,"context_line":"class TestProxyServerConfigStringLoading(TestProxyServerConfigLoading):"}],"source_content_type":"text/x-python","patch_set":5,"id":"7544e9eb_c03e7cbc","line":2371,"updated":"2024-03-14 19:39:51.000000000","message":"I like what this test is doing - i\u0027m not sure it belongs in proxy.test_server\n\nI think at this point the test shouldn\u0027t bother mocking StatsdClient and should rather just let it get created (we let real LoggerAdapter objects get created) and then assert the `app.logger.statsd_client` object\u0027s attributes are correct.\n\nAlso, I think this might be the *only* place that tests userlabel - I think that since this is a \"base API; doesn\u0027t change any callers\" we might not expect ANY new tests in test.proxy_server and we almost certainly would prefer the tests that assert the base behaviors of the API/config to be part of the tests for the module that implements StatsdClient (i.e. test.unit.common.test_statsd_client eventually)","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"bdfc1334e9e68c8277f5552478f9550ffbee36f5","unresolved":false,"context_lines":[{"line_number":2368,"context_line":"            \u0027anotherlabel\u0027: \u0027anothervalue\u0027}"},{"line_number":2369,"context_line":"        mock_statsd.assert_called_once_with("},{"line_number":2370,"context_line":"            pconf,"},{"line_number":2371,"context_line":"            logger\u003dapp.logger.logger)"},{"line_number":2372,"context_line":""},{"line_number":2373,"context_line":""},{"line_number":2374,"context_line":"class TestProxyServerConfigStringLoading(TestProxyServerConfigLoading):"}],"source_content_type":"text/x-python","patch_set":5,"id":"c8428116_f74de4da","line":2371,"in_reply_to":"7544e9eb_c03e7cbc","updated":"2024-03-22 17:06:51.000000000","message":"Acknowledged","commit_id":"08365edbdc6b4fc81b598eb51eee2af51640f535"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"4a5d69443a658c97f8dc12b57814767548d767e9","unresolved":true,"context_lines":[{"line_number":2303,"context_line":"        # logger name is hard-wired \u0027proxy-server\u0027"},{"line_number":2304,"context_line":"        self.assertEqual(\u0027proxy-server\u0027, app.logger.name)"},{"line_number":2305,"context_line":"        self.assertEqual(\u0027swift\u0027, app.logger.server)"},{"line_number":2306,"context_line":"        self.assertEqual(app.logger.logger.statsd_client.conf.host,"},{"line_number":2307,"context_line":"                         \u0027example.com\u0027)"},{"line_number":2308,"context_line":"        self.assertEqual(app.logger.logger.statsd_client.conf.port,"},{"line_number":2309,"context_line":"                         8125)"}],"source_content_type":"text/x-python","patch_set":8,"id":"7411e823_457d14ae","line":2306,"range":{"start_line":2306,"start_character":43,"end_line":2306,"end_character":61},"updated":"2024-03-26 19:25:55.000000000","message":"Wouldn\u0027t it be more realistic to just drop in `StatsdClientConf` as the fake? A real, running proxy-server app wouldn\u0027t have `app.logger.logger.statsd_client.conf.host`, but rather `app.logger.logger.statsd_client.host`","commit_id":"1e67567fda21b3f1197765b0f5963e6f3f3d4bc0"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"79ca9dcffb3129da088dec924c2466b33c25710b","unresolved":false,"context_lines":[{"line_number":2303,"context_line":"        # logger name is hard-wired \u0027proxy-server\u0027"},{"line_number":2304,"context_line":"        self.assertEqual(\u0027proxy-server\u0027, app.logger.name)"},{"line_number":2305,"context_line":"        self.assertEqual(\u0027swift\u0027, app.logger.server)"},{"line_number":2306,"context_line":"        self.assertEqual(app.logger.logger.statsd_client.conf.host,"},{"line_number":2307,"context_line":"                         \u0027example.com\u0027)"},{"line_number":2308,"context_line":"        self.assertEqual(app.logger.logger.statsd_client.conf.port,"},{"line_number":2309,"context_line":"                         8125)"}],"source_content_type":"text/x-python","patch_set":8,"id":"4ef00f1d_218555dd","line":2306,"range":{"start_line":2306,"start_character":43,"end_line":2306,"end_character":61},"in_reply_to":"7411e823_457d14ae","updated":"2024-04-05 15:33:20.000000000","message":"Acknowledged","commit_id":"1e67567fda21b3f1197765b0f5963e6f3f3d4bc0"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"11e44436167bd0af814619080ea7811c1533ae9f","unresolved":true,"context_lines":[{"line_number":2385,"context_line":"            app.logger.logger.statsd_client.default_labels, {"},{"line_number":2386,"context_line":"                \u0027user_somelabel\u0027: \u0027some_value\u0027,"},{"line_number":2387,"context_line":"                \u0027user_otherlabel\u0027: \u0027other_value\u0027,"},{"line_number":2388,"context_line":"                \u0027user_anotherlabel\u0027: \u0027another_value\u0027})"},{"line_number":2389,"context_line":""},{"line_number":2390,"context_line":""},{"line_number":2391,"context_line":"class TestProxyServerConfigStringLoading(TestProxyServerConfigLoading):"}],"source_content_type":"text/x-python","patch_set":22,"id":"299c7a55_6cbfdf84","line":2388,"updated":"2024-06-25 18:40:03.000000000","message":"this is a fairly large test file - these assertions don\u0027t seem particularlly proxy-server specific...\n\nit might be more interesting if the application pipeline included some mw\u0027s with various statsd configurations...","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"ec8ecaccd38283b3be5deaedfb4ac65db7dcdc88","unresolved":false,"context_lines":[{"line_number":2385,"context_line":"            app.logger.logger.statsd_client.default_labels, {"},{"line_number":2386,"context_line":"                \u0027user_somelabel\u0027: \u0027some_value\u0027,"},{"line_number":2387,"context_line":"                \u0027user_otherlabel\u0027: \u0027other_value\u0027,"},{"line_number":2388,"context_line":"                \u0027user_anotherlabel\u0027: \u0027another_value\u0027})"},{"line_number":2389,"context_line":""},{"line_number":2390,"context_line":""},{"line_number":2391,"context_line":"class TestProxyServerConfigStringLoading(TestProxyServerConfigLoading):"}],"source_content_type":"text/x-python","patch_set":22,"id":"9be9efb3_fee4fb76","line":2388,"in_reply_to":"299c7a55_6cbfdf84","updated":"2024-07-11 16:22:43.000000000","message":"Acknowledged","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"11e44436167bd0af814619080ea7811c1533ae9f","unresolved":true,"context_lines":[{"line_number":4371,"context_line":"                resp \u003d req.get_response(self.app)"},{"line_number":4372,"context_line":""},{"line_number":4373,"context_line":"            self.assertEqual(resp.status_int, 202)"},{"line_number":4374,"context_line":"            stats \u003d self.app.logger.logger.statsd_client.get_increment_counts()"},{"line_number":4375,"context_line":"            self.assertEqual("},{"line_number":4376,"context_line":"                {\u0027account.info.cache.disabled.200\u0027: 1,"},{"line_number":4377,"context_line":"                 \u0027account.info.infocache.hit\u0027: 2,"}],"source_content_type":"text/x-python","patch_set":22,"id":"3edcd330_299e8ec7","line":4374,"updated":"2024-06-25 18:40:03.000000000","message":"that\u0027s funny; this seems to be going the other direction from tests...\n\ntests seem to pass w/o this change - maybe consider reverting depending on which directoin you think would be more consistent.","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"a0a734b73158987742caf8c9a22a24a947c1df42","unresolved":false,"context_lines":[{"line_number":4371,"context_line":"                resp \u003d req.get_response(self.app)"},{"line_number":4372,"context_line":""},{"line_number":4373,"context_line":"            self.assertEqual(resp.status_int, 202)"},{"line_number":4374,"context_line":"            stats \u003d self.app.logger.logger.statsd_client.get_increment_counts()"},{"line_number":4375,"context_line":"            self.assertEqual("},{"line_number":4376,"context_line":"                {\u0027account.info.cache.disabled.200\u0027: 1,"},{"line_number":4377,"context_line":"                 \u0027account.info.infocache.hit\u0027: 2,"}],"source_content_type":"text/x-python","patch_set":22,"id":"83f5bc2c_ce3112db","line":4374,"in_reply_to":"3edcd330_299e8ec7","updated":"2024-07-02 15:34:51.000000000","message":"Acknowledged","commit_id":"e2217f43ea43179d3edd0e513ac669c62a613865"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"af4b06b9cc4a236ac9c5953e16b64e288317e7b8","unresolved":true,"context_lines":[{"line_number":5686,"context_line":"                    ])"},{"line_number":5687,"context_line":"                stats \u003d ("},{"line_number":5688,"context_line":"                    self.app.logger.statsd_client.get_increment_counts()"},{"line_number":5689,"context_line":"                )"},{"line_number":5690,"context_line":"                self.assertEqual(2, stats.get(\u0027error_limiter.is_limited\u0027, 0))"},{"line_number":5691,"context_line":"                self.assertEqual(2, stats.get(\u0027object.handoff_count\u0027, 0))"},{"line_number":5692,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"c4c85fa5_15692bbb","line":5689,"updated":"2024-08-05 12:50:21.000000000","message":"unnecessary change?","commit_id":"d561dd39936fe17009f2eeb834e2b6599ffa0dfb"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"5a4ec86f9501e46cd834db332031f2027a15c924","unresolved":false,"context_lines":[{"line_number":5686,"context_line":"                    ])"},{"line_number":5687,"context_line":"                stats \u003d ("},{"line_number":5688,"context_line":"                    self.app.logger.statsd_client.get_increment_counts()"},{"line_number":5689,"context_line":"                )"},{"line_number":5690,"context_line":"                self.assertEqual(2, stats.get(\u0027error_limiter.is_limited\u0027, 0))"},{"line_number":5691,"context_line":"                self.assertEqual(2, stats.get(\u0027object.handoff_count\u0027, 0))"},{"line_number":5692,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"8eb5bf60_bda8c39a","line":5689,"in_reply_to":"c4c85fa5_15692bbb","updated":"2024-09-05 15:33:20.000000000","message":"Acknowledged","commit_id":"d561dd39936fe17009f2eeb834e2b6599ffa0dfb"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"af4b06b9cc4a236ac9c5953e16b64e288317e7b8","unresolved":true,"context_lines":[{"line_number":5716,"context_line":"                    ])"},{"line_number":5717,"context_line":"                stats \u003d ("},{"line_number":5718,"context_line":"                    self.app.logger.statsd_client.get_increment_counts()"},{"line_number":5719,"context_line":"                )"},{"line_number":5720,"context_line":"                self.assertEqual(4, stats.get(\u0027error_limiter.is_limited\u0027, 0))"},{"line_number":5721,"context_line":"                self.assertEqual(4, stats.get(\u0027object.handoff_count\u0027, 0))"},{"line_number":5722,"context_line":"                self.assertEqual(1, stats.get(\u0027object.handoff_all_count\u0027, 0))"}],"source_content_type":"text/x-python","patch_set":33,"id":"ccf4684e_d060c739","line":5719,"updated":"2024-08-05 12:50:21.000000000","message":"ditto","commit_id":"d561dd39936fe17009f2eeb834e2b6599ffa0dfb"},{"author":{"_account_id":36606,"name":"Yan Xiao","display_name":"Yan","email":"yanxiao@nvidia.com","username":"yanxiao"},"change_message_id":"5a4ec86f9501e46cd834db332031f2027a15c924","unresolved":false,"context_lines":[{"line_number":5716,"context_line":"                    ])"},{"line_number":5717,"context_line":"                stats \u003d ("},{"line_number":5718,"context_line":"                    self.app.logger.statsd_client.get_increment_counts()"},{"line_number":5719,"context_line":"                )"},{"line_number":5720,"context_line":"                self.assertEqual(4, stats.get(\u0027error_limiter.is_limited\u0027, 0))"},{"line_number":5721,"context_line":"                self.assertEqual(4, stats.get(\u0027object.handoff_count\u0027, 0))"},{"line_number":5722,"context_line":"                self.assertEqual(1, stats.get(\u0027object.handoff_all_count\u0027, 0))"}],"source_content_type":"text/x-python","patch_set":33,"id":"a2a64854_da6f811f","line":5719,"in_reply_to":"ccf4684e_d060c739","updated":"2024-09-05 15:33:20.000000000","message":"Acknowledged","commit_id":"d561dd39936fe17009f2eeb834e2b6599ffa0dfb"}]}
