opencensus-go icon indicating copy to clipboard operation
opencensus-go copied to clipboard

SpanID is not random

Open rghetia opened this issue 5 years ago • 1 comments

Make SpanID random, similar to open-telemetry

/cc @odeke-em

rghetia avatar May 18 '20 17:05 rghetia

Thank you for following up with this bug @rghetia! For context behind it, over the weekend, I noticed that one of my services of ~30K QPS was erroring out with calls about 10 seconds apart, when writing spans to my backend from various sources, and alas clashing spanIDs were found.

The OpenCensus Specs say that SpanID MUST be globally unique per https://github.com/census-instrumentation/opencensus-specs/blob/master/trace/Span.md/#SpanId 57D221F2-F3B7-410E-B88E-6E38EB4F993E and so in my schema was relying on this, but for safety should perhaps have the (TraceID, SpanID) combination as the unique key.

We’ll perhaps need to fix this bug because high throughput applications are most definitely having their spans corrupted but their backends might not be enforcing these checks immediately or at least might be asynchronously processing uploaded spans.

odeke-em avatar May 19 '20 01:05 odeke-em