Skip to content

Error running workloads when otel endpoint set #1964

@danbarr

Description

@danbarr

Bug description

Starting in v0.3.3, I cannot run any workloads while an OTel endpoint is set, either in the global config or with the run flag. The workload does not start, and the following error shows in the log file:

Error: failed to restart workload osv: failed to create middleware of type telemetry: failed to create telemetry provider: failed to build telemetry providers: service cannot be empty

Reverting to v0.3.2, it works as expected.

Steps to reproduce

Run an MCP server with an OTel endpoint (the endpoint doesn't actually have to be running to see the issue):

thv run osv --otel-endpoint localhost:4318 --otel-insecure

Then see that the server doesn't start, and the log contains an error:

thv list
tail ~/Library/Application\ Support/toolhive/logs/osv.log
12:58PM	WARN	Warning: Failed to find container: workload not found: no containers found (container: osv): failed to inspect workload: workload not found: no containers found (container: osv) (container: osv)
12:58PM	WARN	Trying to find state with name osv directly...
12:58PM	INFO	Loaded configuration from state for osv
12:58PM	INFO	Starting tooling server osv...
12:58PM	INFO	OIDC validation disabled, using local user authentication
12:58PM	INFO	Using local user authentication for user: dan
Error: failed to restart workload osv: failed to create middleware of type telemetry: failed to create telemetry provider: failed to build telemetry providers: service cannot be empty

Expected behavior

The workload should start with telemetry enabled.

Actual behavior

The workload fails to start and an error is logged.

Environment (if relevant)

  • OS/version: macOS, Docker Desktop
  • ToolHive version: v0.3.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcliChanges that impact CLI functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions