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

Expose OpenTelemetry span and trace ID #1869

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

devgianlu
Copy link

Goal

Expose an API to access the OpenTelemetry trace and span IDs. This allows greater flexibility when integrating with custom observability components. For example, this allows us to create traceparent headers for distributed tracing.

Testing

Not much to test.

@devgianlu devgianlu requested a review from a team as a code owner February 6, 2025 12:36
@bidetofevil bidetofevil self-assigned this Feb 6, 2025
@bidetofevil
Copy link
Collaborator

Hi @devgianlu - thanks for your contribution!

If you are looking for the traceId from the Android SDK, you can get it via an attribute on the EmbraceSpan object that is returned, so I suspect you are trying to use it through one of our other SDKs, like Unity or Flutter?

If that's the case, the idea is to expose it through that, as those SDKs should have access to that information already.

Or do you really need to look up a traceId based solely on the spanId no other references?

@devgianlu
Copy link
Author

You are correct, the work is mainly focused on getting access to trace and span IDs from the Flutter SDK. The complementary work can be found here (iOS only, no Android).

While for iOS I was able to get them directly without changing the platform specific SDK, I was not able to do so for Android thus the addition of these accessors, but I might have missed something.

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

Successfully merging this pull request may close these issues.

2 participants