Skip to content

Conversation

@adinauer
Copy link
Member

📜 Description

Add openTelemetryMode option

💡 Motivation and Context

So customers don't have to add OpenTelemetryUtil.apply... to their applications and instead have the SDK figure out automatically in what way to use OpenTelemetry.

💚 How did you test it?

📝 Checklist

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

  • parse from external options, add tests etc.
  • in theory we could also add an OFF enum option but that would require us to initialize ScopesStorage later to first read the option and only then initialize it. It would have to be NOOP before.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 17, 2024

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 395a3fc

@github-actions
Copy link
Contributor

github-actions bot commented Dec 17, 2024

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 420.84 ms 470.94 ms 50.10 ms
Size 1.65 MiB 2.31 MiB 676.61 KiB

Previous results on branch: feat/add-opentelemetry-mode-option

Startup times

Revision Plain With Sentry Diff
25b4e26 375.50 ms 426.00 ms 50.50 ms
75859e1 405.08 ms 466.24 ms 61.16 ms
a58d1ae 404.23 ms 424.78 ms 20.55 ms

App size

Revision Plain With Sentry Diff
25b4e26 1.65 MiB 2.31 MiB 676.61 KiB
75859e1 1.65 MiB 2.31 MiB 676.61 KiB
a58d1ae 1.65 MiB 2.31 MiB 676.57 KiB

Base automatically changed from feat/otelutil-mode to 8.x.x December 17, 2024 10:14
options.setEnableExternalConfiguration(true);
options.setInitPriority(InitPriority.HIGH);
OpenTelemetryUtil.applyOpenTelemetryOptions(options, SentryOpenTelemetryMode.AGENT);
options.setOpenTelemetryMode(SentryOpenTelemetryMode.AGENT);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't we leave that on AUTO here and let the OpenTelemetryUtils decide?

The SentryAutoConfigurationCustomizerProvider is also present in the sentry-opentelemetry-agentless case and if a SENTRY_PROPERTIES_FILE or SENTRY_DSN environment variable is present, it would auto-init unless skipInit is specifically set like in SentryOpenTelemetryNoAgentConfiguration for Spring integrations.

Copy link
Collaborator

@lbloder lbloder left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@adinauer adinauer merged commit 710f5dd into 8.x.x Dec 20, 2024
35 checks passed
@adinauer adinauer deleted the feat/add-opentelemetry-mode-option branch December 20, 2024 10: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.

3 participants