Skip to content

👷 skip telemetry error checks when no datacenter has credentials - #4997

Merged
BenoitZugmeyer merged 2 commits into
mainfrom
benoit/skip-telemetry-check-without-credentials
Aug 28, 2026
Merged

👷 skip telemetry error checks when no datacenter has credentials#4997
BenoitZugmeyer merged 2 commits into
mainfrom
benoit/skip-telemetry-check-without-credentials

Conversation

@BenoitZugmeyer

@BenoitZugmeyer BenoitZugmeyer commented Aug 28, 2026

Copy link
Copy Markdown
Member

Motivation

Production datacenter deployments run a 30-minute telemetry error gate after deploying. When none of the targeted datacenters have a configured telemetry API/application key, each iteration of the gate silently logs "skipping..." and the loop spins for the full 30 minutes doing nothing, needlessly delaying the pipeline.

Related: the telemetry error log line reported found undefined event(s) when the logs API returned no buckets, making the output misleading.

See job: https://gitlab.ddbuild.io/DataDog/browser-sdk/-/jobs/1993061816 . It's waiting 30 minutes when no datacenter has a key, so it doesn't run any query.

Changes

  • Skip the pre-deploy telemetry check and the 30-minute telemetry gate entirely when no targeted datacenter has telemetry credentials configured, instead of running the gate uselessly.
  • Default the computed event count to 0 when the logs API returns no buckets, so log lines read found 0 event(s) instead of found undefined event(s).

Test instructions

  • Run yarn test:script and verify the deploy-prod-dc and check-telemetry-errors suites pass.
  • Inspect the new test cases covering the no-credentials skip path and the empty-buckets count.

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.
  • Updated documentation and/or relevant AGENTS.md file

The deploy-prod-dc telemetry gate runs for 30 minutes even when every
datacenter lacks a configured API/application key, with each iteration
just logging 'skipping...' and the loop spinning uselessly. Detect this
upfront via hasTelemetryCredentials() and skip the pre-deploy check and
the gate entirely when no datacenter can be queried.
@BenoitZugmeyer
BenoitZugmeyer marked this pull request as ready for review August 28, 2026 09:44
@BenoitZugmeyer
BenoitZugmeyer requested a review from a team as a code owner August 28, 2026 09:44
@cit-pr-commenter-54b7da

Copy link
Copy Markdown

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 181.63 KiB 181.63 KiB 0 B 0.00%
Rum Profiler 8.43 KiB 8.43 KiB 0 B 0.00%
Rum Recorder 25.30 KiB 25.30 KiB 0 B 0.00%
Logs 57.93 KiB 57.93 KiB 0 B 0.00%
Rum Salesforce N/A 139.69 KiB N/A N/A N/A
Rum Slim 139.68 KiB 139.68 KiB 0 B 0.00%
Worker 22.96 KiB 22.96 KiB 0 B 0.00%
Rum Shopify N/A 205.99 KiB N/A N/A N/A
Rum-shopify Profiler N/A 8.43 KiB N/A N/A N/A
Rum-shopify Recorder N/A 3.72 KiB N/A N/A N/A

@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: 6b051e3811

ℹ️ 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".

Comment on lines +55 to +57
if (shouldCheckTelemetryErrors && !(await hasTelemetryCredentials(datacenters))) {
printLog('No telemetry credentials found for any datacenter, skipping telemetry error checks.')
shouldCheckTelemetryErrors = false

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve the gate on credential lookup failures

issue: When AWS SSM is temporarily unavailable or the job loses permission, both telemetry credential getters catch every command failure and return undefined, so this condition disables the pre-deploy check and the entire post-deploy gate while the production workflow proceeds with deployment. Before this change, the gate retried credential reads on every iteration and could recover from a transient failure; distinguish a genuinely missing parameter from lookup errors, or keep reevaluating credentials during the gate.

Useful? React with 👍 / 👎.

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.

@BenoitZugmeyer should we only skip when crendentials are confirmed to be missing ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I added a commit for that. The command will now crash if something goes wrong instead of proceed forward.

@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Aug 28, 2026

Copy link
Copy Markdown

Tests

All CI checks and tests passed.

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 77.02% (+0.00%)

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

@BenoitZugmeyer
BenoitZugmeyer force-pushed the benoit/skip-telemetry-check-without-credentials branch from 6b051e3 to ba5c967 Compare August 28, 2026 12:21
When the logs API returns no buckets, the computed count is undefined,
producing logs like 'found undefined event(s)'. Default to 0 instead.
@BenoitZugmeyer
BenoitZugmeyer force-pushed the benoit/skip-telemetry-check-without-credentials branch from ba5c967 to 9c94412 Compare August 28, 2026 12:27
@BenoitZugmeyer
BenoitZugmeyer merged commit ab838fd into main Aug 28, 2026
31 checks passed
@BenoitZugmeyer
BenoitZugmeyer deleted the benoit/skip-telemetry-check-without-credentials branch August 28, 2026 16:01
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants