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

Propagates logs and reports 128-bit trace IDs #452

Merged
merged 1 commit into from
Nov 18, 2016

Conversation

codefromthecrypt
Copy link
Contributor

This supports 128-bit traces via a new field traceIdHigh, which matches
other zipkin implementations. In encoded form, the trace ID is simply
twice as long (32 hex characters).

With this change in, a 128-bit trace propagated will not be downgraded
to 64-bits when sending downstream, reporting to Zipkin or adding to
the logging context.

This will be followed by a change to support initiating 128-bit traces.

See openzipkin/b3-propagation#6

public Span(long begin, long end, String name, long traceId, List<Long> parents,
long spanId, boolean remote, boolean exportable, String processId) {
this(begin, end, name, traceId, parents, spanId, remote, exportable, processId,
null);
}

/**
* @deprecated please use {@link SpanBuilder}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

continuing to overload public ctors would become rediculous

* }</pre>
*
* @see #traceIdString()
* @since 1.2.0
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 think it is worthwhile to backport this to 1.0 and 1.1, even though it would be annoying. The reason is that these versions will be around a long time, and truncate trace ids perpetually unless we do..

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed

* }</pre>
*
* @see #traceIdString()
* @since 1.2.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed

@@ -68,7 +68,7 @@ public void inject(Span span, SpanTextMap carrier) {
}
carrier.put(Span.SAMPLED_NAME, span.isExportable() ?
Span.SPAN_SAMPLED : Span.SPAN_NOT_SAMPLED);
carrier.put(Span.TRACE_ID_NAME, Span.idToHex(span.getTraceId()));
carrier.put(Span.TRACE_ID_NAME, span.traceIdString());
Copy link
Contributor

Choose a reason for hiding this comment

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

I like the traceIdString method :)

This supports 128-bit traces via a new field traceIdHigh, which matches
other zipkin implementations. In encoded form, the trace ID is simply
twice as long (32 hex characters).

With this change in, a 128-bit trace propagated will not be downgraded
to 64-bits when sending downstream, reporting to Zipkin or adding to
the logging context.

This will be followed by a change to support initiating 128-bit traces.
@codefromthecrypt
Copy link
Contributor Author

changed since thing to 1.0.11

@codecov-io
Copy link

Current coverage is 75.09% (diff: 95.34%)

Merging #452 into master will increase coverage by 0.64%

@@             master       #452   diff @@
==========================================
  Files           140        140          
  Lines          3026       3056    +30   
  Methods           0          0          
  Messages          0          0          
  Branches        419        420     +1   
==========================================
+ Hits           2253       2295    +42   
+ Misses          588        578    -10   
+ Partials        185        183     -2   

Powered by Codecov. Last update c943e4c...1027cf4

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

Successfully merging this pull request may close these issues.

3 participants