Skip to content

OpenTelemetry Collector Configuration

The configuration for an OpenTelemetry Collector is defined using a YAML structure that specifies the receiver, processing, and exporting behaviors of the service^[400-devops-07-monitoring-and-observability-k8s-istio-samples-open-telemetry-readme.md].

Basic Structure

A standard configuration file consists of four main top-level keys: receivers, processors, exporters, and service^[400-devops-07-monitoring-and-observability-k8s-istio-samples-open-telemetry-readme.md].

  • Receivers: Define how data enters the collector, such as via gRPC or HTTP protocols under the OpenTelemetry Protocol (OTLP)^[400-devops-07-monitoring-and-observability-k8s-istio-samples-open-telemetry-readme.md].
  • Processors: Modify data between reception and export, commonly using a batch processor to optimize throughput^[400-devops-07-monitoring-and-observability-k8s-istio-samples-open-telemetry-readme.md].
  • Exporters: Determine where the data is sent. A basic configuration often uses a logging exporter to output to stdout^[400-devops-07-monitoring-and-observability-k8s-istio-samples-open-telemetry-readme.md].
  • Service: Defines the pipelines that wire the components together (e.g., a logs pipeline connecting an OTLP receiver to a batch processor and then to a logging exporter)^[400-devops-07-monitoring-and-observability-k8s-istio-samples-open-telemetry-readme.md].

Example Configuration

The following sample demonstrates a basic setup that creates a gRPC receiver on port 4317 and outputs logs to the console^[400-devops-07-monitoring-and-observability-k8s-istio-samples-open-telemetry-readme.md]:

receivers:
  otlp:
    protocols:
      grpc:
      http:
processors:
  batch:
exporters:
  logging:
    loglevel: debug
service:
  pipelines:
    logs:
      receivers: [otlp]
      processors: [batch]
      exporters: [logging]

Sources

^[400-devops-07-monitoring-and-observability-k8s-istio-samples-open-telemetry-readme.md]