brief-book-57365
11/21/2025, 2:56 PMtall-airline-16756
11/21/2025, 2:56 PMtall-airline-16756
11/21/2025, 2:56 PMOTEL_EXPORTER_OTLP_ENDPOINT to your LangFuse OTLP endpoint (e.g., {host}/api/public/otel).
◦ Set OTEL_EXPORTER_OTLP_HEADERS to include Basic auth: Authorization=Basic {base64(public_key:secret_key)}.
1. Initialize OpenTelemetry tracing in your app:
◦ Create a TracerProvider.
◦ Add a BatchSpanProcessor with an OTLPSpanExporter.
◦ Call set_tracer_provider(trace_provider).
1. Activate tracing in the agent entrypoint:
◦ Call your tracing setup function (e.g., setup_langfuse()) in the agent’s entrypoint before starting the agent loop so MCP tool calls are captured.
When enabled, tool calls (including MCP server tool spans) are automatically recorded and sent to the trace backend where you can inspect them alongside LLM/STT/TTS spans.
If you want, tell me:
• which language or agent SDK you’re using, and
• which backend (LangFuse or another OTLP-compatible) — I’ll give paste-ready code for that environment. Sources: Observability data hooks | LiveKit docs