Minimal reproduction showing that the OTLP exporter fails to send traces to
Langfuse when using OtlpExporterOptions.Headers, but works when using
OtlpExporterOptions.HttpClientFactory.
./LangFuse/docker-compose.ymlcontains a default Docker Compose config for Langfuse v3 self-hosted containers.- Start it:
docker compose up(available athttp://localhost:3000). - Visit the Langfuse dashboard and create a project.
- In the left sidebar, open the Traces tab and create API keys.
- Update the
Langfusesection inappsettings.jsonwith the generated public key, secret key, and host URL.
The app expects an OpenAI-compatible endpoint, model name, and API key. Use any OpenAI-compatible LLM service you prefer (e.g. DeepSeek, ChatGPT, or a self-hosted model via Ollama / LM Studio).
For free local testing with Ollama:
- Download and install Ollama.
- Pull a small model:
ollama pull qwen3.5:0.8b - Run
ollama serve(skip if already running). Verify with:curl http://localhost:11434/api/generate -d '{"model": "qwen3.5:0.8b","prompt": "How to throw error in C#? Short answer with code snippet only.","stream": false, "think": false}' - In
appsettings.json, configure theLlmProvidersection:Endpoint:http://localhost:11434/v1ApiKey: any value (e.g.ollama)Model: the model identifier (e.g.qwen3.5:0.8b)
- In
Program.cs, uncomment theo.HttpClientFactoryblock and comment out theo.Headersline. - Launch the app and send the POST request from
OpenTelemetryLangFuseRepro.http. - Both the OpenTelemetry console exporter and the Langfuse dashboard will show the recorded trace with GenAI spans. (Traces may take 5–30 seconds to appear in Langfuse due to async ingestion.)
- Now comment out the
o.HttpClientFactoryblock and uncomment theo.Headersline. - Rebuild, launch the app, and send the same POST request.
- The OpenTelemetry console exporter logs the trace, but Langfuse never receives it. The OTLP exporter eventually times out.
Both OtlpExporterOptions.Headers and OtlpExporterOptions.HttpClientFactory
should produce the same result: traces exported to Langfuse via OTLP/HTTP
Protobuf.