opentelemetry

Manually configure the Elastic Distribution of OpenTelemetry Collector

Collecting logs and host metrics with the Elastic Distribution of OpenTelemetry (EDOT) Collector without using the guided onboarding requires completing some manual steps.

Before you begin

The EDOT Collector has the following requirements:

Collect your logs and metrics

To manually configure the EDOT Collector, gather the following information:

Then manually configure the EDOT Collector to collect logs and metrics on a MacOS or Linux system:

  1. Download and extract the standalone Elastic Agent for your platform. For more on downloading and extracting a standalone Elastic Agent, refer to the first step in Install standalone Elastic Agents.
  2. From the Elastic Agent base directory, go to the otel_samples directory. The platformlogs_hostmetrics.yml file has the configurations for the receivers, processors, and exporters needed to collect logs and host metrics.
  3. Copy the content of the platformlogs_hostmetrics.yml file.
  4. From the Elastic Agent base directory, open the otel.yml file, and replace the content with the copied content from platformlogs_hostmetrics.yml.
  5. Find and update the following settings in the configuration:
    • file_storage.directory: Set to the directory where you want to store you OpenTelemetry data.
    • elasticsearch.endpoint: Set to your Elasticsearch endpoint you copied earlier.
    • elasticsearch.api_key: Set to the API key you created earlier.
  6. Run the EDOT collector with the following command:
    ./elastic-agent otel --config otel.yml
    

Logs are collected from setup onward, so you won’t see logs that occurred before starting the collector. The default log path is /var/log/*. Update the path in the otel.yml file.

Limitations

Refer to Elastic OpenTelemetry Collector limitations for known limitations when using the Elastic Distribution of the OpenTelemetry collector.