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
+18
View File
@@ -648,6 +648,23 @@ def fmt(value: float | None, digits: int = 1) -> str:
return "—" if value is None else f"{value:.{digits}f}"
def telemetry_line(profile: dict[str, Any]) -> str:
"""Режим телеметрии метки (design change `track1-telemetry-cost`, решение
13): у варианта «до» SDK в коде нет — с `on` сравнение смешанное."""
if profile.get("telemetry") != "on":
return "Телеметрия стенда выключена (TELEMETRY=off)"
text = (
"Телеметрия стенда включена (TELEMETRY=on): SDK реплики с настройками "
"рабочего стенда, Collector, Prometheus, Loki и Tempo рабочего стенда"
)
if "before" in profile.get("uploads_variants", ()):
text += (
"; вариант «до» — образ кода без SDK, его сравнение с остальными "
"вариантами смешанное (с телеметрией против без неё)"
)
return text
def render_summary(meta: dict[str, Any], rows: list[dict[str, Any]]) -> str:
"""`summary.md` метки: паспорт кратко, таблица ячеек (медиана и
min–max повторов), сценарии спеков и гипотезы."""
@@ -710,6 +727,7 @@ def render_summary(meta: dict[str, Any], rows: list[dict[str, Any]]) -> str:
"Значения — медиана (min–max) повторов",
"- Посторонние контейнеры в VM во время замера: "
+ (", ".join(meta.get("other_containers") or []) or "нет"),
"- " + telemetry_line(profile),
"",
"## Ячейки",
"",