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>
This commit is contained in:
2026-11-11 10:19:50 +03:00
co-authored by Claude Opus 5.5
parent 9b35c256b7
commit a4497e3f32
62 changed files with 6175 additions and 214 deletions
+18
View File
@@ -184,3 +184,21 @@ max_published_backlog = 1000
republish_after_seconds = 300
# секунды паузы после отказа брокера или PostgreSQL
failure_pause_seconds = 2
[telemetry]
# Телеметрия API и worker (OpenTelemetry SDK → Collector). Включение и адрес
# Collector здесь не задаются: файл монтируется и в консольный запуск, а
# телеметрию включает compose у api и worker (TELEMETRY__ENABLED,
# TELEMETRY__OTLP_ENDPOINT). Переменные OTEL_* настройками не являются.
# deployment.environment.name ресурса
environment = "lab"
# секунды между отправками метрик
metric_export_interval_seconds = 15
# секунды на одну отправку пакета
export_timeout_seconds = 2
# span и записей журнала в очереди SDK; сверх — теряются
max_queue_size = 2048
# span и записей в одной отправке; не больше очереди
max_export_batch_size = 512
# секунды паузы между пакетами
schedule_delay_seconds = 1