Skip to content

OTel insecure setting isn't working in global config #1899

@danbarr

Description

@danbarr

Bug description

The insecure setting was added to the "global" configs in #1785, but it's not working. ToolHive is still trying to send to an https:// endpoint unless the --otel-insecure flag is explicitly used on the thv run command.

Steps to reproduce

(Optional) Set up a local Jaeger instance:

docker run -d --name jaeger \
  -p 16686:16686 -p 4318:4318 \
  jaegertracing/jaeger:2.10.0

Configure ToolHive:

thv config otel set-endpoint localhost:4318
thv config otel set-insecure true
thv config otel set-sampling-rate 1.0

# Confirm the setting:
thv config otel get-insecure

Run an MCP server, list the tools to generate a trace, then get its logs:

thv run --otel-service-name "fetch-mcp" fetch
thv mcp list tools --server fetch
tail ~/Library/Application\ Support/toolhive/logs/fetch.log

Note the error:

2025/09/15 18:08:15 traces export: Post "https://localhost:4318/v1/traces": http: server gave HTTP response to HTTPS client

Stop the server, re-run with --otel-insecure, and see that it works.

thv stop fetch
thv run --otel-service-name "fetch-mcp" --otel-insecure fetch
thv mcp list tools --server fetch
tail ~/Library/Application\ Support/toolhive/logs/fetch.log

There's no error, and if you open the Jaeger UI (http://localhost:16686), the traces are visible.

Expected behavior

ToolHive should send traces to http://localhost:4318

Actual behavior

ToolHive tries to send traces to https://localhost:4318 and fails.

Environment (if relevant)

  • ToolHive version: v0.3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcliChanges that impact CLI functionalitygood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions