-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Review HexString func on SpanID and TraceID #6514
Comments
@bogdandrutu just to clarify, are you suggesting that we rename |
Also |
We can use |
Right 👍 |
Yes, the idea was to use
Correct. |
@bogdandrutu can you also please clarify why we can't we keep |
Will be duplicate code, also not sure we are the entity to ensure "consistent representation". It is also different than the w3c representation since we don't represent empty as |
Also, https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/otlp.md#json-protobuf-encoding does not clarify how to represent empty IDs. |
So the concern is that we made a decision there, that is not based on any standard to represent empty ID as empty string, because of that I feel not good exposing this in a public function that others rely on. Will take long time to make a decision in specs, so better not to expose this as non "debug" only functionality. |
Ok, makes sense |
Feedback from reviewing contrib usages:
zap.String("trace_id", sp.TraceID()
, this has unnecessary overhead when the level is low (like Debug) since the conversion to string will happen. I would propose to offer aString()
method that can be used instead aszap.String("trace_id", sp.TraceID()
- not sure if we should return empty string for "empty" span, but we can debate that.HexString
is not empty string then use it. We can replace these with a check if the ID is not Empty then usehex.EncodeAsString(id[:])
.I am proposing the following plan:
String
func with the same behavior as currentHexString
which returns empty if the ID is empty and deprecate the currentHexString
.String()
func if possible for conversion, instead usehex.EncodeAsString
.The text was updated successfully, but these errors were encountered: