OpenTelemetry Collector for Docker - Install

Prerequisites

Before installing the OpenTelemetry Collector, ensure you have:

  • Docker Engine 20.10+ installed and running
  • Administrative access to the Docker host

Installation

Step 1: Create Configuration Directory

Creates a dedicated directory to organize the OpenTelemetry Collector configuration file.

mkdir -p ~/opentelemetry-collector
cd ~/opentelemetry-collector

Step 2: Create Collector Configuration

Defines how the OpenTelemetry Collector receives, processes, and exports telemetry data to SigNoz.

Create config.yaml:

config.yaml
receivers:
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:4317
      http:
        endpoint: 0.0.0.0:4318
processors:
  batch:

exporters:
  otlp:
    endpoint: "ingest.<YOUR_REGION>.signoz.cloud:443"
    tls:
      insecure: false
    headers:
      "signoz-ingestion-key": "<YOUR_INGESTION_KEY>"
  debug:
    verbosity: normal

extensions:
  health_check:
  pprof:
  zpages:

service:
  extensions: [health_check, pprof, zpages]
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlp]
    metrics:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlp]
    logs:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlp]

Configuration Steps:

  • Set the <region> to match your SigNoz Cloud region
  • Replace <your-ingestion-key> with your SigNoz ingestion key

Step 3: Run the OpenTelemetry Collector

Starts the OpenTelemetry Collector as a Docker container to begin receiving and forwarding telemetry data to SigNoz.

docker run --name opentelemetry-collector \
  --restart unless-stopped \
  --detach \
  -p 4317:4317 -p 4318:4318 \
  -v "$(pwd)/config.yaml":/etc/otelcol-contrib/config.yaml \
  otel/opentelemetry-collector-contrib:0.130.1

Verification

Check Collector Status

Verifies that the OpenTelemetry Collector container is running and operational.

Check if container is running

docker ps | grep opentelemetry-collector

Check collector logs

docker logs opentelemetry-collector

You will see the OpenTelemetry Collector logs indicating successful startup and readiness to process data.

Send Docker data

Once you have your collector up and running, you can see your container logs, metrics and application traces by following the below links:

Troubleshooting

Container Name Already in Use

If you get an error about the container name already being in use:

# Check existing containers
docker ps -a | grep opentelemetry-collector

# Stop and remove the existing container
docker stop opentelemetry-collector
docker rm opentelemetry-collector

# Then re-run the installation command

Configuration Errors

If the collector fails to start, check the logs:

docker logs opentelemetry-collector

Common issues:

  • Invalid YAML syntax in config file
  • Missing or incorrect SigNoz credentials
  • Port conflicts with other services

The OpenTelemetry Collector is now running and ready to receive telemetry data on ports 4317 (gRPC) and 4318 (HTTP).

Was this page helpful?