The package exposes one knob for trace sampling:Documentation Index
Fetch the complete documentation index at: https://sedataai.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
samplingRate. It maps
directly to OpenTelemetry’s TraceIdRatioBasedSampler.
How it works
TraceIdRatioBasedSampler(rate) keeps a deterministic fraction of traces by
hashing the trace id. Same trace → same decision across services, which keeps
distributed traces consistent.
| Rate | Kept |
|---|---|
1.0 | 100% (default) |
0.5 | ~50% |
0.1 | ~10% |
0.01 | ~1% |
0 | none (sampler off) |
Setting it
ConfigValidator rejects anything outside [0, 1]:
What gets sampled
| Signal | Sampled by samplingRate? |
|---|---|
| Spans (traces) | ✅ |
| Metrics | ❌ — metrics are aggregations, sampling doesn’t apply |
| Safety-check API calls | ❌ — every call to a safetyCheck-wrapped handler hits the API |
Recommended starting points
Local dev
samplingRate: 1.0 — see everything.Staging
samplingRate: 1.0 — keep volume comparable to prod’s signal-to-noise.Production
samplingRate: 0.1–0.25 — adjust by tool volume and storage budget.Tail sampling instead?
samplingRate is head-based — the decision is made when the trace starts.
If you want to keep all errored traces while dropping most successes, you’ll
want tail sampling, which lives in an OpenTelemetry Collector, not the
SDK. Point exporterEndpoint at a collector with the tail_sampling
processor configured.
otel-collector.yaml
@sedata-ai/mcp with samplingRate: 1.0 so the collector receives
everything and makes the call.
Disabling tracing entirely
If you want metrics-only:Next
Telemetry pipeline
Where samplers fit in the broader export path.
Production deployment
Pre-flight checklist for prod.