refactor(config): migrate maxTagsHeaderLen#4730
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files
🚀 New features to boost your workflow:
|
🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: c3b9324 | Docs | Datadog PR Page | Give us feedback! |
ad4f91f to
e1ddf38
Compare
- 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]>
e1ddf38 to
ae4e8d7
Compare
BenchmarksBenchmark execution time: 2026-05-05 20:47:55 Comparing candidate commit c3b9324 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 258 metrics, 9 unstable metrics.
|
darccio
left a comment
There was a problem hiding this comment.
Nice! It's much cleaner this way.
What does this PR do?
Config.MaxTagsHeaderLen()getter oninternal/config.Config.loadConfigfromDD_TRACE_X_DATADOG_TAGS_MAX_LENGTH, preserving the existing clamping semantics (negative → 0; >MaxPropagatedTagsLength→ clamped down to that value).DefaultMaxTagsHeaderLenandMaxPropagatedTagsLengthexported constants ininternal/config.tracer/option.goand thedefaultMaxTagsHeaderLen/maxPropagatedTagsLengthconstants there.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_LENGTHintointernal/configto match the pattern established by recent migrations (e.g. #4711, #4653).