Quick Guide for OTel Agent on Docker for Traces

The OpenTelemetry Collector agent runs as a Docker container and collects traces, metrics, and logs from your applications to send to Kloudfuse. This guide provides a sample configuration file that you can use to set up the collector with the required resource attributes. Refer to the detailed documentation for additional configuration options and troubleshooting steps.

Use the following sample file to configure the OpenTelemetry Collector to export logs, metrics, and traces to Kloudfuse.

You must supply the resource attribute kf_platform with value docker.

receivers:
  otlp:
    protocols:
      grpc:
      http:
        cors:
          allowed_origins:
            - "http://*"
            - "https://*"

exporters:
  otlphttp:
    logs_endpoint: https://<REPLACE WITH KFUSE ADDRESS>/ingester/otlp/v1/logs
    metrics_endpoint: https://<REPLACE WITH KFUSE ADDRESS>/ingester/otlp/metrics
    traces_endpoint: https://<REPLACE WITH KFUSE ADDRESS>/ingester/otlp/traces

processors:
  batch:
    timeout: 10s
  resource:
    attributes:
      - key: kf_platform
        value: "docker"
        action: upsert
  resourcedetection:
    detectors:
      - env
      - docker
      - ec2
      - gcp
      - azure
    override: true
    timeout: 2s

connectors:
  spanmetrics:

service:
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch, resource, resourcedetection]
      exporters: [otlphttp]
    metrics:
      exporters: [otlphttp]
      processors: [batch, resource, resourcedetection]
      receivers: [otlp]
    logs:
      exporters: [otlphttp]
      processors: [batch, resource, resourcedetection]
      receivers: [otlp]
yaml

For additional information, see Otel Collector for Docker.