Skip to content

Propagate Trace ID to native layer #4074

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

Open
bitsandfoxes opened this issue Apr 2, 2025 · 0 comments
Open

Propagate Trace ID to native layer #4074

bitsandfoxes opened this issue Apr 2, 2025 · 0 comments

Comments

@bitsandfoxes
Copy link
Contributor

bitsandfoxes commented Apr 2, 2025

Context

With #4026 the SDK now accepts SetTrace from other "Head SDKs" like the Unity SDK. This builds on top of TwP and allows them to directly set the PropagationContext without having to go through the ContinueTrace.

With this change we've also extended the IScopeObserver to observe changes to the PropagationContext and pass then on to the native layer.

Goals

The goal is to have the .NET SDK pass on the trace ID to the native SDK via the respective ScopeObserver.

Native ✅

Platforms that are covered by sentry-native got this functionality with #4026 and the observer observes.

public override void SetTraceImpl(SentryId traceId, SpanId parentSpanId) =>
C.sentry_set_trace(traceId.ToString(), parentSpanId.ToString());

Android

Supporting this on Android is currently blocked by #3911. The feature requires at least 8.4.0.

public void SetTrace(SentryId traceId, SpanId parentSpanId)
{
// TODO: This requires sentry-java 8.4.0
}

Cocoa

The Cocoa SDK is missing the functionality to have the trace ID passed. Once that's done we'll need to update the CocoaScopeObserver

public void SetTrace(SentryId traceId, SpanId parentSpanId)
{
// TODO: Missing corresponding functionality on the Cocoa SDK
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants