Skip to content

Add configurable retry jitter to Go client - #784

Closed
dd-octo-sts[bot] wants to merge 1 commit into
mainfrom
datadog-api-spec/generated/6570
Closed

Add configurable retry jitter to Go client#784
dd-octo-sts[bot] wants to merge 1 commit into
mainfrom
datadog-api-spec/generated/6570

Conversation

@dd-octo-sts

@dd-octo-sts dd-octo-sts Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

@dd-octo-sts
dd-octo-sts Bot requested a review from a team as a code owner September 1, 2026 09:09
Comment thread src/formatter.rs
let envelope = build_agent_envelope(data, None)?;
return Ok(go_html_escape(&serde_json::to_string_pretty(&envelope)?));
}
fn print_yaml(data: &serde_json::Value) -> Result<()> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Restore the removed formatter functions

The CLI cannot build.

Assertion details
  • Input: Build the CLI with the default feature set.
  • Expected: The formatter must keep the functions that rate-limit code uses.
  • Actual: The compiler cannot find eprint_formatted or format_value_to_string. rate_limit.rs still calls both functions.

Was this helpful? React 👍 or 👎
🤖 Datadog Autotest · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest · Open Bits AI session

Comment thread src/downtimes.rs
command: Some("downtimes list".to_string()),
next_action,
};
formatter::format_and_print(&resp, &cfg.output_format, cfg.agent_mode, Some(&meta))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Pass the jq argument

The CLI cannot build.

Assertion details
  • Input: Build the CLI with the new downtime module.
  • Expected: Each call must pass the configured jq value or None.
  • Actual: Both new list functions pass four arguments to a function that requires five arguments.

Was this helpful? React 👍 or 👎
🤖 Datadog Autotest · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest · Open Bits AI session

Comment thread src/client.rs
let mut builder = ClientBuilder::new(reqwest_client)
.with(UserAgentMiddleware)
.with(RateLimitCaptureMiddleware);
let mut builder = ClientBuilder::new(reqwest_client).with(UserAgentMiddleware);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Keep SDK rate-limit capture

Users lose the data that they need to select a safe retry time.

Assertion details
  • Input: Run a typed SDK command that receives HTTP 429 with rate-limit headers.
  • Expected: The SDK middleware must store rate-limit headers for error output.
  • Actual: The SDK client no longer stores rate-limit response headers. A 429 error therefore has no rule, limit, remaining count, or reset value.

Was this helpful? React 👍 or 👎
🤖 Datadog Autotest · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest · Open Bits AI session

Comment thread src/formatter.rs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Print verbose rate-limit data

The --verbose option no longer provides its documented rate-limit output.

Assertion details
  • Input: Run a successful typed SDK command with --verbose.
  • Expected: A successful command with --verbose must also print rate-limit data to standard error.
  • Actual: The formatter prints only the command result. It no longer prints the captured rate-limit data.

Was this helpful? React 👍 or 👎
🤖 Datadog Autotest · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest · Open Bits AI session

Comment thread src/auth/types.rs
"apm_service_catalog_read",
"apm_service_ingest_read",
"appsec_vm_read",
"apps_run",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Keep the entity graph scopes

Entity graph users lose repository, code analysis, and vulnerability context.

Assertion details
  • Input: Use default or read-only OAuth login. Then query entity graph context that needs the removed scopes.
  • Expected: OAuth login must request the scopes that the entity graph commands require.
  • Actual: The default and read-only scope lists omit repo_info_read, code_analysis_read, and appsec_vm_read.

Was this helpful? React 👍 or 👎
🤖 Datadog Autotest · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest · Open Bits AI session

Comment thread src/client.rs
"v2.update_tag_rule",
// RUM Session Replay (1)
"v2.get_segments",
// Tag Policies (6)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Enable RUM segment retrieval

The RUM replay-segments command stops working for all users of that command.

Assertion details
  • Input: Run the RUM replay-segments command.
  • Expected: The client configuration must enable v2.get_segments.
  • Actual: The unstable operation list no longer enables v2.get_segments. The existing replay-segments command fails before it sends the request.

Was this helpful? React 👍 or 👎
🤖 Datadog Autotest · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest · Open Bits AI session

Comment thread src/downtimes.rs
.await
.map_err(|e| anyhow::anyhow!("failed to list_downtimes: {:?}", e))?;
let count = resp.data.as_ref().map_or(0, |d| d.len());
let truncated = false;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Report downtime pagination

Agents can treat a partial downtime list as a complete list.

Assertion details
  • Input: Use agent mode with a page limit that is less than meta.page.total_filtered_count.
  • Expected: The metadata must show truncation when the total count is greater than the returned page. It must provide a continuation action.
  • Actual: Both downtime list commands always set truncated to false. They also provide no next action.

