From 1be8f323a5bcda13750e95cc5ffa6837fda9ac7c Mon Sep 17 00:00:00 2001 From: vasyukova Date: Fri, 30 Oct 2026 19:16:04 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D1=84=D0=B8=D0=BA=D1=81=D0=B8?= =?UTF-8?q?=D0=BB=D0=B0=20=D0=BF=D1=80=D0=BE=D1=85=D0=BE=D0=B6=D0=B4=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D1=82=D0=B5=D1=81=D1=82=D0=BE=D0=B2=20?= =?UTF-8?q?=D0=B4=D0=BB=D1=8F=20OTel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- infra/otel/collector.yaml | 20 ++++++++++++++++++++ student-tests/lab6_test_level4.py | 5 ++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/infra/otel/collector.yaml b/infra/otel/collector.yaml index d6e202b..29810ad 100644 --- a/infra/otel/collector.yaml +++ b/infra/otel/collector.yaml @@ -24,14 +24,34 @@ processors: action: upsert exporters: + # Явно ограничиваем retry и время ожидания, чтобы при недоступном + # бэкенде коллектор не накапливал данные и не падал. otlphttp/tempo: endpoint: http://tempo:4318 tls: insecure: true + retry_on_failure: + enabled: true + initial_interval: 1s + max_interval: 10s + max_elapsed_time: 60s + sending_queue: + enabled: true + num_consumers: 4 + queue_size: 1000 otlphttp/loki: endpoint: http://loki:3100/otlp tls: insecure: true + retry_on_failure: + enabled: true + initial_interval: 1s + max_interval: 10s + max_elapsed_time: 60s + sending_queue: + enabled: true + num_consumers: 4 + queue_size: 1000 prometheus: endpoint: 0.0.0.0:8889 resource_to_telemetry_conversion: diff --git a/student-tests/lab6_test_level4.py b/student-tests/lab6_test_level4.py index bacc923..c505091 100644 --- a/student-tests/lab6_test_level4.py +++ b/student-tests/lab6_test_level4.py @@ -482,7 +482,10 @@ def test_telemetry_backend_down(c): time.sleep(0.2) check(ok >= 5, "API unavailable while telemetry backend is down (ok=%d)" % ok) - ps = _compose_exec("otel-collector", "true") + # В образе otel/opentelemetry-collector-contrib нет coreutils `true`, + # поэтому проверяем живость штатным бинарником самого коллектора + # (тот же приём, что в healthcheck compose.yaml). + ps = _compose_exec("otel-collector", "/otelcol-contrib", "--version") check(ps.returncode == 0, "otel-collector died while backends were unavailable")