Files
mtusi2026lab6/infra/otel/collector.yaml
T
ricoromaandClaude Opus 5.5 a4497e3f32 feat: add OpenTelemetry SDK, collector and telemetry stores
Collector (contrib), Prometheus, Loki, Tempo and Grafana with provisioning
from git; SDK in API and worker with level 3 metrics, traces and logs
carrying trace_id/span_id; telemetry off by default outside the stand;
broker healthcheck runs as the broker user so a fresh stand starts once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 10:19:50 +03:00

71 lines
2.7 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# OTel Collector contrib 0.164.0 (design change otel-telemetry, решения 1, 3,
# 14): получатель, обработчик и экспортёр, не хранилище. Три pipeline — каждый
# до своего хранилища: метрики — scrape Prometheus с экспортёра prometheus,
# логи — Loki (родной OTLP), трассы — Tempo. Расширений нет (pprof, zpages,
# health_check образа не берутся). Порты наружу не публикуются: OTLP
# слушает сеть приложения, :8888 и :8889 забирает Prometheus в сети
# telemetry.
receivers:
otlp:
protocols:
# только OTLP/HTTP: SDK приложения отправляет protobuf по HTTP
http:
endpoint: 0.0.0.0:4318
processors:
# предел памяти Collector: при 200 МиБ отказ приёма (SDK получает ошибку и
# теряет пакет), всплеск — 40 МиБ; GOMEMLIMIT контейнера — 160 МиБ
memory_limiter:
check_interval: 1s
limit_mib: 200
spike_limit_mib: 40
# пакеты до хранилищ: не больше 1024 элементов или раз в секунду
batch:
send_batch_size: 1024
timeout: 1s
exporters:
# метрики приложения для scrape Prometheus (honor_labels): job =
# service.name, instance = service.instance.id, остальной ресурс —
# target_info; ряды остановленной реплики уходят через 5 мин
prometheus:
endpoint: 0.0.0.0:8889
translation_strategy: UnderscoreEscapingWithSuffixes
metric_expiration: 5m
resource_to_telemetry_conversion:
enabled: false
# sending_queue и retry_on_failure — по умолчанию: явные пределы и учёт
# потерь — change 3 (уровень 4)
otlp_http/loki:
endpoint: http://loki:3100/otlp
otlp_http/tempo:
endpoint: http://tempo:4318
service:
telemetry:
logs:
level: info
encoding: json
# собственные метрики Collector — для Prometheus (жив ли конвейер)
metrics:
level: normal
readers:
- pull:
exporter:
prometheus:
host: 0.0.0.0
port: 8888
pipelines:
metrics:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [prometheus]
logs:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [otlp_http/loki]
traces:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [otlp_http/tempo]