Skip to content

feat(core): Remove deprecated props from Span interface #10854

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 1 commit into from
Feb 29, 2024

Conversation

mydea
Copy link
Member

@mydea mydea commented Feb 29, 2024

Instead, in places we need it we cast to a SentrySpan which still has the things in place, for now.

With this, our span interface is almost the same as for otel spans - missing are only:

  • Aligning traceFlags - this has apparently been updated in OTEL to have type number only, which makes this a bit easier.
  • Aligning setStatus which has a different signature in OTEL.

I'll do these in follow ups!

The biggest work here was fixing tests - I tried to rewrite tests to do less mocking where possible, which IMHO should cover actual functionality better than before (e.g. in svelte).

@mydea mydea self-assigned this Feb 29, 2024
import { GLOBAL_OBJ } from '@sentry/utils';

import { captureEvent, getCurrentScope } from '../../src';
Copy link
Member Author

Choose a reason for hiding this comment

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

I actually fixed a bunch of tests along there way here we we used to import from the package itself (we are in core here), which lead to tests only running on the built output, which is a bit weird IMHO.

@@ -36,6 +37,7 @@ describe('registerErrorHandlers()', () => {
const client = new TestClient(options);
setCurrentClient(client);
client.init();
_resetErrorsInstrumented();
Copy link
Member Author

Choose a reason for hiding this comment

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

This apparently was not needed before because we imported this from the build output 🤔 now it should be more robust.

@mydea mydea force-pushed the fn/span-spanContext branch from eb10a77 to 411cd68 Compare February 29, 2024 09:23
Copy link
Contributor

github-actions bot commented Feb 29, 2024

size-limit report 📦

Path Size
@sentry/browser (incl. Tracing, Replay, Feedback) - Webpack (gzipped) 77.31 KB (+0.19% 🔺)
@sentry/browser (incl. Tracing, Replay) - Webpack (gzipped) 68.56 KB (+0.2% 🔺)
@sentry/browser (incl. Tracing, Replay with Canvas) - Webpack (gzipped) 72.47 KB (+0.19% 🔺)
@sentry/browser (incl. Tracing, Replay) - Webpack with treeshaking flags (gzipped) 62.11 KB (+0.22% 🔺)
@sentry/browser (incl. Tracing) - Webpack (gzipped) 32.79 KB (+0.42% 🔺)
@sentry/browser (incl. browserTracingIntegration) - Webpack (gzipped) 32.79 KB (+0.42% 🔺)
@sentry/browser (incl. Feedback) - Webpack (gzipped) 30.96 KB (+0.49% 🔺)
@sentry/browser (incl. sendFeedback) - Webpack (gzipped) 30.96 KB (+0.49% 🔺)
@sentry/browser - Webpack (gzipped) 22.24 KB (+0.66% 🔺)
@sentry/browser (incl. Tracing, Replay, Feedback) - ES6 CDN Bundle (gzipped) 75.72 KB (+0.2% 🔺)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (gzipped) 67.4 KB (+0.22% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (gzipped) 33.24 KB (+0.45% 🔺)
@sentry/browser - ES6 CDN Bundle (gzipped) 24.74 KB (+0.64% 🔺)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (minified & uncompressed) 210.99 KB (+0.12% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (minified & uncompressed) 99.71 KB (+0.26% 🔺)
@sentry/browser - ES6 CDN Bundle (minified & uncompressed) 73.97 KB (+0.45% 🔺)
@sentry/browser (incl. Tracing) - ES5 CDN Bundle (gzipped) 36.3 KB (+0.38% 🔺)
@sentry/react (incl. Tracing, Replay) - Webpack (gzipped) 68.83 KB (+0.19% 🔺)
@sentry/react - Webpack (gzipped) 22.27 KB (+0.66% 🔺)
@sentry/nextjs Client (incl. Tracing, Replay) - Webpack (gzipped) 85.31 KB (+0.16% 🔺)
@sentry/nextjs Client - Webpack (gzipped) 49.65 KB (+0.26% 🔺)
@sentry-internal/feedback - Webpack (gzipped) 17.04 KB (+0.07% 🔺)

@mydea mydea force-pushed the fn/span-spanContext branch 3 times, most recently from 6695f6b to bde49b1 Compare February 29, 2024 10:42
Instead, in places we need it we cast to a `SentrySpan` which still has the things in place, for now.
@mydea mydea force-pushed the fn/span-spanContext branch from bde49b1 to 4c13b0c Compare February 29, 2024 14:23
@mydea mydea merged commit 65d9150 into develop Feb 29, 2024
@mydea mydea deleted the fn/span-spanContext branch February 29, 2024 15:44
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