feat: add baseline observability for lab 6

This commit is contained in:
Dmitrii Grishko
2026-11-13 18:24:14 +03:00
parent d993866881
commit 549edc8d7a
17 changed files with 967 additions and 33 deletions
+54 -2
View File
@@ -102,13 +102,14 @@ services:
api:
cpus: 0.5
mem_limit: 512m
networks: [proxy, data]
networks: [proxy, data, telemetry]
build: ./src
deploy:
replicas: ${API_REPLICAS:-2}
stop_grace_period: 15s
environment: &api-environment
<<: *s3-environment
OTEL_EXPORTER_OTLP_ENDPOINT: ${OTEL_EXPORTER_OTLP_ENDPOINT-http://otel-collector:4318}
S3_ROOT_ACCESS_KEY_ID_FILE: ""
S3_ROOT_SECRET_ACCESS_KEY_FILE: ""
BROKER_URL_FILE: /run/secrets/broker_url
@@ -184,7 +185,7 @@ services:
restart: unless-stopped
cpus: 1.0
mem_limit: 512m
networks: [data]
networks: [data, telemetry]
environment: *api-environment
volumes: *api-volumes
command: ["./messenger", "worker"]
@@ -319,7 +320,56 @@ services:
timeout: 3s
retries: 20
otel-collector:
image: otel/opentelemetry-collector-contrib:0.120.0
networks: [telemetry]
mem_limit: 192m
command: ["--config=/etc/otelcol-contrib/config.yaml"]
volumes:
- ./infra/otel/collector.yaml:/etc/otelcol-contrib/config.yaml:ro
prometheus:
image: prom/prometheus:v3.2.1
networks: [telemetry]
command: ["--config.file=/etc/prometheus/prometheus.yml", "--storage.tsdb.path=/prometheus", "--storage.tsdb.retention.time=7d"]
volumes:
- ./infra/otel/prometheus.yaml:/etc/prometheus/prometheus.yml:ro
- prometheus_data:/prometheus
loki:
image: grafana/loki:3.4.2
networks: [telemetry]
command: ["-config.file=/etc/loki/lab.yaml"]
volumes:
- ./infra/otel/loki.yaml:/etc/loki/lab.yaml:ro
- loki_data:/loki
tempo:
image: grafana/tempo:2.7.1
networks: [telemetry]
command: ["-config.file=/etc/tempo/lab.yaml"]
volumes:
- ./infra/otel/tempo.yaml:/etc/tempo/lab.yaml:ro
- tempo_data:/var/tempo
grafana:
image: grafana/grafana:11.5.2
networks: [telemetry, edge]
environment:
GF_AUTH_ANONYMOUS_ENABLED: "true"
GF_AUTH_ANONYMOUS_ORG_ROLE: Viewer
ports:
- "127.0.0.1:${GRAFANA_HTTP_PORT:-3000}:3000"
volumes:
- ./infra/otel/grafana/provisioning:/etc/grafana/provisioning:ro
- ./infra/otel/grafana/dashboards:/var/lib/grafana/dashboards:ro
- grafana_data:/var/lib/grafana
volumes:
prometheus_data:
loki_data:
tempo_data:
grafana_data:
rabbitmq_data:
postgres_data:
redis_data:
@@ -331,3 +381,5 @@ networks:
internal: true
data:
internal: true
telemetry:
internal: true