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

Guide towards v9 for ESM OTEL setups #11974

Merged
merged 3 commits into from
Nov 28, 2024
Merged

Guide towards v9 for ESM OTEL setups #11974

merged 3 commits into from
Nov 28, 2024

Conversation

lforst
Copy link
Member

@lforst lforst commented Nov 27, 2024

DESCRIBE YOUR PR

Ref: getsentry/sentry-javascript#14483

  • We want to recommend people to register their own loader hooks with a custom otel setup.
  • we want to discourage using addOpenTelemetryInstrumentation().

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.

  • Urgent deadline (GA date, etc.):
  • Other deadline:
  • None: Not urgent, can wait up to 1 week+

Copy link

vercel bot commented Nov 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sentry-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 28, 2024 10:53am
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
changelog ⬜️ Ignored (Inspect) Visit Preview Nov 28, 2024 10:53am
develop-docs ⬜️ Ignored (Inspect) Visit Preview Nov 28, 2024 10:53am

Copy link

codecov bot commented Nov 27, 2024

Bundle Report

Changes will decrease total bundle size by 15 bytes (-0.0%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sentry-docs-server-cjs 10.13MB 9 bytes (-0.0%) ⬇️
sentry-docs-client-array-push 9.02MB 6 bytes (-0.0%) ⬇️


The Sentry SDK will automatically register ESM loader hooks by default.
However, if you have your own OpenTelemetry setup, it is recommended to configure the Sentry SDK to not register these hooks and instead register them yourself.
You can do so by setting `registerEsmLoaderHooks` to `false` and [set up ESM loader hooks](https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/esm-support.md#instrumentation-hook-required-for-esm):
Copy link
Collaborator

@timfish timfish Nov 27, 2024

Choose a reason for hiding this comment

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

I think it might be preferable to recommend the Sentry hook here that wraps the otel hook. That would leave us some options in the future if we ever need to add any extra logic.

Copy link
Member Author

Choose a reason for hiding this comment

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

Very valid, however, I don't think it buys us anything. We already cannot be sure that they use the Sentry hooks, therefore we can't make any decisions based on that.

Given that it doesn't really matter I'd rather refer to the OTEL docs - also because the target audience we assume in this paragraph is people that already have a complete OTEL setup.

Copy link
Contributor

@coolguyzone coolguyzone left a comment

Choose a reason for hiding this comment

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

Added some comments, looks good! Thanks for updating! 🕺🦃

lforst and others added 2 commits November 28, 2024 11:27
@lforst lforst merged commit d9bdc79 into master Nov 28, 2024
11 checks passed
@lforst lforst deleted the lforst-esm-v9-prep branch November 28, 2024 12:26
@github-actions github-actions bot locked and limited conversation to collaborators Dec 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants