Skip to content

Propagate Trace ID to native layer #4074

Open
@bitsandfoxes

Description

@bitsandfoxes

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
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions