opentelemetry-java icon indicating copy to clipboard operation
opentelemetry-java copied to clipboard

Traceid compatible brave

Open JathonKatu opened this issue 1 year ago • 3 comments

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: <dependency> <groupId>com.github.kristofa</groupId> <artifactId>brave-http</artifactId> <version>3.5.0</version> </dependency> and i use opentelemetry maven coordinate is: <dependency> <groupId>io.opentelemetry</groupId> <artifactId>opentelemetry-api</artifactId> <version>1.32.0</version> </dependency>

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 avatar Jan 23 '24 04:01 JathonKatu

worry pls help me

JathonKatu avatar Jan 23 '24 04:01 JathonKatu

my old application trace is use zipkin

JathonKatu avatar Jan 23 '24 09:01 JathonKatu

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). 😁

breedx-splk avatar Jan 26 '24 00:01 breedx-splk