-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(node): Ensure manual OTEL setup works (#12214)
Based on the great feedback in #12191, this does some small adjustments to ensure that you actually can use the Node SDK properly with a custom OTEL setup: ## 1. Ensure we do not run `validateOpenTelemetrySetup()` when `skipOpenTelemetrySetup` is configured. Today, this is impossible to fix because you need a client to create the sampler, and you need the sampler to satisfy the validation, but the validation runs in `init()`. So either you call init() before doing your manual setup, which means you get the warning, or you do the manual setup first, but then you can't actually add the sampler, and still get the warning. This change means that users that configure `skipOpenTelemetrySetup` can manually call `Sentry.validateOpenTelemetrySetup()` if they want to get the validation, else there will be no validation automtically. ## 2. Export `SentryContextManager` from `@sentry/node` This is easier to use than to use the primitive `wrapContextManagerClass` from `@sentry/opentelemetry`. ## 3. Ensure we always run `setupEventContextTrace`, not tied to `skipOpenTelemetrySetup` There is no reason to tie this together, this now just always runs in `init()` - it's just an event processor!
- Loading branch information
Showing
4 changed files
with
16 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters