Skip to content

Metric tag values not working as expected #3037

Closed
@elramen

Description

@elramen

How do you use Sentry?

Sentry Saas (sentry.io)

Version

2

Steps to Reproduce

  1. 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.

  2. 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:

  • None: If tag value is None, the tag is attached to the metric but has no tag value.
  • List/Tuple: If tag value is a List or Tuple, the tag is attached to the metric and has all values specified in the List/Tuple.

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions