Skip to content

🚀 Feature: Support for Multiple OTLP Endpoints/Exporters #3478

@mmphego

Description

@mmphego

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:

  1. Deploy and maintain OTEL collectors (infrastructure overhead)
  2. Choose only one observability platform (limited visibility)
  3. 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:

  1. Initialize Traceloop with the primary endpoint (existing behavior)
  2. 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:

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions