feat(node)!: Avoid http spans by default for custom OTEL setups#14678
feat(node)!: Avoid http spans by default for custom OTEL setups#14678
Conversation
| - Deprecated `addOpenTelemetryInstrumentation`. Use the `openTelemetryInstrumentations` option in `Sentry.init()` or your custom Sentry Client instead. | ||
| - Deprecated `registerEsmLoaderHooks.include` and `registerEsmLoaderHooks.exclude`. Set `onlyIncludeInstrumentedModules: true` instead. | ||
| - `registerEsmLoaderHooks` will only accept `true | false | undefined` in the future. The SDK will default to wrapping modules that are used as part of OpenTelemetry Instrumentation. | ||
| - `httpIntegration({ spans: false })` is configured by default if `skipOpenTelemetrySetup: true` is set. You can still overwrite this if desired. |
There was a problem hiding this comment.
I would phrase it a bit differently and explain it to people like this: "The httpIntegration will no longer set up the Opentelemetry HTTP Instrumentation when skipOpenTelemetrySetup: true, or when spans: false is set."
There was a problem hiding this comment.
I added "better" docs to the v8-to-v9 migration guide, which I only saw after I wrote this 😅 should we maintain both of these docs?
There was a problem hiding this comment.
I will merge them into one once develop becomes the "main" branch for the v9 work.
| }); | ||
|
|
||
| /** Exported only for tests. */ | ||
| export function _shouldInstrumentSpans(options: HttpOptions, clientOptions: Partial<NodeClientOptions> = {}): boolean { |
There was a problem hiding this comment.
l: Do we really need a helper function + test for this? Imo could just be a const with description. Makes it rather hard to read.
There was a problem hiding this comment.
I just wanted to double check the behavior is correct without adding integration tests etc for this 😅 I always find it easy for little bugs to sneak in in such places, e.g. if you have a wrong ! somewhere everything can become wrong, which can be easy to miss when testing "happy paths" in integration tests only.
size-limit report 📦
|
❌ 4 Tests Failed:
View the top 3 failed tests by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
With this PR, the default value for the `spans` option in the `httpIntegration` is changed to `false`, if `skipOpenTelemetrySetup: true` is configured. This is what you'd expect as a user, you do not want Sentry to register any OTEL instrumentation and emit any spans in this scenario. Closes #14675
With this PR, the default value for the `spans` option in the `httpIntegration` is changed to `false`, if `skipOpenTelemetrySetup: true` is configured. This is what you'd expect as a user, you do not want Sentry to register any OTEL instrumentation and emit any spans in this scenario. Closes #14675
With this PR, the default value for the `spans` option in the `httpIntegration` is changed to `false`, if `skipOpenTelemetrySetup: true` is configured. This is what you'd expect as a user, you do not want Sentry to register any OTEL instrumentation and emit any spans in this scenario. Closes #14675
With this PR, the default value for the
spansoption in thehttpIntegrationis changed tofalse, ifskipOpenTelemetrySetup: trueis configured. This is what you'd expect as a user, you do not want Sentry to register any OTEL instrumentation and emit any spans in this scenario.Closes #14675