open-telemetry / opentelemetry-java

OpenTelemetry Java SDK
https://opentelemetry.io
Apache License 2.0
1.99k stars 829 forks source link

Traceid compatible brave #6168

Open JathonKatu opened 9 months ago

JathonKatu commented 9 months ago

Describe the bug: ihave a old application, it trace by brave , now time i will use opentelemetry on new application. But the traceId String size is tooLong about old application use package.

Steps to reproduce I have a old application use brave, maven coordinate is: `

com.github.kristofa brave-http 3.5.0 ` and i use opentelemetry maven coordinate is: ` io.opentelemetry opentelemetry-api 1.32.0 ` and it have "com.github.kristofa.brave.IdConversion#convertToLong" ,i use it convert String Type to Long Type.but it have a check param code `if (id.length() == 0 || id.length() > 16) { throw new NumberFormatException( id + " should be a <=16 character lower-hex string with no prefix"); }` but opentelemetry package:io.opentelemtry.api.trace.TraceId set traceId String.length = 32 how can i do this time... i have no idea ,pls help me
JathonKatu commented 9 months ago

worry pls help me

JathonKatu commented 9 months ago

my old application trace is use zipkin

breedx-splk commented 9 months ago

OpenTelemetry uses 16-byte trace IDs and 8 byte span IDs, which is consistent with the w3c trace context format for its default trace context propagation mechanism.

If you are using the OTel java api/sdk and wish to send traces using B3 context propagation, you can leverage the B3Propagator.

The version of Brave you are using is quite ancient (~8 years old, predates the OpenTelemetry project). 😁