This commit is contained in:
Vladislav Kunetskiy
2026-11-05 02:09:39 +03:00
parent edc2a405ee
commit b53ecba3e6
132 changed files with 10121 additions and 119 deletions
+11 -5
View File
@@ -1,7 +1,13 @@
# Конфигурация наблюдаемости — реализовать
# OTel Collector
Добавьте `collector.yaml` с OTLP receivers, processors и exporters выбранной версии Collector. Укажите явные bind endpoints, внутренние сети, memory limits/batch и поведение при backpressure по уровню. Сопоставьте все три pipeline с реально развёрнутыми backend.
`collector.yaml` — единственный OTLP-приёмник стенда. API/worker/relay шлют
traces/metrics/logs по HTTP `:4318`; Collector экспортирует:
- метрики — pull-exporter Prometheus `:8889` (Prometheus scrape);
- логи — OTLP HTTP в Loki `/otlp`;
- трассы — OTLP gRPC в Tempo `:4317`.
Добавьте конфигурации storage, Grafana provisioning/datasources, provisioning/dashboards и импортируемые dashboard JSON. На 4 — alert rules и runbooks. Пустой dashboard или debug exporter, который только печатает данные в stdout, не заменяют хранилища/доказательства из `contracts/observability.md`.
Не публикуйте OTLP/metrics/административные ports в общую сеть без необходимости. В lab7 реализуйте TLS/mTLS по trust matrix; экспорт Authorization и message bodies запрещён.
`memory_limiter` ограничивает 140 MiB, batch — 5 с/1024, очереди Loki/Tempo
ограничены 10 MiB (`sizer: bytes`) и retry не дольше 30 с. Self-metrics
Collector отдаются на `:8888` отдельным scrape-job. OTLP-порты не публикуются
на host; Collector подключён к `default` и `observability`, backend'ы — только
к `observability`. TLS/auth относятся к lab7.
+86
View File
@@ -0,0 +1,86 @@
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
processors:
memory_limiter:
check_interval: 1s
# limit_mib, not limit_percentage: Docker Desktop cgroup limits are easy to
# misread and a percentage would fall back to the VM total.
limit_mib: 140
spike_limit_mib: 40
batch:
timeout: 5s
send_batch_size: 1024
exporters:
# Pull-based: no sending_queue/retry for this exporter.
prometheus:
endpoint: 0.0.0.0:8889
translation_strategy: UnderscoreEscapingWithSuffixes
resource_constant_labels:
included:
- service.name
- service.instance.id
- deployment.environment.name
- service.version
otlp_http/loki:
endpoint: http://loki:3100/otlp
sending_queue:
enabled: true
sizer: bytes
queue_size: 10485760
num_consumers: 2
retry_on_failure:
enabled: true
initial_interval: 1s
max_interval: 5s
max_elapsed_time: 30s
timeout: 5s
otlp_grpc/tempo:
endpoint: tempo:4317
tls:
insecure: true
sending_queue:
enabled: true
sizer: bytes
queue_size: 10485760
num_consumers: 2
retry_on_failure:
enabled: true
initial_interval: 1s
max_interval: 5s
max_elapsed_time: 30s
timeout: 5s
extensions:
health_check:
endpoint: 0.0.0.0:13133
service:
extensions: [health_check]
telemetry:
metrics:
readers:
- pull:
exporter:
prometheus:
host: 0.0.0.0
port: 8888
pipelines:
traces:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [otlp_grpc/tempo]
metrics:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [prometheus]
logs:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [otlp_http/loki]