Skip to content

Conversation

@slashmo
Copy link
Owner

@slashmo slashmo commented Nov 5, 2020

Still a draft because of missing documentation and the dependency on swift-otel/swift-w3c-trace-context#11.

@slashmo slashmo added the sampling Sampling label Nov 5, 2020
@slashmo slashmo self-assigned this Nov 5, 2020
Copy link
Contributor

@ktoso ktoso left a comment

Choose a reason for hiding this comment

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

Is this how other tracers implement this? A bit sneaky but looks good overall :)

@slashmo
Copy link
Owner Author

slashmo commented Nov 6, 2020

Is this how other tracers implement this? A bit sneaky but looks good overall :)
@ktoso

“Some tracer implementations make use of the fact that in many tracing systems, the trace ID itself is a randomly generated number and can be used to avoid making a second call to the random number generator, in order to reduce the overhead:”

Excerpt From: “Mastering Distributed Tracing”. Apple Books.

It's what get's recommended in the Mastering Distributed Tracing book and is also being used in the Java Jaeger client and OpenTelemetry Swift.

@ktoso
Copy link
Contributor

ktoso commented Nov 6, 2020

Yeah, okey then.

I know some tracers use parts of that number to hardcode information (I think xray does, not sure if lower or higher) but seems jaeger doesn't so it's a full nice random number :)

LGTM

@slashmo slashmo marked this pull request as ready for review November 6, 2020 11:08
@slashmo slashmo merged commit 4d4a132 into main Nov 6, 2020
@slashmo slashmo deleted the feature/probabilistic-sampler branch November 6, 2020 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sampling Sampling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants