Skip to content

RUM-16331: Add integration test for cross-product trace sampling rebasing#3464

Merged
hamorillo merged 1 commit into
developfrom
hector.morilloprieto/RUM-16331
May 26, 2026
Merged

RUM-16331: Add integration test for cross-product trace sampling rebasing#3464
hamorillo merged 1 commit into
developfrom
hector.morilloprieto/RUM-16331

Conversation

@hamorillo

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds TraceCrossProductSamplingTest in reliability/single-fit/okhttp/ with 13 integration tests that verify the rebased effective sample rate (traceSampleRate × sessionSampleRate / 100) is correctly applied end-to-end through both SDK entry points that wire SessionRebasedSampler.

Motivation

Follow-up to RUM-15138 (PR #3402). Originated from this review comment.

Additional Notes

Test structure (13 tests):

  • DatadogInterceptor — 6 curated boundary tests (rebased keep/drop, rebasing changes outcome vs raw rate, sessionRate=100/0 edges, traceRate=0 edge).
  • ApmNetworkInstrumentationConfiguration with headerPropagationOnly — 3 curated boundary tests.
  • No-RUM-session fallback to raw trace rate — 2 negative controls.
  • Aggregate effective-rate validation across 1000 random sessions per (traceRate, sessionRate) pair — 2 statistical tests (one per entry point).

Determinism approach: Curated session UUIDs are pre-computed from the Knuth-hash math in DeterministicSampler, yielding exact sampled/dropped outcomes without statistical tolerance. Aggregate tests use Forge-seeded random tokens with ±5pp tolerance.

Observation channel: Both rebased paths drop the client-side span (DatadogInterceptor.canSendSpan = false when RUM is registered; headerPropagationOnly drops by design), so assertions target the propagated x-datadog-sampling-priority request header via MockWebServer.

No production code changes. Test-only PR.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

@hamorillo
hamorillo marked this pull request as ready for review May 21, 2026 10:47
@hamorillo
hamorillo requested review from a team as code owners May 21, 2026 10:47

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5850a5daff

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@hamorillo
hamorillo force-pushed the hector.morilloprieto/RUM-16331 branch from 5850a5d to 9f7ae98 Compare May 21, 2026 11:16
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.17%. Comparing base (057365c) to head (9f7ae98).
⚠️ Report is 4 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3464      +/-   ##
===========================================
- Coverage    72.31%   72.17%   -0.14%     
===========================================
  Files          964      964              
  Lines        35500    35500              
  Branches      5897     5897              
===========================================
- Hits         25670    25621      -49     
- Misses        8237     8274      +37     
- Partials      1593     1605      +12     

see 34 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hamorillo
hamorillo merged commit 46d5a1a into develop May 26, 2026
27 checks passed
@hamorillo
hamorillo deleted the hector.morilloprieto/RUM-16331 branch May 26, 2026 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants