fix(telemetry): warn instead of crashing when OTLP endpoint has no enabled exporters#4648
Merged
fix(telemetry): warn instead of crashing when OTLP endpoint has no enabled exporters#4648
Conversation
…abled exporters When an OTLP endpoint is configured via `thv config otel set-endpoint` but both tracing and metrics are disabled, `thv serve` crashes with a fatal validation error preventing the server from starting. Instead of failing, log a warning and clear the endpoint so the server starts normally. This avoids a confusing "Health check failed" error in ToolHive Studio. Fixes #4647 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4648 +/- ##
==========================================
- Coverage 68.85% 68.82% -0.03%
==========================================
Files 506 506
Lines 52449 52460 +11
==========================================
- Hits 36115 36108 -7
- Misses 13542 13561 +19
+ Partials 2792 2791 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…c complexity Move the unused endpoint check into a dedicated helper function to keep NewServeProvider under the gocyclo threshold (15). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nabled exporters Instead of clearing the endpoint (which would silently drop telemetry for users who configured an endpoint expecting it to work), enable tracing by default so the endpoint is actually used. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ChrisJBurns
approved these changes
Apr 7, 2026
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-endpoint) but both tracing and metrics are disabled,thv servecrashes with a fatal validation error (exit code 1)Test plan
thv config otel set-endpoint localhost:4317) with tracing/metrics not enabledthv servestarts with a warning and tracing enabled by default, instead of crashinggo test ./pkg/telemetry/...)Fixes #4647
🤖 Generated with Claude Code