Conversation
the default sampling is now 25% but can be changed via --otel-trace-sampling-rate=0.1 or UNKEY_OTEL_TRACE_SAMPLING_RATE=0.8
|
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
📝 WalkthroughWalkthroughThis change introduces a new configuration option for OpenTelemetry trace sampling across both documentation and code. A new property/flag—accepting a float value between 0.0 and 1.0 with a default of 0.25—is added to control trace sampling. The configuration updates span documentation, the API configuration struct, command-line flags, and the telemetry initialization logic for Grafana. The sampler setup now selects between always, never, or parent-based strategies based on this sampling rate. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI
participant Config
participant RunFunction
participant OtelModule
User->>CLI: Provide flag (otel-trace-sampling-rate)
CLI->>Config: Set OtelTraceSamplingRate (default 0.25 if not provided)
Config->>RunFunction: Construct configuration with TraceSampleRate
RunFunction->>OtelModule: Call InitGrafana(config)
OtelModule->>OtelModule: Configure sampler based on TraceSampleRate
OtelModule-->>RunFunction: Telemetry initialized with appropriate sampler
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (5)
⏰ Context from checks skipped due to timeout of 90000ms (5)
🔇 Additional comments (10)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Thank you for following the naming conventions for pull request titles! 🙏 |
imeyer
left a comment
There was a problem hiding this comment.
LGTM
small q/nit: does cmd.Float handle conversion properly? If we pass --otel-trace-sampling-rate=ALL, will it fail because that's clearly a string? I RTFC for the cli package and it looks like we're covered. Might want to have a test for the config options at some point. 😄
|
that should return an error, cause it’s not parseable as a float |
|
|
yeah it fails correctly @imeyer |
the default sampling is now 25% but can be changed via
--otel-trace-sampling-rate=0.1 or
UNKEY_OTEL_TRACE_SAMPLING_RATE=0.8
Summary by CodeRabbit
New Features
Documentation