# OpenTelemetry Collector (otel/opentelemetry-collector-contrib 0.165.0), lab 6. # # API x2 / relay / worker --OTLP/HTTP protobuf :4318--> [receiver otlp] # -> memory_limiter -> batch -> exporters: # traces -> Tempo (otlp_http/tempo, http://tempo:4318/v1/traces) # metrics -> Prometheus (otlp_http/prometheus, http://prometheus:9090/api/v1/otlp/v1/metrics) # logs -> Loki (otlp_http/loki, http://loki:3100/otlp/v1/logs) # # The Collector stores nothing for long: it receives, limits, batches and forwards. When a backend # is down, each exporter keeps a BOUNDED queue (sending_queue) and retries for at most # max_elapsed_time; then the data is dropped and counted (otelcol_exporter_send_failed_*, # otelcol_exporter_enqueue_failed_*). memory_limiter refuses new data above its limit (the SDKs # get a retryable error and drop after their own bounded queue) instead of growing until OOM. # Its own metrics: Prometheus scrapes :8888 (otelcol_*). Only on the internal `telemetry` network. # # Traces pipeline variants (track 1, docs/TRACK1.md): this file keeps EVERY span; the overlay # traces-tail.yaml (passed as a second --config, compose OTEL_COLLECTOR_TRACES) adds tail sampling. extensions: health_check: endpoint: 0.0.0.0:13133 receivers: otlp: protocols: http: endpoint: 0.0.0.0:4318 max_request_body_size: 8388608 # 8 MiB per export request processors: # First in every pipeline. Container limit 512 MiB: soft limit = 400 - 80 = 320 MiB (start # refusing + GC), hard limit 400 MiB (forced GC). The contrib binary alone is ~150 MiB RSS; # 256 MiB of container memory left the limiter refusing data at idle. GOMEMLIMIT = 360 MiB. memory_limiter: check_interval: 1s limit_mib: 400 spike_limit_mib: 80 # Fewer, larger requests to the backends; at most 2 s of delay. batch: send_batch_size: 1024 send_batch_max_size: 2048 timeout: 2s exporters: otlp_http/tempo: endpoint: http://tempo:4318 timeout: 5s sending_queue: &queue enabled: true num_consumers: 2 queue_size: 100 # batches (<= 2048 items each): bounded, in memory only retry_on_failure: &retry enabled: true initial_interval: 1s max_interval: 10s max_elapsed_time: 60s # then the batch is dropped (counted), never retried forever otlp_http/prometheus: endpoint: http://prometheus:9090/api/v1/otlp timeout: 5s sending_queue: *queue retry_on_failure: *retry otlp_http/loki: endpoint: http://loki:3100/otlp timeout: 5s sending_queue: *queue retry_on_failure: *retry service: extensions: [health_check] telemetry: logs: level: warn metrics: level: normal readers: - pull: exporter: prometheus: host: 0.0.0.0 port: 8888 pipelines: traces: receivers: [otlp] processors: [memory_limiter, batch] exporters: [otlp_http/tempo] metrics: receivers: [otlp] processors: [memory_limiter, batch] exporters: [otlp_http/prometheus] logs: receivers: [otlp] processors: [memory_limiter, batch] exporters: [otlp_http/loki]