Skip to content

Conversation

@pratik-mahalle
Copy link
Contributor

@pratik-mahalle pratik-mahalle commented Jan 7, 2026

This PR adds a new "Custom samplers" section to the Go sampling documentation that provides guidance on creating custom samplers.

The current documentation only covers built-in samplers and lacks guidance on:

How to implement the Sampler interface
How SamplingResult should be handled to ensure correct context propagation
The critical importance of preserving tracestate from the parent span
This is especially important because an incorrectly implemented custom sampler can break distributed tracing by dropping or modifying tracestate and baggage.

Fixes:

Closes #7558

@pratik-mahalle pratik-mahalle requested a review from a team as a code owner January 7, 2026 14:24
@otelbot-docs otelbot-docs bot requested review from a team January 7, 2026 14:25
@github-actions github-actions bot added the sig:go label Jan 7, 2026
Signed-off-by: Pratik Mahalle <mahallepratik683@gmail.com>
@vitorvasc vitorvasc force-pushed the custom-samplers-clean branch from 86fbd5e to 65aab39 Compare January 8, 2026 10:38
@vitorvasc
Copy link
Member

/fix:refcache

@vitorvasc
Copy link
Member

/cc @open-telemetry/go-approvers PTAL!

@otelbot-docs
Copy link
Contributor

otelbot-docs bot commented Jan 8, 2026

fix:refcache applied successfully in run 20813970055.

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

Labels

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[Page Feedback]: Add guidance for custom samplers

2 participants