Skip to content
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

Propagate traceId to native layer #1998

Open
10 tasks
bitsandfoxes opened this issue Jan 29, 2025 · 0 comments
Open
10 tasks

Propagate traceId to native layer #1998

bitsandfoxes opened this issue Jan 29, 2025 · 0 comments
Labels
Feature New feature or request

Comments

@bitsandfoxes
Copy link
Contributor

bitsandfoxes commented Jan 29, 2025

Problem Statement

The Unity SDK currently lacks proper trace ID propagation from the managed (C#) layer to the underlying native SDKs (Cocoa, Android, Native). This creates disconnected traces across different layers of the application, making it difficult to correlate events. There is no way to connect C# errors prior to a native event outside of breadcrumb messages.

Current Status by Platform

Native SDK

  • ❌ No propagation context available on the scope
  • ❌ Missing functionality to set trace context on the scope
  • ❌ No continue trace API implementation
  • Impact: Events from native crashes cannot be correlated with their originating managed traces

Android SDK

  • ✅ POC available: PR #1997
  • ✅ Working for Java errors
  • ❌ Native SDK trace context missing
  • NDK Scope Observer not propagating trace ID
  • Impact: Mixed trace propagation success; native crashes still disconnected

Cocoa SDK

  • ❌ POC available: PR #1990
  • ❌ Missing continue trace API
  • ❌ Trace propagation via bridge not functioning
  • Impact: Crash events generate new trace IDs instead of continuing existing traces

Step by Step

  1. Native SDK -

  2. Android SDK:

    • Implement trace context support in native layer
    • Extend NDK Scope Observer to handle trace ID propagation
    • Test and validate Java-Native trace consistency
    • Validate that no integration automatically updates the trace ID on certain lifecycle events and/or disable those OOTB
  3. Cocoa SDK:

    • Implement continue trace API
    • Update bridge to use continue trace
    • Validate that no integration automatically updates the trace ID on certain lifecycle events and/or disable those OOTB

Expected Outcome

After implementation, all events (managed and native) should maintain consistent trace IDs throughout the entire crash reporting pipeline. This enables proper event correlation across all layers of Unity games.

@bitsandfoxes bitsandfoxes added the Feature New feature or request label Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature or request
Projects
Status: No status
Development

No branches or pull requests

1 participant