ЛР6: OTel SDK, Collector, Prometheus/Loki/Tempo, Grafana, alerts, dashboard, тесты инцидентов

This commit is contained in:
2026-11-16 22:14:42 +03:00
commit e617ce2caa
87 changed files with 8695 additions and 0 deletions
+61
View File
@@ -0,0 +1,61 @@
receivers:
otlp:
protocols:
http:
endpoint: 0.0.0.0:4318
grpc:
endpoint: 0.0.0.0:4317
processors:
# Ограничивает RAM коллектора: если превысили — начинает отбрасывать данные,
# а не падает по OOM. Это требование lab6 уровня 4.
memory_limiter:
check_interval: 1s
limit_mib: 200
spike_limit_mib: 50
# Батчинг: уменьшает число запросов к backend.
batch:
timeout: 5s
send_batch_size: 1024
# Ограничивает кардинальность метрик: удаляет потенциально опасные атрибуты.
attributes/scrub:
actions:
- key: http.request.header.authorization
action: delete
- key: http.request.header.cookie
action: delete
exporters:
# Метрики — в формате Prometheus. Prometheus сам scrape'ит :8889.
prometheus:
endpoint: 0.0.0.0:8889
resource_to_telemetry_conversion:
enabled: true
# Логи — в Loki через OTLP endpoint (Loki 3.x умеет /otlp).
otlphttp/loki:
endpoint: http://loki:3100/otlp
tls:
insecure: true
# Трассы — в Tempo через OTLP gRPC.
otlp/tempo:
endpoint: tempo:4317
tls:
insecure: true
service:
pipelines:
traces:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [otlp/tempo]
metrics:
receivers: [otlp]
processors: [memory_limiter, batch, attributes/scrub]
exporters: [prometheus]
logs:
receivers: [otlp]
processors: [memory_limiter, batch, attributes/scrub]
exporters: [otlphttp/loki]
telemetry:
logs:
level: info