Skip to content

[SVLS-9800] fix(config): Support AWS Secrets Manager ARNs for dual-shipping additional endpoints - #1391

Merged
shreyamalpani merged 4 commits into
mainfrom
shreya.malpani/add-secrets-manager-arn-support-dual-shipping
Sep 25, 2026
Merged

shreyamalpani merged 4 commits into
mainfrom
shreya.malpani/add-secrets-manager-arn-support-dual-shipping

Conversation

@shreyamalpani

@shreyamalpani shreyamalpani commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds support for sourcing dual-shipping to additional endpoints (across metrics, traces, and logs) from an AWS Secrets Manager secret ARN, instead of requiring the endpoints/keys to be embedded as plaintext env vars. This mirrors the existing pattern for resolving the primary DD_API_KEY from Secrets Manager.

Three new env vars are read at startup and, if set, resolved and merged into the existing plaintext additional-endpoints config:

  • DD_ADDITIONAL_ENDPOINTS_SECRET_ARN → merges into DD_ADDITIONAL_ENDPOINTS (metrics)
  • DD_APM_ADDITIONAL_ENDPOINTS_SECRET_ARN → merges into DD_APM_ADDITIONAL_ENDPOINTS (traces)
  • DD_LOGS_CONFIG_ADDITIONAL_ENDPOINTS_SECRET_ARN → merges into DD_LOGS_CONFIG_ADDITIONAL_ENDPOINTS (logs)

Secret content uses the same JSON shape as the corresponding plaintext env var as defined in docs.

Motivation

GitHub issue #1370

Design

  • Resolution is done synchronously at startup, not lazily on first flush. Since a non-empty ARN means the fetch will happen unconditionally, there's no benefit to deferring it, and doing it eagerly avoids adding latency to flush-time paths.
  • Resolved secrets overwrite the corresponding plaintext additional-endpoints config, when the secret's ARN is set and resolves successfully. If the ARN is unset, the fetch fails, or the secret fails to parse, the plaintext value is left untouched — it's not merged with the resolved value.
  • No changes to the existing primary DD_API_KEY resolution path (create_api_key_factory/resolve_secrets) — this is a separate, additive resolution step.
  • Also bumps the pinned serverless-components git rev to 8156757 to pick up the corresponding datadog-agent-config schema changes (new *_secret_arn fields) from config: add additional endpoints secret ARN environment variables serverless-components#171

Testing

  • Manually tested and verified dual shipping works for metrics, logs, and traces to an additional endpoint sourced from a Secrets Manager ARN

@shreyamalpani shreyamalpani changed the title [SVLS-9800] fix(config): Support AWS Secrets Manager ARNs for additional-endpoint API keys [SVLS-9800] fix(config): Support AWS Secrets Manager ARNs for dual-shipping additional endpoints Sep 25, 2026
@datadog-prod-us1-3

datadog-prod-us1-3 Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Tests

🔄 Datadog auto-retried 1 job - 0 passed on retry View in Datadog

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

@shreyamalpani
shreyamalpani force-pushed the shreya.malpani/add-secrets-manager-arn-support-dual-shipping branch 2 times, most recently from 5233018 to d0370f4 Compare September 25, 2026 14:45
@shreyamalpani
shreyamalpani marked this pull request as ready for review September 25, 2026 15:17
@shreyamalpani
shreyamalpani requested a review from a team as a code owner September 25, 2026 15:17
@shreyamalpani
shreyamalpani requested review from duncanista and a lite review from Copilot September 25, 2026 15:17

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

Add bounded timeouts for startup secret requests and broader feature-path test coverage.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity · 1 Low severity

Open (2)
What changed in this PR

Adds AWS Secrets Manager ARN support for dual-shipping metrics, traces, and logs endpoint configuration.

Changes:

  • Resolves endpoint secrets during startup with plaintext fallback on failure.
  • Integrates resolution before telemetry flushers initialize.
  • Updates serverless-components dependency revisions.
File Description
bottlecap/​src/​secrets/​decrypt.rs Implements secret fetching, parsing, and endpoint resolution.
bottlecap/​src/​bin/​bottlecap/​main.rs Integrates endpoint resolution at startup.
bottlecap/​Cargo.toml Updates dependency revision.
bottlecap/​Cargo.lock Locks updated dependencies.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread bottlecap/src/secrets/decrypt.rs Outdated
Comment on lines +167 to +175
if let Some(metrics) = metrics {
config.additional_endpoints = metrics;
}
if let Some(apm) = apm {
config.apm_additional_endpoints = apm;
}
if let Some(logs) = logs {
config.logs_config_additional_endpoints = logs;
}
@shreyamalpani
shreyamalpani marked this pull request as draft September 25, 2026 15:23
@litianningdatadog
litianningdatadog requested review from litianningdatadog and removed request for duncanista September 25, 2026 15:27
Comment thread bottlecap/src/secrets/decrypt.rs
@shreyamalpani
shreyamalpani marked this pull request as ready for review September 25, 2026 18:39
@shreyamalpani
shreyamalpani merged commit 6e571fd into main Sep 25, 2026
63 checks passed
@shreyamalpani
shreyamalpani deleted the shreya.malpani/add-secrets-manager-arn-support-dual-shipping branch September 25, 2026 19:49
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