Was this helpful? React 👍 or 👎
🤖 Datadog Autotest · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest · Open Bits AI session

@datadog-datadog-prod-us1 datadog-datadog-prod-us1 Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Datadog Autotest: FAIL

The patch cannot compile. It removes formatter functions that rate-limit code still calls, and both new list commands call format_and_print with too few arguments.

Open Bits AI session

🤖 Datadog Autotest · Commit c1aeb39 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Pipelines

Unblock PR with BitsAI

⚠️ Warnings

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 5 Pipeline jobs failed

CI | Check, Test & Coverage — 🔧 Needs a code fix, caused by this PR

View more details · View in GitHub Actions

Compilation errors: functions 'eprint_formatted' and 'format_value_to_string' not found in module 'formatter', and argument missing for 'format_and_print' in 'downtimes.rs'.

CI | Cross Compile (Linux) — 🔧 Needs a code fix, caused by this PR

View more details · View in GitHub Actions

Compilation error in src/rate_limit.rs:151: cannot find function eprint_formatted in module formatter.

CI | Cross Compile (Windows) — 🔧 Needs a code fix, caused by this PR

View more details · View in GitHub Actions

Compilation errors in src/rate_limit.rs and src/downtimes.rs: function 'eprint_formatted' not found and incorrect argument count in 'format_and_print'.

View all 5 failed jobs.

📋 Copy fix prompt
CI on my pull request is failing. Help me find and fix the root cause of each failing job below — they were flagged as caused by changes in this PR, so focus on the diff. For each job, explain the failure and propose a fix.

Before you start, set up the Datadog software-delivery tooling so you can
query the CI data yourself:

1. Check whether you already have the Datadog software-delivery MCP tools
   (e.g. a `search_datadog_ci_pipeline_events` tool) and the `unblock-pr` skill.
2. If either is missing, STOP and ask me for permission before installing
   anything. Do not install or run anything until I have said yes.
3. Only with my explicit approval, set up the Datadog software-delivery MCP
   server and skills by following:
     https://docs.datadoghq.com/getting_started/software_delivery_mcp_tools/
   then restart so the skill is picked up.
4. If I decline, skip all of the above and work from the context below alone.

Then run /unblock-pr — it will pull the CI data itself. The job context below is what we already know.

If /unblock-pr is not available — because I declined the setup above, or it did not install — work from the context below instead.

Datadog has already classified this failure as caused by changes in this PR.
Take that as given and work the fix:

1. Locate the change. Diff this branch against its base and find the change
   that produces this error. Explain the mechanism, don't just name a file:
     git fetch origin && git diff $(git merge-base origin/main HEAD)...HEAD
2. Reproduce it locally. Run the failing job's command or test before
   proposing anything.
3. Propose the smallest fix that addresses the root cause — not a workaround,
   not a broadened assertion, not a disabled or skipped test.
4. Re-run the same command to confirm, and say exactly what you ran.
5. If the failure turns out to be intermittent rather than deterministic, say
   so plainly instead of "fixing" it — that is a flaky test, and patching it
   hides the problem.

If the right move is to re-run the job rather than change code, use the job
link in the context below. For GitHub Actions: `gh run rerun <run-id> --failed`,
where the run ID is the number after `/runs/` in that URL (not the trailing
number, which is the job ID).

Branch: datadog-api-spec/generated/6570

CI | Check, Test & Coverage
Commit: c1aeb39706741b448cb92655959d8dd1e05ddf6f
Error (code / build):
Compilation errors: functions 'eprint_formatted' and 'format_value_to_string' not found in module 'formatter', and argument missing for 'format_and_print' in 'downtimes.rs'.
CI job: https://github.com/DataDog/pup/actions/runs/33490767451/job/99801460665

CI | Cross Compile (Linux)
Commit: c1aeb39706741b448cb92655959d8dd1e05ddf6f
Error (code / build):
Compilation error in src/rate_limit.rs:151: cannot find function `eprint_formatted` in module `formatter`.
CI job: https://github.com/DataDog/pup/actions/runs/33490767451/job/99801460676

CI | Cross Compile (Windows)
Commit: c1aeb39706741b448cb92655959d8dd1e05ddf6f
Error (code / build):
Compilation errors in src/rate_limit.rs and src/downtimes.rs: function 'eprint_formatted' not found and incorrect argument count in 'format_and_print'.
CI job: https://github.com/DataDog/pup/actions/runs/33490767451/job/99801460683

Plus 2 more failing jobs not shown here.

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: c1aeb39 | Docs | View more details | Give us feedback!

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