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

Should SpanContext use Java toTraceId/toSpanId signature? #109

Open
austinlparker opened this issue Oct 15, 2018 · 2 comments
Open

Should SpanContext use Java toTraceId/toSpanId signature? #109

austinlparker opened this issue Oct 15, 2018 · 2 comments

Comments

@austinlparker
Copy link
Member

(Conversation forked from opentracing/specification#123 (comment))

The recently-merged Trace Identifier RFC to the Java library chose to implement Trace Identifiers differently (see opentracing/opentracing-java#280 for more) - essentially, rather than as a property on their span context, they add a toTraceId and toSpanId method. The rationale for this is to indicate that this action will perhaps cause memory allocations as Tracers would need to convert from their current in-memory representation to a string.

Should the C# library change as well?

@cwe1ss
Copy link
Member

cwe1ss commented Oct 15, 2018

I have mixed feelings about this. It's important to stick to the spec but it's also important to not break stuff for "trivial" reasons - especially on the instrumentation/app side.

While the "to"-prefix in Java definitely indicates the potential allocations, it was also chosen (AFAIK) because existing tracers already used the initially proposed "traceId" name. We do not have this problem in C#.

So I'm undecided and looking forward to other opinions!

@austinlparker
Copy link
Member Author

My immediate thought is that we could easily extend the XML doc to indicate that calling TraceId/SpanId could trigger a conversion from whatever-to-string and may have performance impacts; We could also just note it in the README somewhere. Given that we're in technical compliance with the RFC as its written today, I'm generally against changing the interface but in favor of clarifying XML doc/general documentation comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants