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

Makes traceIdHigh convertable to AWS X-Ray #509

Merged
merged 1 commit into from
Oct 5, 2017

Conversation

codefromthecrypt
Copy link
Member

This customizes the trace ID generator to make the high bits convertable
to Amazon X-Ray trace ID format v1.

See openzipkin/zipkin#1754

@codefromthecrypt codefromthecrypt force-pushed the traceId128ForXray branch 2 times, most recently from 89f93f4 to 5c90955 Compare October 3, 2017 12:50
@codefromthecrypt
Copy link
Member Author

codefromthecrypt commented Oct 3, 2017

benchmarks suggest using a time component causes the high bits to generate an order of magnitude slower than a thread local random (present in JRE7).

IMHO, this is ok, as it only affects the root trace ID when that trace is generated locally (vs ingress). For example, the low bits of the trace ID and each span ID have the same generation time as before.

Benchmark                                                                 Mode  Cnt    Score    Error   Units
PlatformBenchmarks.high_contention                                       thrpt   15  272.382 ± 13.683  ops/us
PlatformBenchmarks.high_contention:high_contention_nextTraceIdHigh_jre6  thrpt   15    5.794 ±  0.422  ops/us
PlatformBenchmarks.high_contention:high_contention_nextTraceIdHigh_jre7  thrpt   15   32.511 ±  1.669  ops/us
PlatformBenchmarks.high_contention:high_contention_randomLong_jre6       thrpt   15    4.192 ±  0.312  ops/us
PlatformBenchmarks.high_contention:high_contention_randomLong_jre7       thrpt   15  229.886 ± 11.952  ops/us
PlatformBenchmarks.mild_contention                                       thrpt   15  269.789 ± 11.852  ops/us
PlatformBenchmarks.mild_contention:mild_contention_nextTraceIdHigh_jre6  thrpt   15    5.217 ±  0.286  ops/us
PlatformBenchmarks.mild_contention:mild_contention_nextTraceIdHigh_jre7  thrpt   15   31.566 ±  1.515  ops/us
PlatformBenchmarks.mild_contention:mild_contention_randomLong_jre6       thrpt   15    3.650 ±  0.486  ops/us
PlatformBenchmarks.mild_contention:mild_contention_randomLong_jre7       thrpt   15  229.356 ± 11.233  ops/us
PlatformBenchmarks.no_contention                                         thrpt   15  268.805 ± 18.881  ops/us
PlatformBenchmarks.no_contention:no_contention_nextTraceIdHigh_jre6      thrpt   15    6.246 ±  0.584  ops/us
PlatformBenchmarks.no_contention:no_contention_nextTraceIdHigh_jre7      thrpt   15   21.034 ±  1.475  ops/us
PlatformBenchmarks.no_contention:no_contention_randomLong_jre6           thrpt   15    7.231 ±  0.512  ops/us
PlatformBenchmarks.no_contention:no_contention_randomLong_jre7           thrpt   15  234.294 ± 16.603  ops/us

@codefromthecrypt
Copy link
Member Author

note: this impl uses longs because Brave 4 still stores 128-bit trace IDs as two uint64s. If this weren't the case, I would be generating a string instead.

@codefromthecrypt
Copy link
Member Author

Added end-to-end benchmarks. This change is not statistically significant vs even 64bit trace ID

Benchmark                                           Mode  Cnt    Score    Error  Units
EndToEndBenchmarks.server_get                       avgt   15  139.583 ± 13.145  us/op
EndToEndBenchmarks.traced128Server_get              avgt   15  161.412 ±  5.600  us/op
EndToEndBenchmarks.traced128Server_get_resumeTrace  avgt   15  163.578 ±  2.912  us/op
EndToEndBenchmarks.tracedServer_get                 avgt   15  160.815 ±  3.876  us/op
EndToEndBenchmarks.tracedServer_get_resumeTrace     avgt   15  167.266 ±  5.789  us/op
EndToEndBenchmarks.unsampledServer_get              avgt   15  153.577 ± 11.826  us/op

This customizes the trace ID generator to make the high bits convertable
to Amazon X-Ray trace ID format v1.
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

Successfully merging this pull request may close these issues.

1 participant