Skip to content

refactor(config): migrate maxTagsHeaderLen#4730

Merged
mtoffl01 merged 2 commits into
mainfrom
mtoff/config-migrate-max-tags-header-len
May 7, 2026
Merged

refactor(config): migrate maxTagsHeaderLen#4730
mtoffl01 merged 2 commits into
mainfrom
mtoff/config-migrate-max-tags-header-len

Conversation

@mtoffl01

@mtoffl01 mtoffl01 commented May 5, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

  • Adds a public Config.MaxTagsHeaderLen() getter on internal/config.Config.
  • Initializes the field in loadConfig from DD_TRACE_X_DATADOG_TAGS_MAX_LENGTH, preserving the existing clamping semantics (negative → 0; > MaxPropagatedTagsLength → clamped down to that value).
  • Adds DefaultMaxTagsHeaderLen and MaxPropagatedTagsLength exported constants in internal/config.
  • Removes the duplicate env resolution from tracer/option.go and the defaultMaxTagsHeaderLen / maxPropagatedTagsLength constants there.
  • The propagator is now constructed using c.internalConfig.MaxTagsHeaderLen() instead of locally re-reading the env var.

Motivation

Continued config-migration work: move env resolution of DD_TRACE_X_DATADOG_TAGS_MAX_LENGTH into internal/config to match the pattern established by recent migrations (e.g. #4711, #4653).

@codecov

codecov Bot commented May 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 21.42857% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.98%. Comparing base (51e0cfb) to head (ae4e8d7).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
internal/config/config_helpers.go 25.00% 4 Missing and 2 partials ⚠️
internal/config/config.go 0.00% 5 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
ddtrace/tracer/option.go 84.86% <100.00%> (ø)
internal/config/config.go 60.07% <0.00%> (+60.07%) ⬆️
internal/config/config_helpers.go 43.95% <25.00%> (ø)

... and 445 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented May 5, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 16.67%
Overall Coverage: 61.32% (-0.06%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: c3b9324 | Docs | Datadog PR Page | Give us feedback!

@mtoffl01
mtoffl01 force-pushed the mtoff/config-migrate-max-tags-header-len branch from ad4f91f to e1ddf38 Compare May 5, 2026 18:46
- Adds a public `Config.MaxTagsHeaderLen()` getter on
  `internal/config.Config`.
- Initialises the field in `loadConfig` from
  `DD_TRACE_X_DATADOG_TAGS_MAX_LENGTH`, preserving the existing clamping
  semantics (negative -> 0; > MaxPropagatedTagsLength -> clamped down).
- Adds `DefaultMaxTagsHeaderLen` and `MaxPropagatedTagsLength` exported
  constants in `internal/config`.
- Removes the duplicate env resolution from `tracer/option.go` and the
  `defaultMaxTagsHeaderLen` / `maxPropagatedTagsLength` constants there.
- The propagator is now constructed using
  `c.internalConfig.MaxTagsHeaderLen()` instead of locally re-reading the
  env var.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@mtoffl01
mtoffl01 force-pushed the mtoff/config-migrate-max-tags-header-len branch from e1ddf38 to ae4e8d7 Compare May 5, 2026 19:30
@mtoffl01
mtoffl01 marked this pull request as ready for review May 5, 2026 20:12
@mtoffl01
mtoffl01 requested review from a team as code owners May 5, 2026 20:12
@pr-commenter

pr-commenter Bot commented May 5, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-05-05 20:47:55

Comparing candidate commit c3b9324 in PR branch mtoff/config-migrate-max-tags-header-len with baseline commit 51e0cfb in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 258 metrics, 9 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

@darccio darccio 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.

Nice! It's much cleaner this way.

@mtoffl01
mtoffl01 merged commit e8a9aad into main May 7, 2026
219 of 220 checks passed
@mtoffl01
mtoffl01 deleted the mtoff/config-migrate-max-tags-header-len branch May 7, 2026 14:46
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