feat: telemetry cost profile with head sampling, coarse buckets and balanced tail sampling

- [telemetry] trace_sample_ratio (ParentBased(TraceIdRatioBased), 1 keeps
  ParentBased(ALWAYS_ON)) and metric_buckets (default|coarse with SLO bounds),
  export interval <= 30 s; otel.sdk.span.started, span.live dropped; startup
  records name ratio, buckets and interval
- bench: telemetry services on mtusi-bench, TELEMETRY=on switch for uploads
  and queue, make bench_telemetry[_quick] with off/full/full-aa/head/tail/
  metrics/balanced, rare events, lookup from Tempo/Loki/Prometheus, cost
  sampler, verdicts H1-H8 and B1-B5; collector layers and lean Prometheus in
  bench/otel with preflight checks
- REPORT: telemetry cost hypotheses and criteria before the label

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-14 19:17:25 +03:00
co-authored by Claude Opus 5.5
parent 37f86801d6
commit 509afca89e
43 changed files with 5784 additions and 159 deletions
+3
View File
@@ -29,6 +29,9 @@
# OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf — постоянно (установлен только
# экспортёр OTLP/HTTP protobuf); OTEL_RESOURCE_ATTRIBUTES — [telemetry]
# environment (deployment.environment.name), service.* вычисляет код.
# Стандартные имена выбора трасс тоже не настройки: OTEL_TRACES_SAMPLER —
# постоянно parentbased_traceidratio (при доле 1 — parentbased_always_on),
# OTEL_TRACES_SAMPLER_ARG — [telemetry] trace_sample_ratio.
# Включает телеметрию compose (TELEMETRY__ENABLED у api, worker и relay), в .env её
# нет: консоль — без телеметрии.