8000 feat(core): Deprecate `Span.status` by Lms24 · Pull Request #10208 · getsentry/sentry-javascript · GitHub
[go: up one dir, main page]

Skip to content

feat(core): Deprecate Span.status #10208

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

Merged
merged 5 commits into from
Jan 17, 2024
Merged

Conversation

Lms24
Copy link
Member
@Lms24 Lms24 commented Jan 16, 2024

This PR deprecates the status field on the span interface as well as on the class. The replacements for this field are

  • span.setStatus to set or update a span status (this API exists on the Otel Span interface but the types don't align yet)
  • spanToJson to read the status

ref #10184

*
* @deprecated Use `.setStatus` to set or update and `spanToJSON()` to read the status.
*/
status?: string;
Copy link
Member Author

Choose a reason for hiding this comment

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

Had to re-declare status on the Span interface because it's inherited from SpanContext. I don't think we want to deprecate it there in v7 but tbh not sure.

Side note:
This is similar to #10189 where I realized I also didn't deprecate op on the Span interface because of this inheritance yet. I'll tackle this in a follow-up PR though.

Copy link
Member

Choose a reason for hiding this comment

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

yes, I think that's fine! I'd deprecate stuff on the Span interface directly and leave the span context alone, it will go away "automatically" when all methods that use it are gone in v8!

And yeah, if we missed some there let's just add it, may very well be! 😅

@Lms24 Lms24 requested review from mydea and AbhiPrasad January 16, 2024 17:10
Copy link
Contributor
github-actions bot commented Jan 16, 2024

size-limit report 📦

Path Size
@sentry/browser (incl. Tracing, Replay, Feedback) - Webpack (gzipped) 77.3 KB (+0.04% 🔺)
@sentry/browser (incl. Tracing, Replay) - Webpack (gzipped) 68.6 KB (+0.03% 🔺)
@sentry/browser (incl. Tracing, Replay) - Webpack with treeshaking flags (gzipped) 62.25 KB (+0.03% 🔺)
@sentry/browser (incl. Tracing) - Webpack (gzipped) 32.63 KB (+0.04% 🔺)
@sentry/browser (incl. Feedback) - Webpack (gzipped) 31.13 KB (+0.01% 🔺)
@sentry/browser - Webpack (gzipped) 22.48 KB (-0.02% 🔽)
@sentry/browser (incl. Tracing, Replay, Feedback) - ES6 CDN Bundle (gzipped) 74.96 KB (+0.1% 🔺)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (gzipped) 66.59 KB (+0.1% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (gzipped) 32.42 KB (+0.17% 🔺)
@sentry/browser - ES6 CDN Bundle (gzipped) 24.19 KB (+0.26% 🔺)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (minified & uncompressed) 209.7 KB (+0.07% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (minified & uncompressed) 97.75 KB (+0.14% 🔺)
@sentry/browser - ES6 CDN Bundle (minified & uncompressed) 72.34 KB (+0.15% 🔺)
@sentry/browser (incl. Tracing) - ES5 CDN Bundle (gzipped) 35.46 KB (+0.17% 🔺)
@sentry/react (incl. Tracing, Replay) - Webpack (gzipped) 68.99 KB (+0.02% 🔺)
@sentry/react - Webpack (gzipped) 22.52 KB (-0.02% 🔽)
@sentry/nextjs Client (incl. Tracing, Replay) - Webpack (gzipped) 85.62 KB (+0.02% 🔺)
@sentry/nextjs Client - Webpack (gzipped) 49.75 KB (+0.03% 🔺)
@sentry-internal/feedback - Webpack (gzipped) 17.11 KB (0%)

@Lms24 Lms24 force-pushed the lms/feat-core-deprecate-span-status branch from 1dd0b12 to 75f1cd8 Compare January 16, 2024 17:14
@Lms24 Lms24 force-pushed the lms/feat-core-deprecate-span-status branch from 75f1cd8 to c068724 Compare January 17, 2024 10:45
@Lms24 Lms24 merged commit 64ba9ec into develop Jan 17, 2024
@Lms24 Lms24 deleted the lms/feat-core-deprecate-span-status branch January 17, 2024 11:50
Lms24 added a commit that referenced this pull request Jan 18, 2024
As discovered during #10208, the `op` property of the `Span` interface
was still missing a deprecation because `Span` inherited it from
`SpanContext` which I missed.
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
0