This guide assumes you’ve already instrumented your services with the OpenTelemetry API and/or SDK. If you haven’t, see the Elastic APM install and run guide to get started with Elastic APM Agents instead.
OpenTelemetry Collectors can be run as an Agent, or as standalone collectors. They can be deployed as often as necessary and scaled up or out.
Docker images are available on dockerhub:
docker pull otel/opentelemetry-collector-contrib-dev
You can also build the collector-contrib repository by cloning it and running:
yaml configuration file.
At a minimum, you must define the URL of the APM Server instance you are sending data to. For example:
exporters: elastic: apm_server_url: "https://elasticapm.example.com"
See the configuration reference for additional configuration options, like specifying an API key, secret token, or TLS settings.
The Elastic exporter must also be defined in
service: pipelines: traces: exporters: [elastic]
If we put everything together, here’s an example configuration file that accepts input from an OpenTelemetry Agent, processes the data, and sends it to an Elasticsearch Service instance.
receivers: otlp: endpoint: localhost:55680 processors: batch: timeout: 1s send_batch_size: 1024 exporters: elastic: apm_server_url: "https://elasticapm.example.com" secret_token: "ESS_TOKEN" service: pipelines: traces: receivers: [otlp] processors: [batch] exporters: [elastic]
For more information about getting started with an OpenTelemetry Collector, see the OpenTelemetry collector docs.