This example demonstrates how to run the OpenTelemetry Collector and configure it to export telemetry to New Relic. The docker-compose.yaml
file configures the collector via otel-config.yaml
.
Set the following environment variables:
NEW_RELIC_API_KEY=<your_license_key>
- Replace
<your_license_key>
with your Account License Key.
- Replace
Then run:
docker-compose -f docker-compose.yaml up
The collector is configured with the following components.
- The OTLP receiver. This receiver is configured to accept OTLP data over gRPC on port
4317
. Configure applications to export over OTLP tohttp://localhost:4317
. - The Fluent Forward receiver. This receiver listens on port
8006
. You can forward application logs to it using the Fluentd logging driver.
- The Batch processor. This processor helps limit the number of outgoing requests. See our best practices regarding batching data.
- The Cumulative to Delta processor. This processor converts histograms and monotonic sums received in cumulative temporality to delta temporality. New Relic currently rejects cumulative histograms and monotonic sums, so this processor is necessary. However, New Relic cumulative metric support is currently in preview. Contact your account representative to participate in the preview. For more information on how New Relic ingests metrics, take a look at our best practices.
- The Transform processor. This processor is configured to truncate attributes on spans and logs to adhere to New Relic's attribute length limits. Attributes over the limit will cause data to be dropped. Note that the transform processor has not been configured to truncate attributes on metrics. Long metric attributes should be unusual. Truncating metric attributes can be complex and may require metrics to be reaggregated. The transform processor does not perform any reaggregation.
- The OTLP HTTP exporter. This exporter is configured to send data to New Relic. See documentation for more information about New Relic OTLP support.
- The Debug exporter. This exporter logs data the collector processes to standard out. It can be useful for troubleshooting.