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

Native to Hybrid Spans Passing #171

Open
5 tasks
philipphofmann opened this issue Jan 19, 2024 · 0 comments
Open
5 tasks

Native to Hybrid Spans Passing #171

philipphofmann opened this issue Jan 19, 2024 · 0 comments

Comments

@philipphofmann
Copy link
Member

philipphofmann commented Jan 19, 2024

The native SDKs Cocoa and Android have auto instrumentation, which doesn't add any spans to the hybrid SDK transaction, such as HTTP, DB, and file IO. This issue aims to pass these auto-instrumented spans from the native layers to the hybrid SDKs.

We (@krystofwoldrich and @philipphofmann) hacked together a POC for HTTP spans from Cocoa to RN. You can visit the code on Cocoa and RN and the internal Notion doc. The approach we chose is to keep HTTP spans in a cache on Cocoa and request these spans from RN when a transaction finishes.

Hybrid SDKs only add spans from the native SDKs for transactions bound to the scope. The hybrid SDKs have to communicate to the native SDKs when to start collecting spans, which is when they start a transaction bound to the scope. When the hybrid SDKs finish a transaction, they tell the native SDK to stop collecting spans, request them, and put them on the hybrid transaction.

This approach is future-proof considering single-span ingestion, as active spans will behave as transactions bound to the scope.

Related RFC: getsentry/rfcs#131.

Open todos

  • Write Gherking scenarios
  • Should hybrid SDKs wait for unfinished spans?
  • Create tasklist for creating issues for all the SDKs
  • Clarify if this approach works on Android
  • How and if the hybrid SDKS should establish a parent-child relationship for the spans
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant