-
Notifications
You must be signed in to change notification settings - Fork 838
Description
Which component is this feature for?
Traceloop SDK
🔖 Feature description
Add support for multiple OTLP endpoints in Traceloop.init() to enable dual/multi-export scenarios without requiring external OTEL collectors.
Proposed API:
from traceloop.sdk import Traceloop
# Current API (remains unchanged)
Traceloop.init(api_endpoint="https://primary-endpoint.com")
# Proposed API
Traceloop.init(
api_endpoint="https://primary-endpoint.com",
additional_exporters=[
{
"endpoint": "https://secondary-endpoint.com",
"headers": {"Authorization": "Bearer token"}
},
{
"endpoint": "https://third-endpoint.com",
"headers": {"Custom-Auth": "value"}
}
]
)🎤 Why is this feature needed ?
Many production GenAI applications need to send telemetry to multiple observability platforms simultaneously:
- Langfuse for GenAI-specific monitoring and evaluation
- Instana for infrastructure and application performance monitoring
- Other OTLP endpoints for compliance, backup, or multi-team visibility
Currently, traceloop-sdk only supports a single OTLP endpoint, forcing users to either:
- Deploy and maintain OTEL collectors (infrastructure overhead)
- Choose only one observability platform (limited visibility)
- Implement custom dual-export solutions (every user solves this independently)
Real-world context: This emerged from enterprise requirements where teams need both infrastructure monitoring (Instana) and GenAI-specific analytics (Langfuse) simultaneously.
✌️ How do you aim to achieve this?
Based on a working implementation I've built, this can be achieved by:
- Initialize Traceloop with the primary endpoint (existing behavior)
- For each additional exporter:
- Create an OTLPSpanExporter with the specified endpoint/headers
- Wrap it in a BatchSpanProcessor
- Add it to the TracerProvider
Benefits:
- ✅ Maintains existing performance characteristics
- ✅ Uses OpenTelemetry's native batching mechanisms
- ✅ Requires no external infrastructure
- ✅ Preserves backward compatibility
- ✅ Follows OpenTelemetry best practices
Performance: Spans are processed once and sent to multiple sinks via OpenTelemetry's proven BatchSpanProcessor - no duplication overhead.
🔄️ Additional Information
Alternative Solutions Considered:
- OTEL Collector: Adds infrastructure complexity and network hops
- Custom Implementation: Every user has to solve this independently
- Application-Level Duplication: Performance overhead from multiple instrumentation
References:
- OpenTelemetry BatchSpanProcessor: https://opentelemetry-python.readthedocs.io/en/latest/sdk/trace.export.html#opentelemetry.sdk.trace.export.BatchSpanProcessor
- Working implementation example available if needed for reference
This addresses the performance concern raised in our LinkedIn discussion by keeping the efficient single-instrumentation approach while enabling multiple export destinations.
👀 Have you spent some time to check if this feature request has been raised before?
- I checked and didn't find similar issue
Are you willing to submit PR?
Yes I am willing to submit a PR!