Trouble Setting Up Langfuse Integration with Claude Code Typescript SDK and OpenTelemetry #9242
-
|
Hello, I’m having trouble setting up the Langfuse integration with the Claude Code SDK and OpenTelemetry. I’ve created the following settings file ( {
"env": {
"CLAUDE_CODE_ENABLE_TELEMETRY": "1",
"OTEL_METRICS_EXPORTER": "otlp",
"OTEL_LOGS_EXPORTER": "otlp",
"OTEL_EXPORTER_OTLP_PROTOCOL": "http/protobuf",
"OTEL_EXPORTER_OTLP_ENDPOINT": "https://us.cloud.langfuse.com/api/public/otel",
"OTEL_EXPORTER_OTLP_TRACES_ENDPOINT": "https://us.cloud.langfuse.com/api/public/otel/v1/traces",
"OTEL_EXPORTER_OTLP_HEADERS": "Authorization=Basic <AUTH-STRING>",
"OTEL_METRIC_EXPORT_INTERVAL": "1000",
"OTEL_LOGS_EXPORT_INTERVAL": "1000"
}
}I can see events firing from Claude Code, but they don't appear on the Langfuse dashboard. Am I missing something or is there something else I should configure? Thank you for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
|
Your settings file includes many of the core OpenTelemetry variables, but for traces to appear in Langfuse, you must ensure the following:
If all configuration is correct and traces still don't appear, verify that the Claude Code SDK emits OpenTelemetry traces (not just metrics/logs). If you are only emitting metrics or logs, these will not be visible in the Langfuse dashboard, which is focused on trace data(1)(2). For reference, see the details at LLM Observability via OpenTelemetry and Open Source LLM Observability via OpenTelemetry - Langfuse. 📚 Sources: Have another question? Just tag @inkeep. |
Beta Was this translation helpful? Give feedback.
-
|
@ASaiAnudeep Claude code exports LOGS and not TRACES, thus it is currently not directly compatible (LOGS is 400, as langfuse only accepts traces). You could use a proxy like litellm to log all requests to Langfuse (docs). Tracking request for direct integration here: https://github.com/orgs/langfuse/discussions/9088 |
Beta Was this translation helpful? Give feedback.
@ASaiAnudeep Claude code exports LOGS and not TRACES, thus it is currently not directly compatible (LOGS is 400, as langfuse only accepts traces). You could use a proxy like litellm to log all requests to Langfuse (docs).
Tracking request for direct integration here: https://github.com/orgs/langfuse/discussions/9088