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

How should other forms of trace/span ids be handled? #525

Open
pauldraper opened this issue Mar 24, 2020 · 10 comments
Open

How should other forms of trace/span ids be handled? #525

pauldraper opened this issue Mar 24, 2020 · 10 comments
Labels
area:api Cross language API specification issue release:after-ga Not required before GA release, and not going to work on before GA spec:trace Related to the specification/trace directory

Comments

@pauldraper
Copy link

pauldraper commented Mar 24, 2020

In OpenTracing, there was no requirement for trace and span ids. It was chosen by the tracer implementation.

For example, Datadog uses 64-bit integers as span and trace ids.

Any preferences/ideas for working with backends that use different ids from OpenTelemetry?

@Oberon00
Copy link
Member

Oberon00 commented Mar 26, 2020

64 bit is "easy", pad with zeroes. I think any other forms of span-IDs are not really supported by OpenTelemetry, which I think is a shame but difficult to change now. I recommend you to read open-telemetry/oteps#58 "Unseal SpanContext" and in particular open-telemetry/oteps#58 (comment):

You need to have guarantees of the length and format [of a trace/span ID] in some case, even for logging. I think this was discussed as a requirement for OpenTelemetry from the beginning and cannot be changed.

-- @bogdandrutu

@pauldraper
Copy link
Author

64 bit is "easy", pad with zeroes.

Or truncate in the case of 128-bit trace IDs?

@Oberon00
Copy link
Member

OpenTelemetry does use 128 bit trace IDs. 128 bit Span IDs on the other hand would be a problem. You can shoehorn them in the tracestate however.

@pauldraper
Copy link
Author

pauldraper commented Mar 29, 2020

Sorry, I meant I need to truncate OpenTelemetry trace IDs (128-bit) when exporting to Datadog (64-bit).

I suppose I could add an attribute trace.id with the full trace id.

I don't see anything necessarily wrong with this; just posting here in case I'm getting it wrong.

@Oberon00
Copy link
Member

Oberon00 commented Mar 29, 2020

I could add an attribute

That is not possible in statically typed languages like Java (again, see open-telemetry/oteps#58) and I think that is indeed a problem and may become a serious bottleneck of flexibility for vendors wanting to support the API.

@Oberon00
Copy link
Member

Oberon00 commented Mar 29, 2020

I feel like with the OTEP 66 Context API there is an opportunity to elegantly rectify this by removing the whole SpanContext from the API and hiding it away in the context. See

EDIT: And the often-mentioned OTEP66: https://github.com/open-telemetry/oteps/blob/master/text/0066-separate-context-propagation.md "Context Propagation: A Layered Approach" (open-telemetry/oteps#66) by @tedsuo, recently mostly driven by @carlosalberto

@bogdandrutu bogdandrutu added the spec:trace Related to the specification/trace directory label Jun 12, 2020
@carlosalberto carlosalberto added the area:api Cross language API specification issue label Jun 26, 2020
@carlosalberto carlosalberto added the release:after-ga Not required before GA release, and not going to work on before GA label Jul 23, 2020
@Oberon00
Copy link
Member

Oberon00 commented Aug 6, 2020

Hi! I see this has the after-ga label. But I think if we have this after-ga, we may as well close it as "wontfix", because I feel like this would be a breaking change. @carlosalberto

@carlosalberto
Copy link
Contributor

@Oberon00 So your take is that we should try to work on this before GA instead?

@Oberon00
Copy link
Member

Oberon00 commented Aug 6, 2020

I'm not sure. I think we could make the decision not to support this. Otherwise it would be a pretty fundamental change.

@tonglil
Copy link

tonglil commented Feb 24, 2022

Is this still something that is being thought on?

I've noticed that DD uses the last 64 bits from the 128 bits OTel uses.
https://docs.datadoghq.com/tracing/connect_logs_and_traces/opentelemetry/
https://go.dev/play/p/pUBHcLdXJNy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:api Cross language API specification issue release:after-ga Not required before GA release, and not going to work on before GA spec:trace Related to the specification/trace directory
Projects
None yet
Development

No branches or pull requests

5 participants