specification icon indicating copy to clipboard operation
specification copied to clipboard

RFC: Trace Identifiers

Open tedsuo opened this issue 6 years ago • 13 comments

This is the Tracking issue for the Trace Identifiers RFC.

Proposal: https://github.com/opentracing/specification/blob/master/rfc/trace_identifiers.md

Summary

The OpenTracing SpanContext interface is extended to include SpanID and TraceID accessors.

The OpenTracing model of computation specifies two primary object types, Spans and Traces, but does not specify identifiers for these objects. Identifiers for the two primary object types make it easier to correlate tracing data with data in other systems, simplify important tasks, and allow the creation of reusable trace observers.

Current Status

Work is ready to begin, but there is one final bikeshed to paint: what to call these methods. SpanID and TraceID are the ideal names. However, these method names are already in use by some tracers, but with more specialized return types. Adding them to the SpanContext interface risks causing collisions and potentially creating breaking changes for some tracers. Using a slightly different method name would reduce the chance of a collision, at the expense of being... not TraceID or SpanID. Once we pick a satisfactory term, we can quickly add this feature to all of the OpenTracing APIs.

Let's debate naming conventions on gitter and see if we can get consensus.

Related Issues and Discussions

  • [x] RFC https://github.com/opentracing/specification/blob/master/rfc/trace_identifiers.md
  • [ ] Go https://github.com/opentracing/opentracing-go/issues/188
  • [x] Java https://github.com/opentracing/opentracing-java/pull/280
  • [x] Javascript https://github.com/opentracing/opentracing-javascript/pull/120
  • [ ] Python

tedsuo avatar Jul 11 '18 00:07 tedsuo

We may want to consider unwrapping as part of the same RFC. Typecasting will no longer be reliable if OpenTracing middleware becomes common.

Relevant Issues and PRs

  • https://github.com/opentracing/opentracing-java/issues/282
  • https://github.com/opentracing/opentracing-java/pull/211

tedsuo avatar Jul 12 '18 23:07 tedsuo

For reference, this was added to the C# Tracer in https://github.com/opentracing/opentracing-csharp/pull/96

austinlparker avatar Oct 15 '18 16:10 austinlparker

@austinlparker Wondering if the names should be updated to the latest that the Java API has (ToTraceId() and ToSpanId()) - something to consider ;)

carlosalberto avatar Oct 15 '18 16:10 carlosalberto

I don’t think it’d really be idiomatic C#; TraceId and SpanId are both accessed via getter auto-properties on ISpanContext, which is imo where I’d expect them to be in C#.

On Mon, Oct 15, 2018 at 12:38 PM Carlos Alberto Cortez < [email protected]> wrote:

@austinlparker https://github.com/austinlparker Wondering if the names should be updated to the latest that the Java API has (ToTraceId() and ToSpanId()) - something to consider ;)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/opentracing/specification/issues/123#issuecomment-429925629, or mute the thread https://github.com/notifications/unsubscribe-auth/AD8uxIXtNmEpASTZxlegRQorPgiwjAC9ks5ulLoBgaJpZM4VKTPA .

austinlparker avatar Oct 15 '18 18:10 austinlparker

The to prefix signals that this these may not be simple properties but some implementations have to convert their internal representation to strings which results in memory allocations.

On Mon 15. Oct 2018 at 20:26, Austin Parker [email protected] wrote:

I don’t think it’d really be idiomatic C#; TraceId and SpanId are both accessed via getter auto-properties on ISpanContext, which is imo where I’d expect them to be in C#.

On Mon, Oct 15, 2018 at 12:38 PM Carlos Alberto Cortez < [email protected]> wrote:

@austinlparker https://github.com/austinlparker Wondering if the names should be updated to the latest that the Java API has (ToTraceId() and ToSpanId()) - something to consider ;)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub < https://github.com/opentracing/specification/issues/123#issuecomment-429925629 , or mute the thread < https://github.com/notifications/unsubscribe-auth/AD8uxIXtNmEpASTZxlegRQorPgiwjAC9ks5ulLoBgaJpZM4VKTPA

.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/opentracing/specification/issues/123#issuecomment-429963156, or mute the thread https://github.com/notifications/unsubscribe-auth/ACEDCOYoN_p7iNczN_j5R1zj6OKbk7xYks5ulNNsgaJpZM4VKTPA .

felixbarny avatar Oct 15 '18 18:10 felixbarny

I've forked this convo into the C# repo so we don't clog up this thread.

austinlparker avatar Oct 15 '18 18:10 austinlparker

I really like this idea. Right now the fact that SpanContext is essentially empty in the opentracing interface is a little strange and leaves open too many things. Something like traceId and spanId accessors with common naming would be wonderful to put in this interface.

codeman9 avatar Nov 14 '18 15:11 codeman9

any movement on this?

ghostsquad avatar Jun 25 '20 06:06 ghostsquad

Also curious about this one - with new tools like Grafana's Tempo that can correlate logs to traces and take you straight to the trace view from the log viewer, I definitely want to log the trace ID for that purpose.

jsvensson avatar Dec 11 '20 16:12 jsvensson

I updated the status in the description - it's implemented in Java/JS only. The RFC was approved, but the spec was not updated.

Unlikely to see much traction here since all efforts moved to OpenTelemetry.

yurishkuro avatar Dec 11 '20 16:12 yurishkuro

Thanks for the update! We don't yet have any tracing where I work, but I'm trying to champion it and get it going. I've experimented with both OpenTracing and OpenTelemetry, but thus far I've leaned towards OpenTracing due to otel-go not yet having a stable enough API. I think we can manage that though.

jsvensson avatar Dec 11 '20 18:12 jsvensson