This topic explains how to set up an OpenTelemetry Collector to forward telemetry data to LaunchDarkly. This is useful if you want to:You can also set the endpoint using the To learn more about available processors, read the OpenTelemetry Collector documentation.
- Buffer and retry telemetry data closer to your application, reducing data loss during network interruptions
- Filter or transform data before it leaves your network
- Consolidate telemetry from multiple services through a single egress point
- Reduce direct internet dependencies from your application pods
- Dual-export data to LaunchDarkly and another observability backend simultaneously
Prerequisites
To implement an OpenTelemetry Collector you require:- An OpenTelemetry Collector binary or container image. Use the OpenTelemetry Collector Contrib distribution if you need additional exporters or processors.
- Your LaunchDarkly SDK key, available from your project’s Settings page.
Collector configuration
Create a file namedotel-collector-config.yaml with the following configuration. This sets up the Collector to receive OpenTelemetry Protocol (OTLP) data from your SDKs and forward it to LaunchDarkly:Running the Collector
Docker
Docker Compose
Kubernetes
Deploy the Collector as a Deployment or DaemonSet. The OpenTelemetry Operator for Kubernetes simplifies this.Configuring the SDK to use the Collector
Point your LaunchDarkly observability SDK at the Collector instead of the default LaunchDarkly endpoint. Set the OTLP endpoint to your Collector’s address.OTEL_EXPORTER_OTLP_ENDPOINT environment variable for SDKs that support it (Node.js, Python, .NET, Ruby).Dual-export to LaunchDarkly and another backend
A common use case is exporting telemetry to both LaunchDarkly and another observability provider. Add a second exporter and include it in your pipelines:Handle rate limits
LaunchDarkly limits how much OpenTelemetry data it accepts from each project and environment. When a request exceeds the limit, LaunchDarkly responds with an HTTP429 status or a gRPC RESOURCE_EXHAUSTED status, along with a retry delay. To learn more, read Ingestion rate limits.The Collector’s otlp and otlphttp exporters retry these responses and wait for the retry delay by default. They hold data that is waiting to be sent in a sending queue. If you send large volumes or sudden spikes of data, you can tune the retry and queue settings to hold data through a short period of rate limiting instead of dropping it.Here is an example:max_elapsed_time caps how long the Collector retries a batch before it drops it. queue_size caps how many batches the Collector holds in memory. To learn more about these settings, read the OpenTelemetry exporter helper documentation.Filtering sensitive data
You can use the Collector’sfilter and attributes processors to remove sensitive data before it leaves your network: