Docker
This guide configures logs, traces, metrics. Replace YOUR_INGEST_KEY with your key on your server, never in a public example.
1. Save collector.yaml
Section titled “1. Save collector.yaml”The container network can reach this receiver. Publish it only on loopback if host applications need access. To ingest container stdout, add the Collector filelog receiver with read-only mounts for your runtime log files, or use the Vector docker_logs source below.
receivers: otlp: protocols: http: endpoint: 0.0.0.0:4318processors: memory_limiter: check_interval: 1s limit_mib: 256 spike_limit_mib: 64 resource: attributes: - {key: service.name, value: "my-service", action: upsert} - {key: deployment.environment.name, value: "production", action: upsert} batch: send_batch_size: 256 send_batch_max_size: 512 timeout: 1sexporters: otlphttp/siteqwality: endpoint: https://otlp.siteqwality.com headers: Authorization: "Bearer YOUR_INGEST_KEY" compression: gzip sending_queue: {enabled: true, queue_size: 1000} retry_on_failure: {enabled: true, initial_interval: 1s, max_interval: 30s, max_elapsed_time: 300s}service: pipelines: logs: receivers: [otlp] processors: [memory_limiter, resource, batch] exporters: [otlphttp/siteqwality] traces: receivers: [otlp] processors: [memory_limiter, resource, batch] exporters: [otlphttp/siteqwality] metrics: receivers: [otlp] processors: [memory_limiter, resource, batch] exporters: [otlphttp/siteqwality]2. Save compose.yaml
Section titled “2. Save compose.yaml”Choose a released Collector version and pin its image digest for production. Keep collector.yaml private because it contains the key. Applications in this Compose network use http://collector:4318, not the cloud key.
services: collector: image: otel/opentelemetry-collector-contrib:${COLLECTOR_VERSION:?set a released version} command: ["--config=/etc/otelcol-contrib/config.yaml"] volumes: ["./collector.yaml:/etc/otelcol-contrib/config.yaml:ro"] ports: ["127.0.0.1:4318:4318"] restart: unless-stopped3. Start and inspect
Section titled “3. Start and inspect”Enable SDK instrumentation in your app, send a request and inspect the selected explorer. Container stdout is separate from OTLP until you configure its log source.
export COLLECTOR_VERSION=YOUR_RELEASED_COLLECTOR_VERSIONdocker compose configdocker compose up -ddocker compose logs --tail=50 collectorSee your data
Section titled “See your data”Open Logs, Traces or Metrics. New data usually shows up within a minute, and a page that says it is waiting for data switches to your data on its own. Nothing arriving? See what each status code means in failure handling.
Production checklist
Section titled “Production checklist”Store the key in your platform secret mechanism, rotate it when exposed and remove test keys. Set a stable service.name and deployment.environment.name; avoid user IDs or unbounded values in metric labels. Prefer a persistent queue, bounded retries and exporter failure monitoring. Review redaction and processors before increasing traffic.