Closed ghost closed 4 years ago
That’s a very nice addition, I’ll need some time to review it. If anyone else want to review it they are welcome to as well.
Thank you for your consideration. I've updated the README to complete the patch for review.
Why
What
This patch brings tag support to metrology. Each metric can have multiple tags associated with it and metrics with the same name but different tags are distinct from one another.
All public method signatures are backwards compatible. This is achieved by reusing the name parameter in that it can now be a string as previously or a dict containing the name and tags. I've implemented an alternate version where tags are an optional parameter but didn't like the overall look of this (https://github.com/sv-fko/metrology/tree/tag_support)
This is what it looks like in code:
Reporter implementations can optin to the tag support by consuming the with_tags property of the registry while old reporters can still just use the iterator on the registry itself which just returns name and value like previously.
Drive-by changes
Open issues
Please let me know what you think. If you would be willing to merge this, I'd update the docs.