-
-
Notifications
You must be signed in to change notification settings - Fork 452
POTEL 68 - Add SentryOpenTelemetryMode.OFF
#3995
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
Conversation
Instructions and example for changelogPlease add an entry to Example: ## Unreleased
- POTEL 68 - Add `SentryOpenTelemetryMode.OFF` ([#3995](https://github.com/getsentry/sentry-java/pull/3995)) If none of the above apply, you can opt out of this check by adding |
Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
20d57f2 | 437.12 ms | 511.13 ms | 74.00 ms |
00de25b | 401.31 ms | 417.12 ms | 15.81 ms |
b3cddf5 | 415.88 ms | 477.86 ms | 61.99 ms |
b4a5c82 | 435.04 ms | 490.67 ms | 55.63 ms |
de275f3 | 393.22 ms | 453.75 ms | 60.53 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
20d57f2 | 1.65 MiB | 2.31 MiB | 677.05 KiB |
00de25b | 1.65 MiB | 2.31 MiB | 677.07 KiB |
b3cddf5 | 1.65 MiB | 2.31 MiB | 677.05 KiB |
b4a5c82 | 1.65 MiB | 2.31 MiB | 677.05 KiB |
de275f3 | 1.65 MiB | 2.31 MiB | 677.05 KiB |
…the ScopesStorage is initialized
if (SentryOpenTelemetryMode.OFF == options.getOpenTelemetryMode()) { | ||
options.setSpanFactory(new DefaultSpanFactory()); | ||
// } else { | ||
// enabling this causes issues with agentless where OTel spans seem to be randomly ended |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have to keep using SpanFactoryFactory
in the SentryOptions
ctor for now as setting the OtelSpanFactory
here causes OpenTelemetry spans to be ended in the agentless sample.
I haven't investigated yet why that's happening.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, let's keep this for now and maybe create a separate issue to investigate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created #4005 to track
if (SentryOpenTelemetryMode.OFF == options.getOpenTelemetryMode()) { | ||
options.setSpanFactory(new DefaultSpanFactory()); | ||
// } else { | ||
// enabling this causes issues with agentless where OTel spans seem to be randomly ended |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, let's keep this for now and maybe create a separate issue to investigate
OpenTelemetryUtil.applyIgnoredSpanOrigins(options, new LoadClass()); | ||
} | ||
|
||
@SuppressWarnings("UnusedMethod") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
📜 Description
Add
SentryOpenTelemetryMode.OFF
💡 Motivation and Context
Allows customers to completely disable usage of OpenTelemetry by Sentry, even if it is present.
💚 How did you test it?
📝 Checklist
sendDefaultPII
is enabled.🔮 Next steps