Files
mtusi2026lab6/infra/otel-collector.yaml
T

62 lines
1.8 KiB
YAML

receivers:
otlp:
protocols:
http:
endpoint: 0.0.0.0:4318
grpc:
endpoint: 0.0.0.0:4317
processors:
# Ограничивает RAM коллектора: если превысили — начинает отбрасывать данные,
# а не падает по OOM. Это требование lab6 уровня 4.
memory_limiter:
check_interval: 1s
limit_mib: 200
spike_limit_mib: 50
# Батчинг: уменьшает число запросов к backend.
batch:
timeout: 5s
send_batch_size: 1024
# Ограничивает кардинальность метрик: удаляет потенциально опасные атрибуты.
attributes/scrub:
actions:
- key: http.request.header.authorization
action: delete
- key: http.request.header.cookie
action: delete
exporters:
# Метрики — в формате Prometheus. Prometheus сам scrape'ит :8889.
prometheus:
endpoint: 0.0.0.0:8889
resource_to_telemetry_conversion:
enabled: true
# Логи — в Loki через OTLP endpoint (Loki 3.x умеет /otlp).
otlphttp/loki:
endpoint: http://loki:3100/otlp
tls:
insecure: true
# Трассы — в Tempo через OTLP gRPC.
otlp/tempo:
endpoint: tempo:4317
tls:
insecure: true
service:
pipelines:
traces:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [otlp/tempo]
metrics:
receivers: [otlp]
processors: [memory_limiter, batch, attributes/scrub]
exporters: [prometheus]
logs:
receivers: [otlp]
processors: [memory_limiter, batch, attributes/scrub]
exporters: [otlphttp/loki]
telemetry:
logs:
level: info