Skip to content

feat(attributes): Add sentry.metric.source#476

Merged
klochek merged 1 commit into
mainfrom
christopherklochek/metric_provenance
Jul 9, 2026
Merged

feat(attributes): Add sentry.metric.source#476
klochek merged 1 commit into
mainfrom
christopherklochek/metric_provenance

Conversation

@klochek

@klochek klochek commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Description

This is an attribute that can be used to attribute the source of a metric; for example, Relay can use it to indicate that a metric originated from an ingested span.

PR Checklist

  • [*] I have run yarn test and verified that the tests pass.
  • [*] I have run yarn generate to generate and format code and docs.
  • [*] The attribute is in a namespace (e.g. nextjs.function_id, not function_id)
  • [*] I have used the correct value for apply_scrubbing (i.e. manual or auto. Use never only for values that should never be scrubbed such as IDs)

This is an attribute that can be used to attribute the source of a metric; for example, Relay can use it to indicate that a metric originated from an ingested span.
@klochek
klochek requested review from a team, Lms24, cleptric, mjq and nsdeschenes as code owners July 9, 2026 18:06
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

Attributes

  • Add sentry.metric.source by klochek in #476
  • Add faas.id (deprecated) in favor of cloud.resource_id by andreiborza in #475
  • Add faas.execution (deprecated) in favor of faas.invocation_id by andreiborza in #473
  • Add messaging attributes by s1gr1d in #469
  • Add url.same_origin (deprecated) and http.request.same_origin (replacement) attributes by Lms24 in #456
  • Add db.response.status_code by s1gr1d in #462

Other

  • (ai) Add granular cost attributes for cache and reasoning by vgrozdanic in #461

Internal Changes 🔧

  • (ci) Stop inheriting secrets for changelog-preview by tobias-wilfert in #463

🤖 This preview updates automatically when you update the PR.

@Lms24 Lms24 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally no objections just a thought: Have we considered reusing sentry.origin?

The only thing that speaks a bit against sentry.metric.source is that there's sentry.span.source and it has a different meaning. Though we'll likely deprecate sentry.span.source anyway, so it's not too big a deal.

@klochek

klochek commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Generally no objections just a thought: Have we considered reusing sentry.origin?

The only thing that speaks a bit against sentry.metric.source is that there's sentry.span.source and it has a different meaning. Though we'll likely deprecate sentry.span.source anyway, so it's not too big a deal.

For our (Relay's) purposes, we're passing through sentry.origin since it contains the originating web vital name, like "auto.http.browser.inp". Perhaps we could repurpose it on our end for the metric provenance, but I feel like it'd be safer not to.

@logaretm

logaretm commented Jul 9, 2026

Copy link
Copy Markdown
Member

While I don't exactly remember why we didn't consider re-using the origin initially, I think preserving it from the span origin could be desirable here, so a new attribute is needed to avoid having web vital spans with diverging origins. Does that make sense?

@Lms24 Lms24 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, thx for explaining!

@klochek
klochek merged commit 0d5ca17 into main Jul 9, 2026
17 checks passed
@klochek
klochek deleted the christopherklochek/metric_provenance branch July 9, 2026 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants