Add UseLegacyAttributes flag to telemetry config - #3729
Merged
Merged
Conversation
Add a new UseLegacyAttributes boolean field to the telemetry Config struct, defaulting to true for backward compatibility. This flag will control whether legacy (pre-MCP OTEL semconv) attribute names are emitted alongside the new standard names. The default will change to false in a future release. Plumbs the flag through: - CLI (--otel-use-legacy-attributes) - Config file (use-legacy-attributes) - Operator spectoconfig - Runner config builder - VirtualMCPServer CRD (useLegacyAttributes, default: true) The flag is not yet consumed by the telemetry middleware; a follow-up PR will add the conditional attribute emission logic. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ChrisJBurns
requested review from
JAORMX,
amirejaz,
eleftherias,
jerm-dro,
jhrozek,
lujunsan,
rdimitrov and
yrobla
as code owners
February 9, 2026 21:55
Add a new UseLegacyAttributes boolean field to the telemetry Config struct, defaulting to true for backward compatibility. This flag will control whether legacy (pre-MCP OTEL semconv) attribute names are emitted alongside the new standard names. The default will change to false in a future release. Plumbs the flag through: - CLI (--otel-use-legacy-attributes) - Config file (use-legacy-attributes) - Operator CRD types (OpenTelemetryConfig.useLegacyAttributes) - Operator spectoconfig (reads from CR spec) - Runner config builder - VirtualMCPServer/MCPServer/MCPRemoteProxy CRDs (default: true) The flag is not yet consumed by the telemetry middleware; a follow-up PR will add the conditional attribute emission logic. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Chris Burns <29541485+ChrisJBurns@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3729 +/- ##
=======================================
Coverage 66.35% 66.35%
=======================================
Files 427 427
Lines 41794 41800 +6
=======================================
+ Hits 27731 27737 +6
Misses 11953 11953
Partials 2110 2110 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This was referenced Feb 9, 2026
Go's omitempty on a bool treats false as the zero value and silently drops it during JSON/YAML serialization. This meant that explicitly setting useLegacyAttributes: false in config or CRD would be lost on round-trip, reverting to the default true. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
jhrozek
reviewed
Feb 10, 2026
jhrozek
approved these changes
Feb 10, 2026
5 tasks
11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
UseLegacyAttributesboolean field to the telemetryConfigstruct, defaulting totruefor backward compatibility with existing dashboards and alerts--otel-use-legacy-attributes), config file (use-legacy-attributes), operator CRD types (OpenTelemetryConfig.useLegacyAttributes), operator spectoconfig (reads from CR spec), runner config builderuseLegacyAttributeswithdefault: trueContext
This is the first PR in a series to support the MCP OTEL semantic conventions migration. The flag provides the plumbing so that a subsequent PR can conditionally emit legacy attribute names alongside the new standard names. The default will change to
falsein a future release, and the flag will eventually be removed.Test plan
getTelemetryFromFlagsupdated to coverUseLegacyAttributesplumbing (CLI precedence, config fallback, default behavior)UseLegacyAttributesassertion and new test case for reading from CR specgo build ./...compiles cleanlytask lintpasses with 0 issues🤖 Generated with Claude Code