• EnglishEspañol日本語한국어Português
  • Log inStart now

OpenTelemetry collector for data processing

The OpenTelemetry collector is a vendor-agnostic tool for receiving, processing, and exporting telemetry data. It's recommended to run the collector in your observability pipeline. While collector requirements and configuration will vary, it's common to route APM OpenTelemetry data through a collector. This shifts overhead away from applications, and provides a place to enrich the telemetry with additional environment context data, filter and transform, and more. It's also common to use the collector for infrastructure monitoring, but this documentation focuses on data processing use cases. See Collector for infrastructure monitoring for more information.

Here's an example of the collector as a gateway, but you can also set up the collector as an agent running on the same host as your application:

Diagram showing OpenTelemetry using the OpenTelemetry collector and New Relic's OTLP endpoint.

The collector has an extensive set of receivers, processors, exporters, extensions, and connectors. These components are bundled into pre-built distributions. However, it's possible to build custom components to suit specific requirements, and build custom collector distribution to package a specific set of components.

While configuration varys based on requirements, collectors which send data to New Relic should have certain things in common:

OTLP exporter

The OpenTelemetry Collector supports exporting data using the otlphttpexporter. Ensure that the exporter configuration matches New Relic OTLP requirements.

Note, the otlpexporter is supported, but the OTLP/HTTP binary protocol is preferred over OTLP/gRPC.

Batch processor

Configure the collector to use the batch processor to export records in batches. Ensure the batch size and frequency is configured to match New Relic OTLP requirements.

Minimal example

To install the collector, see the OpenTelemetry documentation.

Run the collector with the configuration below, making sure you replace the following:

receivers:
otlp:
protocols:
grpc:
http:
processors:
batch:
exporters:
otlphttp:
endpoint: <INSERT_NEW_RELIC_OTLP_ENDPOINT>
headers:
api-key: <INSERT_NEW_RELIC_LICENSE_KEY>
service:
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [otlphttp]
metrics:
receivers: [otlp]
processors: [batch]
exporters: [otlphttp]
logs:
receivers: [otlp]
processors: [batch]
exporters: [otlphttp]

For a working example, see the New Relic OpenTelemetry examples repository.

For additional collector examples, see Collector for infrastructure monitoring.

Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.