Skip to content

thv serve crashes on startup when OTLP endpoint is configured but tracing/metrics are disabled #4647

@peppescg

Description

@peppescg

Summary

thv serve fails to start with exit code 1 when an OTLP endpoint is configured via thv config otel set-endpoint but both tracing and metrics are disabled. This causes ToolHive Studio to show a "Health check failed" error since the server never comes up.

Error

Error: failed to initialize telemetry: OTLP endpoint is configured but both tracing and metrics are disabled; either enable tracing or metrics, or remove the endpoint

Steps to Reproduce

  1. Configure an OTLP endpoint: thv config otel set-endpoint https://some-collector.example.com
  2. Do not enable tracing or metrics
  3. Run thv serve
  4. Process exits immediately with code 1

Expected Behavior

thv serve should start successfully, logging a warning that the OTLP endpoint is configured but unused (since tracing and metrics are both disabled). The endpoint configuration should be silently ignored rather than treated as a fatal error.

Workaround

thv config otel unset-endpoint

Impact

This is a fatal error that prevents the server from starting entirely. Users of ToolHive Studio hit this as a blank "Health check failed" screen with no clear indication of the root cause — the error is only visible in the main process logs.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcliChanges that impact CLI functionalitytelemetry

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions