-
Notifications
You must be signed in to change notification settings - Fork 462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Metric tag values not working as expected #3037
Comments
After briefly looking into this, I think the None case is as expected, i.e. tags aren't meant to have no value. If this is correct, this could be solved by removing None from the tag value type hint to not confuse the user. Regarding the List and Tuple case, the behaviour seems to be a bug. |
After further investigation: Relay's implementation doesn't currently allow multi-valued tags for a single emission (i.e. List or Tuple as the tag value). However, this goes against what is written in the docs, the python implementation, and the metrics RFC. Therefore, it's probably a good idea to discuss which option we should go with to keep things consistent. @iambriccardo @jan-auer @mitsuhiko |
@elramen, have you opened an issue to document this behavior in Relay's repository yet? If this is a Relay problem, the issue should live in that repo, not in the sentry-python repo |
@szokeasaurusrex I haven't opened an issue in the relay repo. Not sure if it's a relay problem since it depends on what we want regarding this |
How do you use Sentry?
Sentry Saas (sentry.io)
Version
2
Steps to Reproduce
Setup the SDK and type sentry_sdk.metrics.X where X is gauge, increment, set, or distribution. Hover X to see Optional[MetricTags] as type for tags. Go to the definition of MetricTags to see its definition: Mapping[str, MetricTagValue]. Go to the definition of MetricTagValue to see that it's defined as a Union of many types, including None, List, and Tuple.
Send a metric using a tag value of type None, List, or Tuple, e.g., sentry_sdk.metrics.gauge("test", 1, tags={"mytag": None}).
Expected Result
Metric shows up in sentry.io dashboard with tags attached as follows:
Actual Result
None: tag isn't added.
List/Tuple: only the last value in the List/Tuple shows up as a value for the tag.
The text was updated successfully, but these errors were encountered: