OTel Config Examples

An OpenTelemetry receiver ingests telemetry data (metrics, logs, traces) in specific formats from agents or services and forwards it through a processing pipeline. A full raw configuration involves manually defining the entire pipeline—receivers, processors, and exporters—providing full control over data flow, enrichment, and output. Below are some example configuration templates to help you get started.

OTel Full Raw Configuration Examples

Below are full raw configuration examples for OpenTelemetry Collector deployments, covering Windows, Linux, and macOS environments. These examples demonstrate end-to-end pipeline setups, including receivers, processors, and exporters, tailored for each operating system.

Windows

Use otlp with TLS (if required) not otlphttp since it’s more efficient.

receivers:
  windowseventlog/security:
    channel: security

processors:
  attributes:
    actions:
      - key: environment
        value: "production"
        action: insert

exporters:
  otlp/observo:
    endpoint: 34.63.104.225:8004
    compression: gzip
    retry_on_failure:
      enabled: true
      initial_interval: 5s
      max_elapsed_time: 300s
      max_interval: 30s
    timeout: 30s
    tls:
      insecure: true

service:
  pipelines:
    logs:
      receivers: [windowseventlog/security]
      processors: [attributes]
      exporters: [otlp/observo]

Linux

receivers:
  # System metrics
  hostmetrics:
    collection_interval: 30s
    scrapers:
      cpu:
      disk:
      filesystem:
      memory:
      network:
      process:

  # System logs
  filelog:
    include:
      - /var/log/syslog
      - /var/log/messages
      - /var/log/auth.log
      - /var/log/*.log
    exclude:
      - /var/log/*.gz

  # OTLP receiver
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:4317
      http:
        endpoint: 0.0.0.0:4318

processors:
  memory_limiter:
    limit_mib: 256

  batch:
    timeout: 1s
    send_batch_size: 1024

  resource:
    attributes:
      - key: service.name
        value: linux-host
        action: upsert

exporters:
  otlphttp:
    endpoint: https://api.observo.ai/v1/logs
    headers:
      authorization: "Bearer YOUR_API_TOKEN"
    compression: gzip

  debug:
    verbosity: basic

service:
  pipelines:
    metrics:
      receivers: [hostmetrics, otlp]
      processors: [memory_limiter, batch, resource]
      exporters: [otlphttp, debug]

    logs:
      receivers: [filelog, otlp]
      processors: [memory_limiter, batch, resource]
      exporters: [otlphttp, debug]

    traces:
      receivers: [otlp]
      processors: [memory_limiter, batch, resource]
      exporters: [otlphttp, debug]

macOS

This section is reserved for macOS. Updates will follow based on available macOS functionality.

OTel Receiver Examples

WIndows

Single Receiver:

receivers:
  windowseventlog:
    channel: system

Multiple Receivers:

receivers:
  windowseventlog:
    channels:
      - name: application
      - name: security
      - name: system

Linux

Single Receiver:

receivers:
  filelog/1:
    include: [/opt/observo/readlog/*.log]
    exclude: [/opt/observo/readlog/debug.log]

Multiple Receivers:

# File Log Receiver - System Logs
filelog/system:
  include:
    - /var/log/syslog
    - /var/log/messages
    - /var/log/auth.log
    - /var/log/kern.log
    - /var/log/secure
  exclude:
    - /var/log/*.gz
    - /var/log/.*

---

# File Log Receiver - Application Logs
filelog/apps:
  include:
    - /var/log/apache2/*.log
    - /var/log/nginx/*.log
    - /var/log/mysql/*.log
    - /var/log/postgresql/*.log
    - /opt/app/logs/*.log
    - /home/*/logs/*.log
  exclude:
    - /var/log/**/*.gz
    - /var/log/**/.*

---

# File Log Receiver - Docker Container Logs
filelog/docker:
  include:
    - /var/lib/docker/containers/*/*.log
  exclude:
    - /var/lib/docker/containers/*/*.gz

---

# File Log Receiver - Custom Application
filelog/myapp:
  include:
    - /opt/myapp/logs/*.log
    - /opt/myapp/logs/**/*.log
  exclude:
    - /opt/myapp/logs/debug/*.log
    - /opt/myapp/logs/*.old

macOS

This section is reserved for macOS. Updates will follow based on available macOS functionality.

Resources

For additional guidance and detailed information, refer to the following resources:

OpenTelemetry Resources

  • OpenTelemetry Official Documentation: Learn about OTel standards, including receivers, processors, exporters, and the OTLP protocol. See OTel Docs.

  • OpenTelemetry Collector GitHub Repository: Source code and configuration examples for the OTel Collector. See Github reference.

  • OTel Configuration Best Practices: Guide to writing efficient and secure OTel configurations. See OTel Guides.

Last updated

Was this helpful?