Multi-Project Routing with OpenTelemetry Configuration #11540
-
Describe your questionQuestionI'm trying to map multiple Langfuse projects to different subprojects within my application using OpenTelemetry configuration. Current SetupI have the following OTLP exporter configuration: otel:
exporters:
- otlp:
endpoint: "https://cloud.langfuse.com/api/public/otel/v1/traces"
headers:
Authorization: "Basic <encoded-keys>"
enabled: true
service_name: "MyApp"
Goal Questions Langfuse Cloud or Self-Hosted?Langfuse Cloud If Self-HostedNo response If Langfuse CloudNo response SDK and integration versionsNo response Pre-Submission Checklist
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Multi-Project Routing with OpenTelemetryFor routing traces to multiple Langfuse projects using OpenTelemetry configuration, there are two primary approaches: 1. Multiple OTLP Exporters (Recommended for Configuration-Based Setup)You can configure multiple OTLP exporters, each with different credentials pointing to different Langfuse projects(1). Each exporter uses Basic Auth with project-specific API keys. The authentication header format is: For your YAML configuration, this would look like: otel:
exporters:
- otlp:
endpoint: "https://cloud.langfuse.com/api/public/otel/v1/traces"
headers:
Authorization: "Basic <project-a-encoded-keys>"
- otlp:
endpoint: "https://cloud.langfuse.com/api/public/otel/v1/traces"
headers:
Authorization: "Basic <project-b-encoded-keys>"Important: You'll need to implement logic to route specific traces to specific exporters based on your subproject/tenant context(1). 2. OpenTelemetry Collector with FilteringYou can use an OpenTelemetry Collector with the Example collector configuration: processors:
filter/openaisystem:
error_mode: ignore
traces:
span:
- 'attributes["gen_ai.system"] != "openai"'
exporters:
otlphttp/langfuse:
endpoint: "https://cloud.langfuse.com/api/public/otel"
headers:
Authorization: "Basic ${AUTH_STRING}"
service:
pipelines:
traces:
receivers: [otlp]
processors: [filter/openaisystem]
exporters: [otlphttp/langfuse]Caution: Filtering at the span level may risk incomplete traces, so be careful with complex filter rules(1). Langfuse requires that a root span is sent to ensure traces are created correctly(1). Best Practices
For multi-tenant scenarios, you can also set up separate projects within the same Langfuse instance and route different tenants to these projects(3). 📚 Sources:
Have another question? Just tag @inkeep. |
Beta Was this translation helpful? Give feedback.
-
|
Please see our docs on multi project setups and please let us know your open questions: https://langfuse.com/docs/observability/sdk/advanced-features#multi-project-setup-experimental |
Beta Was this translation helpful? Give feedback.
Please see our docs on multi project setups and please let us know your open questions: https://langfuse.com/docs/observability/sdk/advanced-features#multi-project-setup-experimental