feat(otel): scaffold OTel consistent probability sampling (ot.th/ot.rv) conformance tests - #7372
feat(otel): scaffold OTel consistent probability sampling (ot.th/ot.rv) conformance tests#7372genesor wants to merge 21 commits into
Conversation
…v) conformance tests
|
|
🎉 All green!🧪 All tests passed 🔗 Commit SHA: 84fa876 | Docs | Datadog PR Page | Give us feedback! |
vpellan
left a comment
There was a problem hiding this comment.
I also believe that we should add tests for imprecision workaround while going from 64 to 56 bit (see the annex of the RFC about 64->56 bit imprecision)
|
|
||
| @scenarios.otel_sampling_rate_0_1 | ||
| @features.w3c_headers_injection_and_extraction | ||
| class Test_MalformedOtHandling: |
There was a problem hiding this comment.
For these cases, as we generate new th and rv, should th be derived from the sampling rate, and rv from the trace id last 56 bits?
There was a problem hiding this comment.
No, we do not do anything. We have no way of knowing how the decision was made upstream. We just to cleanup
|
There are a bunch of tests in assert len(tracestate_1_arr) == 1
assert tracestate_1_arr[0].startswith("dd=")into assert any(item.startswith("dd=") for item in tracestate_1_arr)The test are:
|
|
Good catch, fixed in 52e0d3a. Updated the 5 assertions across the 3 tests to Part 6 already falls into the "new Datadog span context" path, so the same fix covers it. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: efe7f14b08
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…estate-sampling-scaffolding # Conflicts: # manifests/rust.yml
Motivation
RFC for cross-tracer support of OTel consistent probability sampling (
ot.th/ot.rv) tracestate members across all 9 dd-trace-* SDKs (APMAPI-2171 distributed tracing, APMAPI-2172 trace export).Changes
Scaffolding only — every new test class is landed disabled for all 9 tracers via manifest entries (
missing_feature). No tracer implements this yet.tests/test_otel_tracestate_sampling.py(new): A1-A6 from APMAPI-2171Test_EmitOtOnProbabilityDecision_Rate0_{01,1,2,5,99}— golden-vector rv/th derivation at 5 fixed rates, crossed with the 23 trace IDs fromtests/fixtures/sampling_rates.csv, verified against the Go Knuth-hash sampler formulaTest_ForwardInboundOtUnchanged— inbound th/rv forwarded unchanged, never re-derivedTest_PreserveDdAndOtherVendors— ot= handling doesn't disturb dd= or unrelated vendor tracestate membersTest_ForceKeepClearsTh— a non-probability (force-keep, via ASM/waf) decision erases th but forwards an inherited rvTest_SampledWithoutOtNotFabricated— an inherited sampling decision with no ot= must not fabricate th/rvTest_MalformedOtHandling— malformed th/rv treated as absent, dd=/vendors preserved, trace never rejectedtests/otel/test_tracing_otlp.py: B1/B2 from APMAPI-2172 —Test_Otlp_Carries_Ot,Test_Otlp_Forwards_Inherited_Ot, asserting on the exported OTLP span'straceStateutils/_context/_scenarios/__init__.py: 4 new fixed-rate scenarios (otel_sampling_rate_0_{01,1,2,99}); rate 0.5 reuses the existingsamplingscenariomanifests/*.yml(all 9 languages):missing_feature (APMAPI-2171)/(APMAPI-2172)entries for every new classWorkflow
Reviewer checklist
tests/ormanifests/is modified ? I have the approval from R&P team (note:utils/_context/_scenarios/__init__.pyis modified to add the 4 new scenarios)