Skip to content
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

feat(opentelemetry): Stop looking at propagation context for span creation #14481

Merged
merged 5 commits into from
Dec 3, 2024

Conversation

mydea
Copy link
Member

@mydea mydea commented Nov 26, 2024

This PR changes the behavior of the OTEL-based Node SDK to ignore the propagation context when starting spans.

Previously, when you called startSpan and there was no incoming trace, we would ensure that the new span has the trace ID + span ID from the propagation context.

This has a few problems:

  1. Multiple parallel root spans will continue the same virtual trace, instead of having separate traces.
  2. This is really invalid in OTEL, as we have to provide a span ID and cannot really tell it to use a specific trace ID out of the box. Because of this, we had to add a bunch of special handling to ensure we can differentiate real and fake parent span IDs properly.

This PR fixes this by simply not looking at this anymore. For TWP and error marking the propagation context is still used as before, only for new spans is there a difference.

I also added docs explaining how trace propagation in node works now:

node-sdk-trace-propagation-3

@mydea mydea self-assigned this Nov 26, 2024
Copy link
Contributor

github-actions bot commented Nov 26, 2024

size-limit report 📦

Path Size % Change Change
@sentry/browser 23.12 KB +0.12% +27 B 🔺
@sentry/browser - with treeshaking flags 21.85 KB +0.07% +15 B 🔺
@sentry/browser (incl. Tracing) 35.51 KB +0.03% +8 B 🔺
@sentry/browser (incl. Tracing, Replay) 72.4 KB +0.02% +10 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 62.88 KB +0.02% +11 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 76.71 KB +0.02% +9 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 89.17 KB +0.01% +8 B 🔺
@sentry/browser (incl. Feedback) 39.86 KB +0.05% +17 B 🔺
@sentry/browser (incl. sendFeedback) 27.74 KB +0.07% +19 B 🔺
@sentry/browser (incl. FeedbackAsync) 32.55 KB +0.07% +20 B 🔺
@sentry/react 25.81 KB +0.06% +15 B 🔺
@sentry/react (incl. Tracing) 38.41 KB +0.02% +6 B 🔺
@sentry/vue 27.26 KB +0.05% +12 B 🔺
@sentry/vue (incl. Tracing) 37.31 KB +0.03% +10 B 🔺
@sentry/svelte 23.27 KB +0.08% +19 B 🔺
CDN Bundle 24.32 KB +0.02% +3 B 🔺
CDN Bundle (incl. Tracing) 37.21 KB +0.04% +13 B 🔺
CDN Bundle (incl. Tracing, Replay) 72.09 KB +0.02% +14 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 77.43 KB +0.02% +15 B 🔺
CDN Bundle - uncompressed 71.45 KB +0.01% +2 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 110.48 KB -0.03% -26 B 🔽
CDN Bundle (incl. Tracing, Replay) - uncompressed 223.55 KB -0.02% -26 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 236.77 KB -0.02% -26 B 🔽
@sentry/nextjs (client) 38.72 KB +0.02% +7 B 🔺
@sentry/sveltekit (client) 36.06 KB +0.02% +5 B 🔺
@sentry/node 134.83 KB -0.19% -260 B 🔽
@sentry/node - without tracing 96.84 KB -0.31% -300 B 🔽
@sentry/aws-serverless 109.16 KB -0.25% -275 B 🔽

View base workflow run

Copy link

codecov bot commented Nov 26, 2024

❌ 6 Tests Failed:

Tests completed Failed Passed Skipped
657 6 651 31
View the top 3 failed tests by shortest run time
errors.test.ts Sends graphql exception to Sentry
Stack Traces | 0.05s run time
errors.test.ts:74:5 Sends graphql exception to Sentry
errors.test.ts Sends unexpected exception to Sentry if thrown in module that was registered before Sentry
Stack Traces | 0.102s run time
errors.test.ts:76:5 Sends unexpected exception to Sentry if thrown in module that was registered before Sentry
errors.test.ts Sends unexpected exception to Sentry if thrown in module with local filter
Stack Traces | 0.149s run time
errors.test.ts:40:5 Sends unexpected exception to Sentry if thrown in module with local filter

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

