Repository navigation
Add sampling_rules_agent_rate regression test scenario - #7813
Conversation
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
|
🎉 All green!🧪 All tests passed 🔗 Commit SHA: 0b1f11b | Docs | View more details | Give us feedback! |
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
@DataDog review |
There was a problem hiding this comment.
The most critical blocker is that the new SAMPLING_RULES_AGENT_RATE scenario fails the repository scenario merge check, preventing the PR from merging. Additionally, the test setup uses fixed sleeps totalling ~60 seconds per affected run, which wastes CI time and risks timeouts on known-bug jobs for Python and older Java weblogs.
🤖 Bits Code Review · Commit b9e20cd · @DataDog review to ask questions
dd-trace-rs does not report agent-published sampling rates via _dd.agent_psr, causing test_agent_rate_applies_to_rule_miss to fail. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Cuts worst-case setup time from ~60s (15 bursts + 30s wait) to ~26s (8 bursts + 10s wait). Since bug/missing_feature manifest entries compile to xfail (not skip), setup still runs in full on jobs already known to fail, wasting CI time. Verified locally against nodejs (express4): the rate converges within 2 bursts, well under the new budget. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
dd-trace-java's dev builds report as 1.67.0-SNAPSHOT (versioning is derived from git tags, and v1.66.0 was cut on 2026-09-08). The existing "<1.67.0" boundary is strictly less than that snapshot per SemVer precedence, which the dev-mode sanity check (assert_versions_not_ahead_of_current) flags as "declared version ahead of current version" and aborts the entire pytest session before any test runs -- failing every java dev end-to-end job regardless of weblog. "<=1.67.0-SNAPSHOT" satisfies the dev-mode check (build metadata is ignored, so it's not considered ahead of the current snapshot) while still correctly classifying the current snapshot as buggy under the npm-style SemverRange used for actual xfail matching, and correctly excludes both the eventual 1.67.0 release and the next dev cycle (1.67.1-SNAPSHOT). Verified against Manifest.assert_versions_not_ahead_of_current and Manifest.get_declarations directly. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
@DataDog review |
There was a problem hiding this comment.
The setup method in tests/test_sampling_rules_agent_rate.py uses up to eight fixed 2-second sleeps plus a 10-second interface wait instead of framework-level event waiting, adding as much as 26 seconds of serialized delay per tracer run and making the scenario sensitive to flush timing.
🤖 Bits Code Review · Commit dfe30ec · @DataDog review to ask questions
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0b1f11b629
ℹ️ 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".
nccatoni
left a comment
There was a problem hiding this comment.
LGTM (for @DataDog/system-tests-core) but you should probably also get a review from someone familiar with the feature
Motivation
When
DD_TRACE_SAMPLING_RULESis configured without a catch-all rule, spans that don't match any rule fall back to the agent-driven rate-by-service sampler. That fallback should keep receiving the rates published by the agent — but a bug (fixed in dd-trace-java#12490) left it stuck at the default rate of 1.0 for the life of the process. This is a regression test to guard against that behavior across all tracers.Changes
tests/test_sampling_rules_agent_rate.py(Test_SamplingRulesAgentRate): configures a non-matching sampling rule, sends bursts of traffic, and asserts rule-miss spans eventually carry the agent-published_dd.agent_psrrate instead of the default 1.0.sampling_rules_agent_ratescenario inutils/_context/_scenarios/__init__.py, and wire it into.github/workflows/run-end-to-end.ymlalongside the existingsampling_rate_cappingstep.send_mocked_tracer_responses()inutils/proxy/mocked_response.py(used by bothtest_sampling_rate_capping.pyand the new test), typed withSequence[MockedTracerResponse]rather thanlist[...]for correct covariance.manifests/java.yml:bug (APMAPI-2506), scoped tocomponent_version: "<=1.67.0-SNAPSHOT"(the PR's fix milestone).manifests/python.yml:bug (APMAPI-2508), PR to fix it created but not merged yet.manifests/rust.yml:missing_feature, since dd-trace-rs does not report agent-published sampling rates via_dd.agent_psr.🤖 Generated with Claude Code