Skip to content

feat(ci_visibility): dynamic atr retries - #12467

Draft
gnufede wants to merge 2 commits into
masterfrom
gnufede/dynamic-atr-retries
Draft

feat(ci_visibility): dynamic atr retries#12467
gnufede wants to merge 2 commits into
masterfrom
gnufede/dynamic-atr-retries

Conversation

@gnufede

@gnufede gnufede commented Sep 11, 2026

Copy link
Copy Markdown
Member

Motivation

Add dynamic Auto Test Retries (ATR) budgets based on test duration, instead of the flat per-test retry limit. When enabled, the number of retries allowed for a test is determined by the duration of its initial attempt, using the same duration buckets as Early Flake Detection (5s / 10s / 30s / 5m / >5m).

Two new env vars control the behavior:

  • DD_CIVISIBILITY_DYNAMIC_ATR_ENABLED — enables duration-based ATR budgets. When unset/false, ATR stays on its existing flat-limit path.
  • DD_CIVISIBILITY_DYNAMIC_ATR_BUCKETS — optionally overrides the five duration-based retry budgets with five positive comma-separated integers in [1, 20]. When unset/empty, the EFD retry settings from the backend are used.

The new handler classifies each test once (by its initial-attempt duration) and caches the resulting max-retries count for the lifetime of that test. The duration bucket index is computed via shared helpers on the EFD settings type, so bucket boundaries stay consistent with EFD (the existing EFD retry handler is refactored to use them too).

Telemetry: records a dynamic_atr_retries.enabled count metric with a has_custom_buckets tag when dynamic ATR is enabled.

Feature parity with dd-trace-py PR #20028.

Add dynamic Auto Test Retries (ATR) budgets based on test duration,
instead of the flat per-test retry limit. When enabled, the number of
retries allowed for a test is determined by the duration of its initial
attempt, using the same duration buckets as Early Flake Detection
(5s / 10s / 30s / 5m / >5m).

Two new env vars control the behavior:
- DD_CIVISIBILITY_DYNAMIC_ATR_ENABLED — enables duration-based ATR
  budgets. When unset/false, ATR stays on its existing flat-limit path.
- DD_CIVISIBILITY_DYNAMIC_ATR_BUCKETS — optionally overrides the five
  duration-based retry budgets with five positive comma-separated
  integers in [1, 20]. When unset/empty, the EFD retry settings from
  the backend are used.

The new handler classifies each test once (by its initial-attempt
duration) and caches the resulting max-retries count for the lifetime
of that test. The duration bucket index is computed via shared helpers
on the EFD settings type, so bucket boundaries stay consistent with EFD
(the existing EFD retry handler is refactored to use them too).

Telemetry: records a `dynamic_atr_retries.enabled` count metric with a
`has_custom_buckets` tag when dynamic ATR is enabled.

Feature parity with dd-trace-py PR #20028.
@datadog-official

This comment has been minimized.

@dd-octo-sts

dd-octo-sts Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 14.69 s 14.60 s [-0.2%; +1.4%] (no difference)
startup:insecure-bank:tracing:Agent 13.56 s 13.74 s [-2.2%; -0.3%] (maybe better)
startup:petclinic:appsec:Agent 17.01 s 16.85 s [+0.0%; +1.9%] (maybe worse)
startup:petclinic:iast:Agent 16.87 s 16.86 s [-1.1%; +1.2%] (no difference)
startup:petclinic:profiling:Agent 16.07 s 16.73 s [-9.4%; +1.5%] (unstable)
startup:petclinic:sca:Agent 16.89 s 16.69 s [+0.1%; +2.2%] (maybe worse)
startup:petclinic:tracing:Agent 16.09 s 15.70 s [-2.1%; +6.9%] (no difference)

Commit: 9d5eaeee · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

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.

1 participant