Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Export trace attributes and annotations properly to Jaeger #622

Merged
merged 1 commit into from
Mar 21, 2018

Conversation

rakyll
Copy link
Contributor

@rakyll rakyll commented Mar 21, 2018

Fixes #621.

Copy link
Member

@odeke-em odeke-em left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @rakyll, I have 1 request or rather 1 that changes about 3 things, PTAL.

name: "no parent",
data: &trace.SpanData{
SpanContext: trace.SpanContext{
TraceID: trace.TraceID{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you make this a 16 byte TraceID to conform with the usual? This is 15 bytes and it even produces Spans that have 15 byte SpanIDs and TraceIDs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha, you missed 12 in there :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, it was a mistake. Done.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That'll change the value of the TraceIDHigh, *Low, SpanID.
Let's also add tests to ensure that they TraceIDHigh is 8 bytes and same for TraceIDLow otherwise we'd never catch such discrepancies.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need a test for this. There might be trailing zeros. The trace ID was 16-bytes with a trailing zero which is still valid.

for k, v := range a.Attributes {
tag := attributeToTag(k, v)
if tag != nil {
fields = append(tags, tag)
fields = append(fields, tag)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch!

@rakyll
Copy link
Contributor Author

rakyll commented Mar 21, 2018

@odeke-em PTAL

Copy link
Member

@odeke-em odeke-em left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you @rakyll!

@rakyll rakyll merged commit 3e89604 into census-instrumentation:master Mar 21, 2018
@rakyll rakyll deleted the ja-bug branch March 21, 2018 20:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants