-
Notifications
You must be signed in to change notification settings - Fork 821
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
Use buffer instead string for traceId and spanId #698
Comments
I'nm not in favor of adding a dedicated class/interfaces for that because i feel it had much complexity that isnt needed there, i would prefer a consensus on one way to create/store those values. Buffer are fine for me. |
If we go this route, we should use Have you thought about the need to serialize / deserialize these in trace headers for HTTP? I guess I'm not totally convinced that all use cases would benefit from our in-memory representation being an ArrayBuffer. |
Serialization of trace headers happens only on process entry/exit. Some protcols may need the buffer representation not string like HTTP - maybe to get a more compact/efficient result. Each process entry/exit is also represented by a Span which usually needs to be exported. |
see #786 |
The fields
traceId
andspanId
inSpanContext
are of typestring
formatted as hex. This requires several conversions:I think it would be more efficient to avoid most of these conversions by keeping the buffer and convert to string only for logging/propagation as string.
Or is there a special reason for using a string?
Another option would be to hide this at all in a dedicated TraceId/SpanId class like e.g. in Java which would allow to hide the actual creation/storage at all and enable caching of different representations.
The text was updated successfully, but these errors were encountered: