Skip to content

refactor(config): rename compute_trace_stats_on_extension -> lambda_extension_compute_stats#1266

Merged
duncanista merged 1 commit into
feat/migrate-bottlecap-to-upstream-configfrom
jordan.gonzalez/config/rename-compute-stats-env-var
Jun 18, 2026
Merged

refactor(config): rename compute_trace_stats_on_extension -> lambda_extension_compute_stats#1266
duncanista merged 1 commit into
feat/migrate-bottlecap-to-upstream-configfrom
jordan.gonzalez/config/rename-compute-stats-env-var

Conversation

@duncanista

@duncanista duncanista commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Renames the public env var `DD_COMPUTE_TRACE_STATS_ON_EXTENSION` to `DD_LAMBDA_EXTENSION_COMPUTE_STATS`, plus the matching Rust field, so the name reflects the actual scope: this toggle only governs the Lambda extension's APM trace-stats pipeline and is not a generic Datadog Agent concept.

Why

Auditing the `LambdaConfig` extension fields surfaced this one as the one with an ambiguous env var name. "Compute trace stats on extension" reads as if there's a generic "extension" concept; in practice it's specifically the Lambda extension. Making that explicit avoids confusion if/when the same idea surfaces in other embedders (which would then need a differently-named knob).

Changes

  • `LambdaConfigSource` field renamed: `compute_trace_stats_on_extension` → `lambda_extension_compute_stats`. Figment's `DD_` prefix maps to the new env var automatically.
  • `LambdaConfig` field renamed in lockstep. All call sites in `trace_processor.rs`, `otlp/agent.rs`, `lifecycle/invocation/processor.rs`, `tags/lambda/tags.rs`, and the integration test now read `config.ext.lambda_extension_compute_stats`.
  • `merge_from` keeps the field in the existing `value:` group of `merge_fields!` — no source-to-config rename needed since field names match.
  • No back-compat alias for the old env var. The `.ext` migration this depends on has not shipped, so the legacy name was never released externally.
  • Test renamed; default-false test added.

Test plan

  • `cargo test` — `config::lambda_config_tests::lambda_extension_compute_stats_from_env` and `lambda_extension_compute_stats_defaults_false` pass; 38/38 in the module.
  • `cargo clippy --workspace --all-targets --features default` — clean.
  • `cargo fmt -- --check` — clean.

Notes for review

Stacked on top of `feat/migrate-bottlecap-to-upstream-config` (the .ext migration PR). Merges into that branch.

@duncanista duncanista requested a review from a team as a code owner June 18, 2026 19:05
Comment thread bottlecap/src/config/mod.rs

@lucaspimentel lucaspimentel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM aside from the question about keeping DD_COMPUTE_TRACE_STATS_ON_EXTENSION as a fallback for backwards compatibility.

…xtension_compute_stats

Renames the env var DD_COMPUTE_TRACE_STATS_ON_EXTENSION to
DD_LAMBDA_EXTENSION_COMPUTE_STATS to make scope explicit: this setting
only governs the Lambda extension's APM trace-stats pipeline and is
not a generic Datadog Agent concept.

Since this version of the .ext migration has not shipped, the internal
field and source field are both renamed in lockstep — no back-compat
alias for the old env var, no source-to-config rename mapping in
merge_from. Everywhere that previously read
config.ext.compute_trace_stats_on_extension now reads
config.ext.lambda_extension_compute_stats.
@duncanista duncanista force-pushed the jordan.gonzalez/config/rename-compute-stats-env-var branch from 74154a6 to 25492d6 Compare June 18, 2026 19:09
@duncanista duncanista requested a review from a team as a code owner June 18, 2026 19:09
@duncanista duncanista changed the title refactor(config): rename DD_COMPUTE_TRACE_STATS_ON_EXTENSION -> DD_LAMBDA_EXTENSION_COMPUTE_STATS refactor(config): rename compute_trace_stats_on_extension -> lambda_extension_compute_stats Jun 18, 2026
@duncanista duncanista merged commit 00acd40 into feat/migrate-bottlecap-to-upstream-config Jun 18, 2026
28 of 36 checks passed
@duncanista duncanista deleted the jordan.gonzalez/config/rename-compute-stats-env-var branch June 18, 2026 19:16
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.

2 participants