Complete lab7 grade 4 implementation
Skeleton contracts / contracts (pull_request) Canceled after 0s

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
HellsTomato
2026-11-06 15:35:53 +03:00
co-authored by Copilot
parent 20afc2c790
commit 2ef0299e34
68 changed files with 8073 additions and 77 deletions
+63
View File
@@ -0,0 +1,63 @@
# OTel Collector: принимает OTLP от API и worker, ограничивает память, батчит и раскладывает сигналы
# по хранилищам. Сам ничего долго не хранит: очереди экспорта ограничены, повторы — не дольше 60 с.
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
processors:
# Первым в цепочке: при превышении лимита Collector отказывает приёмом (SDK повторит/отбросит), а не растёт в RAM.
memory_limiter:
check_interval: 1s
limit_mib: 180
spike_limit_mib: 40
batch:
send_batch_size: 1024
timeout: 2s
exporters:
otlphttp/prometheus:
endpoint: http://prometheus:9090/api/v1/otlp
sending_queue: { queue_size: 500 }
retry_on_failure: { max_elapsed_time: 60s }
otlphttp/loki:
endpoint: http://loki:3100/otlp
sending_queue: { queue_size: 500 }
retry_on_failure: { max_elapsed_time: 60s }
otlp/tempo:
endpoint: tempo:4317
tls: { insecure: true }
sending_queue: { queue_size: 500 }
retry_on_failure: { max_elapsed_time: 60s }
extensions:
health_check:
endpoint: 0.0.0.0:13133
service:
extensions: [health_check]
# Собственные метрики Collector (принято/отброшено/ошибки экспорта) — их собирает Prometheus.
telemetry:
metrics:
readers:
- pull:
exporter:
prometheus:
host: 0.0.0.0
port: 8888
pipelines:
traces:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [otlp/tempo]
metrics:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [otlphttp/prometheus]
logs:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [otlphttp/loki]
+18
View File
@@ -0,0 +1,18 @@
server {
listen 4318 ssl;
server_name otel-gateway;
ssl_certificate /run/secrets/collector.crt;
ssl_certificate_key /run/secrets/collector.key;
ssl_client_certificate /run/secrets/ca.crt;
ssl_verify_client on;
ssl_verify_depth 2;
ssl_protocols TLSv1.2 TLSv1.3;
if ($ssl_client_s_dn !~ "^CN=(api-otel|worker-otel)$") { return 403; }
location / {
proxy_pass http://otel-collector:4318;
proxy_set_header Connection "";
proxy_http_version 1.1;
proxy_read_timeout 60s;
proxy_send_timeout 60s;
}
}