Skip to content

feat: Mirror SDK-set tags to scope attributes - #23878

Closed
chargome wants to merge 1 commit into
developfrom
sync-sdk-tags-attributes
Closed

feat: Mirror SDK-set tags to scope attributes#23878
chargome wants to merge 1 commit into
developfrom
sync-sdk-tags-attributes

Conversation

@chargome

@chargome chargome commented Sep 1, 2026

Copy link
Copy Markdown
Member

Duplicates tags the SDK sets itself onto scope attributes, so they also reach logs, metrics and streamed spans.

Tags the SDK sets itself only reach error events. Setting the same
key as a scope attribute makes them available on logs, metrics and
streamed spans too, following the pattern established for the
nextjs turbopack tag in #20558.

Covers the turbopack tag on the nextjs client (server and edge
already did this), the react-router runtime tag, the aws-serverless
timeout tag and the vercel-ai tool error tags.

Tags written directly to event.tags are not covered, as the Event
type has no attributes field to mirror them into.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y4psoVcy916Mi8aZLPAF15
@chargome chargome self-assigned this Sep 1, 2026
@chargome

chargome commented Sep 1, 2026

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3988407. Configure here.

it('sets the runtime attribute to browser', () => {
reactRouterInit({});
expect(setAttribute).toHaveBeenCalledWith('runtime', 'browser');
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Feat PR lacks integration tests

Low Severity

This feat PR only adds unit tests that assert setAttribute was called. The project review rules ask feat PRs to include at least one integration or E2E test, and that tests cover the new behaviour on sent payloads. Several new call sites also have no coverage, so it is not verified that the mirrored attributes actually reach logs, metrics, or streamed spans. Flagged because that requirement is in the review rules file.

Additional Locations (1)
Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Reviewed by Cursor Bugbot for commit 3988407. Configure here.

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.57 kB - -
@sentry/browser - with treeshaking flags 26.94 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 26.83 kB - -
@sentry/browser (incl. Tracing) 48.87 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.88 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.8 kB - -
@sentry/browser (incl. Tracing, Replay) 88.36 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.76 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 93.05 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 106.02 kB - -
@sentry/browser (incl. Feedback) 46.06 kB - -
@sentry/browser (incl. sendFeedback) 33.64 kB - -
@sentry/browser (incl. FeedbackAsync) 38.74 kB - -
@sentry/browser (incl. Metrics) 29.52 kB - -
@sentry/browser (incl. Logs) 29.81 kB - -
@sentry/browser (incl. Metrics & Logs) 30.45 kB - -
@sentry/react 30.32 kB - -
@sentry/react (incl. Tracing) 51.08 kB - -
@sentry/vue 35.74 kB - -
@sentry/vue (incl. Tracing) 51.14 kB - -
@sentry/svelte 28.6 kB - -
CDN Bundle 30.36 kB - -
CDN Bundle (incl. Tracing) 49.52 kB - -
CDN Bundle (incl. Logs, Metrics) 32.59 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 51.43 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73.19 kB - -
CDN Bundle (incl. Tracing, Replay) 87.01 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.88 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 92.94 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 94.84 kB - -
CDN Bundle - uncompressed 89.97 kB - -
CDN Bundle (incl. Tracing) - uncompressed 147.58 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 96.27 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 153.27 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 225.43 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 267.07 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 272.75 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 280.77 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 286.44 kB - -
@sentry/nextjs (client) 53.7 kB +0.02% +7 B 🔺
@sentry/sveltekit (client) 49.3 kB - -
@sentry/core/server 40.74 kB - -
@sentry/core/browser 13.42 kB - -
@sentry/node 123.89 kB +0.03% +35 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 81.4 kB - -
@sentry/node - without tracing 88.2 kB +0.03% +22 B 🔺
@sentry/node - without channel injection 103.32 kB +0.04% +32 B 🔺
@sentry/aws-serverless 96.56 kB +0.03% +26 B 🔺
@sentry/cloudflare (withSentry) - minified 201.23 kB - -
@sentry/cloudflare (withSentry) 500.94 kB - -

View base workflow run

@Lms24

Lms24 commented Sep 1, 2026

Copy link
Copy Markdown
Member

hmm the issue with this is that attributes on scopes are also applied to logs and metrics. Which is a billing concern. I know I said this differently just a minute ago but maybe we just don't convert these tags to attributes. I don't see them as really necessary tbh. If they are necessary, we likely need to set them in span processing hook instead to omit it from logs and metrics

@chargome chargome closed this Sep 2, 2026
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.

2 participants