feat: completed tasks for grade 4

This commit is contained in:
2026-11-22 14:40:35 +03:00
parent 0b97f77d76
commit e0263ba902
42 changed files with 5257 additions and 523 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
# Наблюдаемость Messenger
API, publisher и worker экспортируют метрики, логи и трассы по OTLP HTTP/protobuf на `otel-collector:4318` с TLS и сертификатом роли ingest. Collector отправляет логи в Loki и трассы в Tempo с write identity. Grafana читает три источника через read identity. Prometheus собирает метрики с TLS и scrape identity.
API, publisher и worker экспортируют метрики, логи и трассы по OTLP HTTP/protobuf на `otel-collector:4318` через mTLS с отдельными cert-ролями `otel-api`, `otel-publisher` и `otel-worker`. nginx проверяет цепочку и CN, затем передаёт запрос в локальный OTLP-порт 14318. Collector отправляет логи в Loki и трассы в Tempo с write identity. Grafana читает три источника через read identity. Prometheus собирает метрики с TLS и scrape identity.
У Collector HTTPS-экспорт метрик приложения работает на 8889. Метрики самого SDK на loopback 8887 проходят через `collector-scrape` на HTTPS 8888. Службы в других контейнерах не могут обратиться к plaintext-порту. Grafana доступна по HTTPS на loopback, анонимный доступ выключен.
+23
View File
@@ -1,6 +1,29 @@
events {}
http {
map $ssl_client_s_dn $ingest_allowed {
default 0;
CN=otel-api 1;
CN=otel-worker 1;
CN=otel-publisher 1;
}
server {
listen 4318 ssl;
ssl_certificate /run/tls/server.crt;
ssl_certificate_key /run/tls/server.key;
ssl_client_certificate /run/tls/otel-ingest-ca.crt;
ssl_verify_client on;
ssl_protocols TLSv1.2 TLSv1.3;
location ~ ^/v1/(logs|metrics|traces)$ {
if ($ingest_allowed = 0) { return 403; }
proxy_pass http://127.0.0.1:14318;
}
location / { return 404; }
}
server {
listen 8888 ssl;
ssl_certificate /run/tls/server.crt;
+1 -5
View File
@@ -2,11 +2,7 @@ receivers:
otlp:
protocols:
http:
endpoint: 0.0.0.0:4318
tls:
cert_file: /run/tls/server.crt
key_file: /run/tls/server.key
client_ca_file: /run/tls/otel-ingest-ca.crt
endpoint: 127.0.0.1:14318
processors:
memory_limiter:
check_interval: 1s