Skip to content

Jeidoz/OpenTelemetryDotNetSDKIssue7430

Repository files navigation

Repro for OpenTelemetry .NET SDK Issue #7430

Minimal reproduction showing that the OTLP exporter fails to send traces to Langfuse when using OtlpExporterOptions.Headers, but works when using OtlpExporterOptions.HttpClientFactory.

Setup

Langfuse (self-hosted)

  • ./LangFuse/docker-compose.yml contains a default Docker Compose config for Langfuse v3 self-hosted containers.
  • Start it: docker compose up (available at http://localhost:3000).
  • Visit the Langfuse dashboard and create a project.
  • In the left sidebar, open the Traces tab and create API keys.
  • Update the Langfuse section in appsettings.json with the generated public key, secret key, and host URL.

OpenAI-compatible LLM API

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:

  1. Download and install Ollama.
  2. Pull a small model: ollama pull qwen3.5:0.8b
  3. 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}'
    
  4. In appsettings.json, configure the LlmProvider section:
    • Endpoint: http://localhost:11434/v1
    • ApiKey: any value (e.g. ollama)
    • Model: the model identifier (e.g. qwen3.5:0.8b)

Repro Steps

Working path (HttpClientFactory)

  1. In Program.cs, uncomment the o.HttpClientFactory block and comment out the o.Headers line.
  2. Launch the app and send the POST request from OpenTelemetryLangFuseRepro.http.
  3. 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.)

Broken path (Headers)

  1. Now comment out the o.HttpClientFactory block and uncomment the o.Headers line.
  2. Rebuild, launch the app, and send the same POST request.
  3. The OpenTelemetry console exporter logs the trace, but Langfuse never receives it. The OTLP exporter eventually times out.

Expected Behavior

Both OtlpExporterOptions.Headers and OtlpExporterOptions.HttpClientFactory should produce the same result: traces exported to Langfuse via OTLP/HTTP Protobuf.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages