Install the Collector with Docker
You are viewing the English version of this page because it has not yet been fully translated. Interested in helping out? See Contributing.
Docker
The following commands pull a Docker image and run the Collector in a container.
Replace 0.139.0 with the version of the Collector you want to run.
docker pull otel/opentelemetry-collector-contrib:0.139.0
docker run otel/opentelemetry-collector-contrib:0.139.0
docker pull ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:0.139.0
docker run ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:0.139.0
To load a custom configuration file from your working directory, mount that file as a volume:
docker run -v $(pwd)/config.yaml:/etc/otelcol-contrib/config.yaml otel/opentelemetry-collector-contrib:0.139.0
docker run -v $(pwd)/config.yaml:/etc/otelcol-contrib/config.yaml ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:0.139.0
Docker Compose
You can add OpenTelemetry Collector to your existing docker-compose.yaml file
as in the following example:
otel-collector:
image: otel/opentelemetry-collector-contrib
volumes:
- ./otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml
ports:
- 1888:1888 # pprof extension
- 8888:8888 # Prometheus metrics exposed by the Collector
- 8889:8889 # Prometheus exporter metrics
- 13133:13133 # health_check extension
- 4317:4317 # OTLP gRPC receiver
- 4318:4318 # OTLP http receiver
- 55679:55679 # zpages extension
Feedback
Was this page helpful?
Thank you. Your feedback is appreciated!
Please let us know how we can improve this page. Your feedback is appreciated!