refactor(config): peer service revamp#4653
Conversation
Move peerServiceDefaultsEnabled and peerServiceMappings from the tracer's local config struct to internal/config.Config. These fields already existed in the global config singleton but lacked getter/setter methods. The tracer now reads/writes peer service configuration through the global config accessors instead of maintaining local copies.
…e defaults - Fix gofmt: remove extra blank line left from field removal - Keep schema-dependent peerServiceDefaultsEnabled logic in the tracer since spanAttributeSchemaVersion uses namingschema (understands "v1") while loadConfig uses getInt (can't parse "v1"). Add TODO to move once spanAttributeSchemaVersion is fully migrated.
SetPeerServiceMappings and SetPeerServiceMapping have non-standard signatures (map param / three value params) that the reflective test helper cannot auto-generate values for. Register them as special cases.
Address PR review comments: move the peer service defaults enabled logic (schema-dependent calculation) from tracer's newConfig() to internal config's loadConfig(). Add parseSpanAttributeSchema parser that handles "v0"/"v1" string values (matching namingschema behavior), replacing the previous getInt call that couldn't parse these formats.
…okup - Add getIntWithParser to configprovider instead of calling get() directly - Keep all provider.getX calls together in loadConfig; move the schema-dependent peer service defaults override to the derived evaluations section below - Replace PeerServiceMappings map in TracerConf with a PeerServiceMapping func for single-key lookups, avoiding lock contention and per-call map copies on the hot path (setPeerService is called for every span) - Update setPeerService to use the function-based lookup with nil guard - Fix CiVisibility TracerConf test to compare fields individually since functions cannot be compared with reflect.DeepEqual
…al mutation Made-with: Cursor
Follow the existing configprovider pattern: use getString to read the raw DD_TRACE_SPAN_ATTRIBUTE_SCHEMA value and parse it in the derived evaluations section with parseSpanAttributeSchema, matching how featureFlags and logToStdout are handled. Remove the getIntWithParser method that was just a passthrough to get().
Resolve merge conflict in internal/config/config.go: adopt main's refactored provider API (p.GetX exported methods) while preserving our peer service and span attribute schema migrations. Update reportTelemetry calls to configtelemetry.Report to match main's rename. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…rvice # Conflicts: # internal/config/config_helpers.go
…rvice # Conflicts: # ddtrace/tracer/api.txt
…race-go into config-revamp/peer-service
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…race-go into config-revamp/peer-service
… map Avoid a breaking API change in this PR. The TracerConf cleanup (removing PeerServiceMappings entirely) will be handled in a follow-up PR. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…race-go into config-revamp/peer-service
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: e62b453 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback! |
BenchmarksBenchmark execution time: 2026-04-10 14:46:13 Comparing candidate commit e62b453 in PR branch Found 0 performance improvements and 3 performance regressions! Performance is the same for 212 metrics, 9 unstable metrics.
|
What does this PR do? Coninues the following PR: #4483
PR was created due to permission issues, I was unable to merge the fork branch initially.
Motivation
Reviewer's Checklist
make lintlocally.make testlocally.make generatelocally.make fix-moduleslocally.Unsure? Have a question? Request a review!