-
Notifications
You must be signed in to change notification settings - Fork 849
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
Duplicate Trace ID #1531
Comments
I don't think this has anything to do with the name. Probably the seed or algorithm of the RNG is bad. |
We're using ThreadLocalRandom for the id generation, by default. Is Android's implementation of TLR bad? You might need to replace the IdGenerator implementation for Android, perhaps? |
@jam0cam can you solve your issue here by implementing a custom IdGenerator? |
I was, thanks for the suggestion |
good to hear! closing this issue. |
@jam0cam : What custom IdGenerator did you use ? Is it possible for you to share that ? |
More recent versions of the SDK will detect if you're on Android and fall back to one that works. You shouldn't need to use a custom id generator any more. |
@jkwatson : Do you know from which version of SDK this issue is fixed ? |
https://github.com/open-telemetry/opentelemetry-java/releases/tag/v1.2.0 |
@jkwatson I am still seeing the same duplicate trace id in android in v 1.11.0 |
Can you show how you're configuring your SDK? |
I have created a singleton class in kotlin for SDK configuration in android @jkwatson |
Nothing looks amiss there to me. At Splunk, we're using OTel in our Android instrumentation and it's working 100% fine. I wonder if there's something odd you're doing with the Context that is keeping a span around as a parent in the Context that you aren't expecting. Could you put together a simple sample application that reproduces the issue you're seeing? Here's the Splunk repository, which includes a sample app that does work (and you can point it at zipkin, or just look at the output of debug logs to prove it): https://github.com/signalfx/splunk-otel-android |
Here is a sample app repo: https://github.com/yadavraju/DisneyCodeChallenge could you please have a look? I am totally new to opentelimetry |
It looks like you're holding onto spans for the lifetime of each activity and re-using as the parent of other spans over and over. Each of those spans will have the same trace id, because the parent span is constant and has that trace id. You can't re-use parents like that, unless you want them to all be part of the same trace. |
@jkwatson I tried to use Splunk library code. How can I add child span in my view model class when adding all the space added to single traces. similar to this image It happens when I open the same activity multiple times from the previous activity by going back and coming again. I want to create different traces every time I open an activity (it's adding to the same traced: there is now 59 traces in images)
|
@jam0cam I recommend learning how the OpenTelemetry tracing system works, using something simple like a This is definitely not the forum to try to debug something as complex as you're trying to do. You will probably need to dig deep and debug what's happening in your case, once you have a strong understanding of how OTel works. |
Describe the bug
In traces where the same name is used, I sometimes get the same trace id. This happens over different app launches. See the screenshots, some duplication is almost an hour apart.
Steps to reproduce
Normal usage should produce this. I have about 15-20 unique traces throughout my app, and I would see duplicates among some of those traces.
What version and what artifacts are you using?
io.opentelemetry:opentelemetry-sdk:0.7.0
io.opentelemetry:opentelemetry-exporters-zipkin:0.6.0
Environment
Android emulator, API 28
Additional context
on a basic level, this how the trace is done:
Screenshots from honeycomb
The text was updated successfully, but these errors were encountered: