Respect global config for OTel tracing and metrics enabled#4326
Open
gkatz2 wants to merge 1 commit intostacklok:mainfrom
Open
Respect global config for OTel tracing and metrics enabled#4326gkatz2 wants to merge 1 commit intostacklok:mainfrom
gkatz2 wants to merge 1 commit intostacklok:mainfrom
Conversation
thv config otel set-tracing-enabled false was silently ignored by thv run because getTelemetryFromFlags had no fallback for these two fields, and buildRunConfig bypassed the fallback entirely for the proxy runner config. Users could not globally disable telemetry without passing CLI flags on every invocation. Fixes stacklok#4323 Signed-off-by: Greg Katz <gkatz@indeed.com>
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
thv config otel set-tracing-enabled falsewas silently ignored bythv runbecausegetTelemetryFromFlagshad no fallback forTracingEnabledorMetricsEnabled, andbuildRunConfigbypassed the fallback entirely for the proxy runner configFixes #4323
Type of change
Test plan
task test)task lint-fix)Deployed a local build and verified:
tracing-enabled: falseandmetrics-enabled: false,thv runproduces a runconfig withnulltelemetry (no telemetry initialized)--otel-tracing-enabled=true, CLI flag correctly overrides global configconfig.yamlnow showstracing-enabled: falseinstead of silently dropping the fieldChanges
pkg/config/config.goTracingEnabled/MetricsEnabledfromboolwithomitemptyto*boolwithoutomitempty, matching the existingUseLegacyAttributespatterncmd/thv/app/run_flags.gogetTelemetryFromFlags; use resolved values inbuildRunConfig; return nil fromcreateTelemetryConfigwhen both signals are disabledcmd/thv/app/otel.go*boolcmd/thv/app/run_flags_test.goDoes this introduce a user-facing change?
thv config otel set-tracing-enabledandset-metrics-enablednow take effect when starting servers withthv run. Previously these settings were silently ignored.Special notes for reviewers
The
*boolpattern (nil = never set, false = explicitly disabled) is necessary because the CLI defaults for these flags aretrue, unlikeInsecureandEnablePrometheusMetricsPathwhich default tofalse. A struct-level comment onOpenTelemetryConfigexplains this distinction.Generated with Claude Code