An example of the configuration file for the OpenTelemetry (OTel) Collector is as follows:

receivers:
  otlp:
    protocols:
      grpc:
      http:
  otlp/withendpoint:
    protocols:
      grpc:
        endpoint: localhost:4317

exporters:
  debug:
    verbosity: detailed
  file:
    path: ./export.json
  otlp/elastic: 
    endpoint: localhost:8200
    insecure: true

processors:
  batch:

service:
  pipelines:
    traces:
      receivers: [otlp, otlp/withendpoint]
      exporters: [debug, otlp/elastic]
    

In this configuration file:

  • The receivers section specifies how the OTel Collector receives telemetry data using OTLP over gRPC and HTTP protocols.
  • The processors section specifies how the collected telemetry data is processed before export.
  • The exporters section specifies the destinations for telemetry data, such as debug output, file storage, and an OTLP endpoint.
  • The service section defines pipelines for traces, including how receivers and exporters are connected.