-
-
Notifications
You must be signed in to change notification settings - Fork 444
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
Java: POTel Research #3232
Comments
@adinauer i converted this to an issue, so we can make more proper task lists and potentially just convert it to an issue/epic later |
After daily discussion about OTEL Context forking with @sl0thentr0py , @antonpirker, @sentrivana , @szokeasaurusrex Core question
Side note: Sentry Miro board showcasing pure Context usage and combined approach How does this work in JS SDK?JS SDK uses a hook provided by OTEL called While there also is a global storage for OTEL spans, this should only be needed for building Sentry transactions. Once span streaming lands, we should be able to remove that global storage. While for JS SDK there also is a distinction between Why do we care about OTEL
|
Why we need to globally store Sentry
|
Why do we need the Hubs/Scopes merge for POTEL?We do want to go through with the Hubs/Scopes merge in all of our SDKs regardless of POTEL. We want to remove the hub concept for users and also provide a "copy-on-write" that prevents footguns like We want to have a scope forking system that is consistent with how OTEL does forking. Some of the limitations with current Hubs/Scopes can be found here. Here's some reasons I found but so far I'm not sure any of those actually apply to the Java SDK in a way where it wouldn't be possible to make POTEL work with hubs.
|
How can
|
POTEL AndroidOTEL Android SDK
Running our instrumentation sample with the OTEL Android SDK and a Jaeger Backend, starting the app yields the following results: OverviewDetailCombining Sentry with OTEL Android SDKThe work done by @adinauer for OTEL on the backend can be used to initialize the OTEL Android SDK in a way that the Spans created by OTEL are sent to Sentry. By using our With Manual init ( OverviewDetailTaking all OtelSpan attributes and setting them as tags on the SentryTransaction in the SentrySpanExporter yields the following (these would need to be mapped to the correct keys we expect in sentry): Performance using OTEL Java SDK combined with Sentry-Android incl. gradle pluginThis is probably the most the solution we should try to achieve. Open Questions for this approach:How are Metrics/Profilers related to Performance product (are they bound to spans/transactions?) |
POTEL Android size comparisonSentryAndroid with SAGP + all instrumentations enabled
SentryAndroid with SAGP + all instrumentations enabled+ OTEL Java SDK with SAGP
SentryAndroid with SAGP + all instrumentations enabled + OTEL Android SDK
SentryAndroid with SAGP + all instrumentations enabled + OTEL Android SDK
|
Statement on OTel support - tech feasibility and quality
Context Handling
Attributes vs Context
String
,Boolean
,Long
,Double
) and arrays thereof (seeAttributeType
)Context.current()
works inSpanProcessor
ReadableSpan
inSpanProcessor.onEnd()
ReadableSpan
AgentContextWrapper
is used (presumably this is always the case when using the OTEL Java Agent)agentContext
vsapplicationContext
ContextStorageProvider
ContextStorageProvider
to intercept whenever context is replaced and fork scopeHubs and Scopes merge
Execution context
ExecutionContext
in code to wrap isolation scope, current scope and maybe also current span?currentHub
Scopes
Sentry.init
Sentry.init
was calledSentry.getGlobalScope().setTag()
etc.Sentry.setTag()
orSentry.setUser()
, will set on the isolation scope.Sentry.captureException(e)
will capture on the current scopeScope forking
See https://miro.com/app/board/uXjVNtPiOfI=/
with new_scope
)with use_scope(scope)
)with isolation_scope
)with use_isolation_scope(isolation_scope)
)with execution_context(execution_context)
Applying scopes to events
Transferring execution context
Tracing without Performance (TwP) /
PropagationContext
Copy on write
Locking
Lifecycle management
pushScope
andpushIsolationScope
could return anAutoClosable
where onclose
we restore the previous scope. This would allow users to simply writetry(x = pushScope()) { ... }
instead of manually having to popScope. It'd also allow for restoring previous state without risking an imbalance betweenpushScope
andpopScope
calls. OTEL does this, e.g. inContext.makeCurrent()
.Migration docs
Sentry.setTag()
) now goes to isolation scope whereas e.g.Sentry.configureScope(s -> s.setTag())
goes to the current scope. This may lead to unexpected scope leaks for our users.Document common use cases
Sentry.addTag()
Sentry.getGlobalScope().setX
etc.The text was updated successfully, but these errors were encountered: