OTel: Sampling support
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- python
- Domain
- observability
Research direction
Read the OTel integration described in #189 and inspect how the BatchSpanProcessor and OTEL_TRACING_EXCLUDED_URL_PATHS are configured. Compare the collector-side and SDK-side options in this issue, then confirm the production sampling approach and its configuration or documentation. Done means the chosen approach is agreed and its required project changes are complete.
Written by the indexing model from the issue text.
Description
Currently, the OTel integration (#189) uses the default ParentBasedAlwaysOn sampler — 100% of traces are captured. This is fine for initial rollout but we should add configurable sampling for production use.
Options to consider
- Collector-side tail-based sampling — keep errors and slow requests, drop routine 200s. No code changes needed, just collector config. This should be the first approach, and implies no code changes.
- SDK-side head sampling — e.g.
TraceIdRatioBased(0.1)for 10% sampling. Reduces overhead on the API process. Useful at very high request volumes. - Per-route sampling — different rates for different endpoints (e.g. 100% for webhooks, 1% for feature flags evaluation).
Context
- The
BatchSpanProcessoris lightweight, so SDK-side sampling is unlikely to be needed until high request volumes. - Health/readiness endpoints are already excluded via
OTEL_TRACING_EXCLUDED_URL_PATHS. - This is also relevant for eventually replacing Sentry SDK tracing with OTel-native tracing.
Related: #182
- Dominant language
- Python
- Stars
- 2
- Forks
- 4
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 10
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Flagsmith/flagsmith-common
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Flagsmith/flagsmith-common#250 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Flagsmith/flagsmith-common#198 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Flagsmith/flagsmith-common#254 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Flagsmith/flagsmith-common#252 ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
Flagsmith/flagsmith-common#245 ·
All issues in Flagsmith/flagsmith-common
Similar issues
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
simonw/sqlite-utils#872 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100