@mydea mydea force-pushed the fn/ignorePropagationContextOtelSpans branch from 9e88097 to 4b096ed Compare November 26, 2024 14:57
mydea added a commit that referenced this pull request Nov 27, 2024
Noticed this while working on
#14481.

The way we try-catched the astro
server request code lead to the http.server span not being attached to
servers correctly - we had a try-catch block _outside_ of the
`startSpan` call, where we sent caught errors to sentry. but any error
caught this way would not have an active span (because by the time the
`catch` part triggers, `startSpan` is over), and thus the http.server
span would not be attached to the error. By moving this try-catch inside
of the `startSpan` call, we can correctly assign the span to errors. I
also tried to add some tests to this - there is still a problem in there
which the tests show, which I'll look at afterwards (and/or they may get
fixed by #14481)
@mydea mydea force-pushed the fn/ignorePropagationContextOtelSpans branch from 4b096ed to 0362bd0 Compare November 28, 2024 09:53
// Also ensure sampling decision is correctly inferred
// In core, we use `spanIsSampled`, which just looks at the trace flags
// but in OTEL, we use a slightly more complex logic to be able to differntiate between unsampled and deferred sampling
if (hasTracingEnabled()) {
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 is kind of not exactly what the name implies this does, but I think it's OK to add this here too. Otherwise, we'll have to export another, new method here and use this in the Node SDK initOtel, which seems not really worth it here 🤔

Copy link
Member

Choose a reason for hiding this comment

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

I think we should rename hasTracingEnabled anyway, which we can do during v9

@mydea mydea force-pushed the fn/ignorePropagationContextOtelSpans branch 4 times, most recently from fee464e to dae27c9 Compare November 29, 2024 08:57
@@ -26,6 +26,7 @@ test('Sends exception to Sentry', async ({ baseURL }) => {
expect(errorEvent.contexts?.trace).toEqual({
trace_id: expect.stringMatching(/[a-f0-9]{32}/),
span_id: expect.stringMatching(/[a-f0-9]{16}/),
parent_span_id: expect.stringMatching(/[a-f0-9]{16}/),
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 do not really know why this was not here before, but IMHO it was incorrect? These errors (same for the other nest E2E tests), as you'll usually have the http.server span and then inside it some e.g. route handler span or so, so the active span at the time of the error should usually have a parent_span_id. So I'd say this fixes incorrect (?) behavior 🤔

// But our default node-fetch spans are not emitted
expect(scopeSpans.length).toEqual(2);
expect(scopeSpans.length).toEqual(3);
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 was also incorrect before, spans from startSpan() did not end up here, although they should. This was probably because of incorrect propagation in this scenario.

@@ -26,6 +26,6 @@ describe('awsIntegration', () => {
});

test('should auto-instrument aws-sdk v2 package.', done => {
createRunner(__dirname, 'scenario.js').expect({ transaction: EXPECTED_TRANSCATION }).start(done);
createRunner(__dirname, 'scenario.js').ignore('event').expect({ transaction: EXPECTED_TRANSCATION }).start(done);
Copy link
Member Author

Choose a reason for hiding this comment

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

unrelated, but saw this flaking every now and then so decided to just ignore events here.

@mydea mydea force-pushed the fn/ignorePropagationContextOtelSpans branch from b7f5861 to c0e8566 Compare November 29, 2024 12:11
@mydea mydea marked this pull request as ready for review November 29, 2024 12:11
@mydea mydea requested review from Lms24, lforst and AbhiPrasad November 29, 2024 12:11
@mydea mydea force-pushed the fn/ignorePropagationContextOtelSpans branch from a2cbf94 to dee24ea Compare November 29, 2024 13:18
@mydea mydea force-pushed the fn/ignorePropagationContextOtelSpans branch from dee24ea to f61a993 Compare December 2, 2024 08:05
// Also ensure sampling decision is correctly inferred
// In core, we use `spanIsSampled`, which just looks at the trace flags
// but in OTEL, we use a slightly more complex logic to be able to differntiate between unsampled and deferred sampling
if (hasTracingEnabled()) {
Copy link
Member

Choose a reason for hiding this comment

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

I think we should rename hasTracingEnabled anyway, which we can do during v9

@mydea mydea merged commit c8e81d5 into develop Dec 3, 2024
153 checks passed
@mydea mydea deleted the fn/ignorePropagationContextOtelSpans branch December 3, 2024 08:02
alexandresoro pushed a commit to alexandresoro/ouca that referenced this pull request Dec 22, 2024
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [@sentry/node](https://github.com/getsentry/sentry-javascript/tree/master/packages/node) ([source](https://github.com/getsentry/sentry-javascript)) | dependencies | minor | [`8.42.0` -> `8.47.0`](https://renovatebot.com/diffs/npm/@sentry%2fnode/8.42.0/8.47.0) |
| [@sentry/react](https://github.com/getsentry/sentry-javascript/tree/master/packages/react) ([source](https://github.com/getsentry/sentry-javascript)) | dependencies | minor | [`8.42.0` -> `8.47.0`](https://renovatebot.com/diffs/npm/@sentry%2freact/8.42.0/8.47.0) |

---

### Release Notes

<details>
<summary>getsentry/sentry-javascript (@&#8203;sentry/node)</summary>

### [`v8.47.0`](https://github.com/getsentry/sentry-javascript/releases/tag/8.47.0)

[Compare Source](getsentry/sentry-javascript@8.46.0...8.47.0)

-   feat(v8/core): Add `updateSpanName` helper function ([#&#8203;14736](getsentry/sentry-javascript#14736))
-   feat(v8/node): Do not overwrite prisma `db.system` in newer Prisma versions ([#&#8203;14772](getsentry/sentry-javascript#14772))
-   feat(v8/node/deps): Bump [@&#8203;prisma/instrumentation](https://github.com/prisma/instrumentation) from 5.19.1 to 5.22.0 ([#&#8203;14755](getsentry/sentry-javascript#14755))
-   feat(v8/replay): Mask srcdoc iframe contents per default ([#&#8203;14779](getsentry/sentry-javascript#14779))
-   ref(v8/nextjs): Fix typo in source maps deletion warning ([#&#8203;14776](getsentry/sentry-javascript#14776))

Work in this release was contributed by [@&#8203;aloisklink](https://github.com/aloisklink) and [@&#8203;benjick](https://github.com/benjick). Thank you for your contributions!

##### Bundle size 📦

| Path                                                             | Size              |
| ---------------------------------------------------------------- | ----------------- |
| [@&#8203;sentry/browser](https://github.com/sentry/browser)                                                  | 23.29 KB  |
| [@&#8203;sentry/browser](https://github.com/sentry/browser) - with treeshaking flags                         | 21.96 KB  |
| [@&#8203;sentry/browser](https://github.com/sentry/browser) (incl. Tracing)                                  | 35.81 KB  |
| [@&#8203;sentry/browser](https://github.com/sentry/browser) (incl. Tracing, Replay)                          | 73.06 KB  |
| [@&#8203;sentry/browser](https://github.com/sentry/browser) (incl. Tracing, Replay) - with treeshaking flags | 63.45 KB  |
| [@&#8203;sentry/browser](https://github.com/sentry/browser) (incl. Tracing, Replay with Canvas)              | 77.37 KB  |
| [@&#8203;sentry/browser](https://github.com/sentry/browser) (incl. Tracing, Replay, Feedback)                | 89.85 KB  |
| [@&#8203;sentry/browser](https://github.com/sentry/browser) (incl. Feedback)                                 | 40.04 KB  |
| [@&#8203;sentry/browser](https://github.com/sentry/browser) (incl. sendFeedback)                             | 27.89 KB  |
| [@&#8203;sentry/browser](https://github.com/sentry/browser) (incl. FeedbackAsync)                            | 32.68 KB  |
| [@&#8203;sentry/react](https://github.com/sentry/react)                                                    | 25.96 KB  |
| [@&#8203;sentry/react](https://github.com/sentry/react) (incl. Tracing)                                    | 38.64 KB  |
| [@&#8203;sentry/vue](https://github.com/sentry/vue)                                                      | 27.52 KB  |
| [@&#8203;sentry/vue](https://github.com/sentry/vue) (incl. Tracing)                                      | 37.67 KB  |
| [@&#8203;sentry/svelte](https://github.com/sentry/svelte)                                                   | 23.45 KB  |
| CDN Bundle                                                       | 24.47 KB  |
| CDN Bundle (incl. Tracing)                                       | 37.51 KB  |
| CDN Bundle (incl. Tracing, Replay)                               | 72.71 KB  |
| CDN Bundle (incl. Tracing, Replay, Feedback)                     | 78.1 KB   |
| CDN Bundle - uncompressed                                        | 71.85 KB  |
| CDN Bundle (incl. Tracing) - uncompressed                        | 111.23 KB |
| CDN Bundle (incl. Tracing, Replay) - uncompressed                | 225.3 KB  |
| CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed      | 238.52 KB |
| [@&#8203;sentry/nextjs](https://github.com/sentry/nextjs) (client)                                          | 38.9 KB   |
| [@&#8203;sentry/sveltekit](https://github.com/sentry/sveltekit) (client)                                       | 36.32 KB  |
| [@&#8203;sentry/node](https://github.com/sentry/node)                                                     | 162.7 KB  |
| [@&#8203;sentry/node](https://github.com/sentry/node) - without tracing                                   | 98.87 KB  |
| [@&#8203;sentry/aws-serverless](https://github.com/sentry/aws-serverless)                                           | 126.53 KB |

### [`v8.46.0`](https://github.com/getsentry/sentry-javascript/releases/tag/8.46.0)

[Compare Source](getsentry/sentry-javascript@8.45.1...8.46.0)

-   feat: Allow capture of more than 1 ANR event \[v8] ([#&#8203;14713](getsentry/sentry-javascript#14713))
-   feat(node): Detect Railway release name \[v8] ([#&#8203;14714](getsentry/sentry-javascript#14714))
-   fix: Normalise ANR debug image file paths if appRoot was supplied \[v8] ([#&#8203;14709](getsentry/sentry-javascript#14709))
-   fix(nuxt): Remove build config from tsconfig ([#&#8203;14737](getsentry/sentry-javascript#14737))

Work in this release was contributed by [@&#8203;conor-ob](https://github.com/conor-ob). Thank you for your contribution!

##### Bundle size 📦

| Path                                                             | Size              |
| ---------------------------------------------------------------- | ----------------- |
| [@&#8203;sentry/browser](https://github.com/sentry/browser)                                                  | 23.29 KB  |
| [@&#8203;sentry/browser](https://github.com/sentry/browser) - with treeshaking flags                         | 21.96 KB  |
| [@&#8203;sentry/browser](https://github.com/sentry/browser) (incl. Tracing)                                  | 35.79 KB  |
| [@&#8203;sentry/browser](https://github.com/sentry/browser) (incl. Tracing, Replay)                          | 73.01 KB  |
| [@&#8203;sentry/browser](https://github.com/sentry/browser) (incl. Tracing, Replay) - with treeshaking flags | 63.41 KB  |
| [@&#8203;sentry/browser](https://github.com/sentry/browser) (incl. Tracing, Replay with Canvas)              | 77.32 KB  |
| [@&#8203;sentry/browser](https://github.com/sentry/browser) (incl. Tracing, Replay, Feedback)                | 89.81 KB  |
| [@&#8203;sentry/browser](https://github.com/sentry/browser) (incl. Feedback)                                 | 40.04 KB  |
| [@&#8203;sentry/browser](https://github.com/sentry/browser) (incl. sendFeedback)                             | 27.89 KB  |
| [@&#8203;sentry/browser](https://github.com/sentry/browser) (incl. FeedbackAsync)                            | 32.68 KB  |
| [@&#8203;sentry/react](https://github.com/sentry/react)                                                    | 25.96 KB  |
| [@&#8203;sentry/react](https://github.com/sentry/react) (incl. Tracing)                                    | 38.6 KB   |
| [@&#8203;sentry/vue](https://github.com/sentry/vue)                                                      | 27.49 KB  |
| [@&#8203;sentry/vue](https://github.com/sentry/vue) (incl. Tracing)                                      | 37.63 KB  |
| [@&#8203;sentry/svelte](https://github.com/sentry/svelte)                                                   | 23.45 KB  |
| CDN Bundle                                                       | 24.43 KB  |
| CDN Bundle (incl. Tracing)                                       | 37.46 KB  |
| CDN Bundle (incl. Tracing, Replay)                               | 72.64 KB  |
| CDN Bundle (incl. Tracing, Replay, Feedback)                     | 78.01 KB  |
| CDN Bundle - uncompressed                                        | 71.74 KB  |
| CDN Bundle (incl. Tracing) - uncompressed                        | 111.05 KB |
| CDN Bundle (incl. Tracing, Replay) - uncompressed                | 225.1 KB  |
| CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed      | 238.32 KB |
| [@&#8203;sentry/nextjs](https://github.com/sentry/nextjs) (client)                                          | 38.88 KB  |
| [@&#8203;sentry/sveltekit](https://github.com/sentry/sveltekit) (client)                                       | 36.29 KB  |
| [@&#8203;sentry/node](https://github.com/sentry/node)                                                     | 162.53 KB |
| [@&#8203;sentry/node](https://github.com/sentry/node) - without tracing                                   | 98.72 KB  |
| [@&#8203;sentry/aws-serverless](https://github.com/sentry/aws-serverless)                                           | 126.4 KB  |

### [`v8.45.1`](https://github.com/getsentry/sentry-javascript/releases/tag/8.45.1)

[Compare Source](getsentry/sentry-javascript@8.45.0...8.45.1)

-   fix(feedback): Return when the `sendFeedback` promise resolves ([#&#8203;14683](getsentry/sentry-javascript#14683))

Work in this release was contributed by [@&#8203;antonis](https://github.com/antonis). Thank you for your contribution!

##### Bundle size 📦

| Path                                                             | Size              |
| ---------------------------------------------------------------- | ----------------- |
| [@&#8203;sentry/browser](https://github.com/sentry/browser)                                                  | 23.29 KB  |
| [@&#8203;sentry/browser](https://github.com/sentry/browser) - with treeshaking flags                         | 21.96 KB  |
| [@&#8203;sentry/browser](https://github.com/sentry/browser) (incl. Tracing)                                  | 35.79 KB  |
| [@&#8203;sentry/browser](https://github.com/sentry/browser) (incl. Tracing, Replay)                          | 73.01 KB  |
| [@&#8203;sentry/browser](https://github.com/sentry/browser) (incl. Tracing, Replay) - with treeshaking flags | 63.41 KB  |
| [@&#8203;sentry/browser](https://github.com/sentry/browser) (incl. Tracing, Replay with Canvas)              | 77.32 KB  |
| [@&#8203;sentry/browser](https://github.com/sentry/browser) (incl. Tracing, Replay, Feedback)                | 89.81 KB  |
| [@&#8203;sentry/browser](https://github.com/sentry/browser) (incl. Feedback)                                 | 40.04 KB  |
| [@&#8203;sentry/browser](https://github.com/sentry/browser) (incl. sendFeedback)                             | 27.89 KB  |
| [@&#8203;sentry/browser](https://github.com/sentry/browser) (incl. FeedbackAsync)                            | 32.68 KB  |
| [@&#8203;sentry/react](https://github.com/sentry/react)                                                    | 25.96 KB  |
| [@&#8203;sentry/react](https://github.com/sentry/react) (incl. Tracing)                                    | 38.6 KB   |
| [@&#8203;sentry/vue](https://github.com/sentry/vue)                                                      | 27.49 KB  |
| [@&#8203;sentry/vue](https://github.com/sentry/vue) (incl. Tracing)                                      | 37.63 KB  |
| [@&#8203;sentry/svelte](https://github.com/sentry/svelte)                                                   | 23.45 KB  |
| CDN Bundle                                                       | 24.43 KB  |
| CDN Bundle (incl. Tracing)                                       | 37.46 KB  |
| CDN Bundle (incl. Tracing, Replay)                               | 72.64 KB  |
| CDN Bundle (incl. Tracing, Replay, Feedback)                     | 78.01 KB  |
| CDN Bundle - uncompressed                                        | 71.74 KB  |
| CDN Bundle (incl. Tracing) - uncompressed                        | 111.05 KB |
| CDN Bundle (incl. Tracing, Replay) - uncompressed                | 225.1 KB  |
| CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed      | 238.32 KB |
| [@&#8203;sentry/nextjs](https://github.com/sentry/nextjs) (client)                                          | 38.88 KB  |
| [@&#8203;sentry/sveltekit](https://github.com/sentry/sveltekit) (client)                                       | 36.29 KB  |
| [@&#8203;sentry/node](https://github.com/sentry/node)                                                     | 162.52 KB |
| [@&#8203;sentry/node](https://github.com/sentry/node) - without tracing                                   | 98.71 KB  |
| [@&#8203;sentry/aws-serverless](https://github.com/sentry/aws-serverless)                                           | 126.39 KB |

### [`v8.45.0`](https://github.com/getsentry/sentry-javascript/blob/HEAD/CHANGELOG.md#8450)

[Compare Source](getsentry/sentry-javascript@8.44.0...8.45.0)

-   feat(core): Add `handled` option to `captureConsoleIntegration` ([#&#8203;14664](getsentry/sentry-javascript#14664))
-   feat(browser): Attach virtual stack traces to `HttpClient` events ([#&#8203;14515](getsentry/sentry-javascript#14515))
-   feat(replay): Upgrade rrweb packages to 2.31.0 ([#&#8203;14689](getsentry/sentry-javascript#14689))
-   fix(aws-serverless): Remove v8 layer as it overwrites the current layer for docs ([#&#8203;14679](getsentry/sentry-javascript#14679))
-   fix(browser): Mark stack trace from `captureMessage` with `attachStacktrace: true` as synthetic ([#&#8203;14668](getsentry/sentry-javascript#14668))
-   fix(core): Mark stack trace from `captureMessage` with `attatchStackTrace: true` as synthetic ([#&#8203;14670](getsentry/sentry-javascript#14670))
-   fix(core): Set `level` in server runtime `captureException` ([#&#8203;10587](getsentry/sentry-javascript#10587))
-   fix(profiling-node): Guard invocation of native profiling methods ([#&#8203;14676](getsentry/sentry-javascript#14676))
-   fix(nuxt): Inline nitro-utils function ([#&#8203;14680](getsentry/sentry-javascript#14680))
-   fix(profiling-node): Ensure profileId is added to transaction event ([#&#8203;14681](getsentry/sentry-javascript#14681))
-   fix(react): Add React Router Descendant Routes support ([#&#8203;14304](getsentry/sentry-javascript#14304))
-   fix: Disable ANR and Local Variables if debugger is enabled via CLI args ([#&#8203;14643](getsentry/sentry-javascript#14643))

Work in this release was contributed by [@&#8203;anonrig](https://github.com/anonrig) and [@&#8203;Zih0](https://github.com/Zih0). Thank you for your contributions!

### [`v8.44.0`](https://github.com/getsentry/sentry-javascript/blob/HEAD/CHANGELOG.md#8440)

[Compare Source](getsentry/sentry-javascript@8.43.0...8.44.0)

##### Deprecations

-   **feat: Deprecate `autoSessionTracking` ([#&#8203;14640](getsentry/sentry-javascript#14640

    Deprecates `autoSessionTracking`.
    To enable session tracking, it is recommended to unset `autoSessionTracking` and ensure that either, in browser environments
    the `browserSessionIntegration` is added, or in server environments the `httpIntegration` is added.

    To disable session tracking, it is recommended to unset `autoSessionTracking` and to remove the `browserSessionIntegration` in
    browser environments, or in server environments configure the `httpIntegration` with the `trackIncomingRequestsAsSessions` option set to `false`.

##### Other Changes

-   feat: Reword log message around unsent spans ([#&#8203;14641](getsentry/sentry-javascript#14641))
-   feat(opentelemetry): Set `response` context for http.server spans ([#&#8203;14634](getsentry/sentry-javascript#14634))
-   fix(google-cloud-serverless): Update homepage link in package.json ([#&#8203;14411](getsentry/sentry-javascript#14411))
-   fix(nuxt): Add unbuild config to not fail on warn ([#&#8203;14662](getsentry/sentry-javascript#14662))

Work in this release was contributed by [@&#8203;robinvw1](https://github.com/robinvw1). Thank you for your contribution!

### [`v8.43.0`](https://github.com/getsentry/sentry-javascript/blob/HEAD/CHANGELOG.md#8430)

[Compare Source](getsentry/sentry-javascript@8.42.0...8.43.0)

##### Important Changes

-   **feat(nuxt): Add option autoInjectServerSentry (no default import()) ([#&#8203;14553](getsentry/sentry-javascript#14553

    Using the dynamic `import()` as the default behavior for initializing the SDK on the server-side did not work for every project.
    The default behavior of the SDK has been changed, and you now need to **use the `--import` flag to initialize Sentry on the server-side** to leverage full functionality.

    Example with `--import`:

    ```bash
    node --import ./.output/server/sentry.server.config.mjs .output/server/index.mjs
    ```

    In case you are not able to use the `--import` flag, you can enable auto-injecting Sentry in the `nuxt.config.ts` (comes with limitations):

    ```ts
    sentry: {
      autoInjectServerSentry: 'top-level-import', // or 'experimental_dynamic-import'
    },
    ```

-   **feat(browser): Adds LaunchDarkly and OpenFeature integrations ([#&#8203;14207](getsentry/sentry-javascript#14207

    Adds browser SDK integrations for tracking feature flag evaluations through the LaunchDarkly JS SDK and OpenFeature Web SDK:

    ```ts
    import * as Sentry from '@&#8203;sentry/browser';

    Sentry.init({
      integrations: [
        // Track LaunchDarkly feature flags
        Sentry.launchDarklyIntegration(),
        // Track OpenFeature feature flags
        Sentry.openFeatureIntegration(),
      ],
    });
    ```

    -   Read more about the [Feature Flags](https://develop.sentry.dev/sdk/expected-features/#feature-flags) feature in Sentry.
    -   Read more about the [LaunchDarkly SDK Integration](https://docs.sentry.io/platforms/javascript/configuration/integrations/launchdarkly/).
    -   Read more about the [OpenFeature SDK Integration](https://docs.sentry.io/platforms/javascript/configuration/integrations/openfeature/).

-   **feat(browser): Add `featureFlagsIntegration` for custom tracking of flag evaluations ([#&#8203;14582](getsentry/sentry-javascript#14582

    Adds a browser integration to manually track feature flags with an API. Feature flags are attached to subsequent error events:

    ```ts
    import * as Sentry from '@&#8203;sentry/browser';

    const featureFlagsIntegrationInstance = Sentry.featureFlagsIntegration();

    Sentry.init({
      // Initialize the SDK with the feature flag integration
      integrations: [featureFlagsIntegrationInstance],
    });

    // Manually track a feature flag
    featureFlagsIntegrationInstance.addFeatureFlag('my-feature', true);
    ```

-   **feat(astro): Add Astro 5 support ([#&#8203;14613](getsentry/sentry-javascript#14613

    With this release, the Sentry Astro SDK officially supports Astro 5.

##### Deprecations

-   feat(nextjs): Deprecate typedef for `hideSourceMaps` ([#&#8203;14594](getsentry/sentry-javascript#14594))

    The functionality of `hideSourceMaps` was removed in version 8 but was forgotten to be deprecated and removed.
    It will be completely removed in the next major version.

-   feat(core): Deprecate APIs around `RequestSession`s ([#&#8203;14566](getsentry/sentry-javascript#14566))

    The APIs around `RequestSession`s are mostly used internally.
    Going forward the SDK will not expose concepts around `RequestSession`s.
    Instead, functionality around server-side [Release Health](https://docs.sentry.io/product/releases/health/) will be managed in integrations.

##### Other Changes

-   feat(browser): Add `browserSessionIntegration` ([#&#8203;14551](getsentry/sentry-javascript#14551))
-   feat(core): Add `raw_security` envelope types ([#&#8203;14562](getsentry/sentry-javascript#14562))
-   feat(deps): Bump [@&#8203;opentelemetry/instrumentation](https://github.com/opentelemetry/instrumentation) from 0.55.0 to 0.56.0 ([#&#8203;14625](getsentry/sentry-javascript#14625))
-   feat(deps): Bump [@&#8203;sentry/cli](https://github.com/sentry/cli) from 2.38.2 to 2.39.1 ([#&#8203;14626](getsentry/sentry-javascript#14626))
-   feat(deps): Bump [@&#8203;sentry/rollup-plugin](https://github.com/sentry/rollup-plugin) from 2.22.6 to 2.22.7 ([#&#8203;14622](getsentry/sentry-javascript#14622))
-   feat(deps): Bump [@&#8203;sentry/webpack-plugin](https://github.com/sentry/webpack-plugin) from 2.22.6 to 2.22.7 ([#&#8203;14623](getsentry/sentry-javascript#14623))
-   feat(nestjs): Add fastify support ([#&#8203;14549](getsentry/sentry-javascript#14549))
-   feat(node): Add [@&#8203;vercel/ai](https://github.com/vercel/ai) instrumentation ([#&#8203;13892](getsentry/sentry-javascript#13892))
-   feat(node): Add `disableAnrDetectionForCallback` function ([#&#8203;14359](getsentry/sentry-javascript#14359))
-   feat(node): Add `trackIncomingRequestsAsSessions` option to http integration ([#&#8203;14567](getsentry/sentry-javascript#14567))
-   feat(nuxt): Add option `autoInjectServerSentry` (no default `import()`) ([#&#8203;14553](getsentry/sentry-javascript#14553))
-   feat(nuxt): Add warning when Netlify or Vercel build is discovered ([#&#8203;13868](getsentry/sentry-javascript#13868))
-   feat(nuxt): Improve serverless event flushing and scope isolation ([#&#8203;14605](getsentry/sentry-javascript#14605))
-   feat(opentelemetry): Stop looking at propagation context for span creation ([#&#8203;14481](getsentry/sentry-javascript#14481))
-   feat(opentelemetry): Update OpenTelemetry dependencies to `^1.29.0` ([#&#8203;14590](getsentry/sentry-javascript#14590))
-   feat(opentelemetry): Update OpenTelemetry dependencies to `1.28.0` ([#&#8203;14547](getsentry/sentry-javascript#14547))
-   feat(replay): Upgrade rrweb packages to 2.30.0 ([#&#8203;14597](getsentry/sentry-javascript#14597))
-   fix(core): Decode `filename` and `module` stack frame properties in Node stack parser ([#&#8203;14544](getsentry/sentry-javascript#14544))
-   fix(core): Filter out unactionable CEFSharp promise rejection error by default ([#&#8203;14595](getsentry/sentry-javascript#14595))
-   fix(nextjs): Don't show warning about devtool option ([#&#8203;14552](getsentry/sentry-javascript#14552))
-   fix(nextjs): Only apply tracing metadata to data fetcher data when data is an object ([#&#8203;14575](getsentry/sentry-javascript#14575))
-   fix(node): Guard against invalid `maxSpanWaitDuration` values ([#&#8203;14632](getsentry/sentry-javascript#14632))
-   fix(react): Match routes with `parseSearch` option in TanStack Router instrumentation ([#&#8203;14328](getsentry/sentry-javascript#14328))
-   fix(sveltekit): Fix git SHA not being picked up for release ([#&#8203;14540](getsentry/sentry-javascript#14540))
-   fix(types): Fix generic exports with default ([#&#8203;14576](getsentry/sentry-javascript#14576))

Work in this release was contributed by [@&#8203;lsmurray](https://github.com/lsmurray). Thank you for your contribution!

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS44Mi4wIiwidXBkYXRlZEluVmVyIjoiMzkuODIuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIl19-->

Reviewed-on: https://git.tristess.app/alexandresoro/ouca/pulls/407
Reviewed-by: Alexandre Soro <[email protected]>
Co-authored-by: renovate <[email protected]>
Co-committed-by: renovate <[email protected]>
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