forked from mtusi2026/mtusi2026lab6
feat: core func lab6, loki, prometeus etc
This commit is contained in:
+82
-1
@@ -43,6 +43,7 @@ x-api: &api
|
||||
- edge
|
||||
- backend
|
||||
- storage
|
||||
- ingest
|
||||
healthcheck:
|
||||
test: ["CMD", "python", "src/healthcheck.py"]
|
||||
interval: 5s
|
||||
@@ -84,7 +85,7 @@ services:
|
||||
build:
|
||||
context: .
|
||||
args:
|
||||
APP_REVISION: ${APP_REVISION:-dev}
|
||||
APP_REVISION: ${APP_REVISION}
|
||||
deploy:
|
||||
<<: *api-resources
|
||||
replicas: ${API_REPLICAS:-2}
|
||||
@@ -289,6 +290,9 @@ services:
|
||||
<<: *app
|
||||
command: ["python", "src/dispatcher.py"]
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
<<: *app-network
|
||||
OTEL_SERVICE_NAME: messenger-dispatcher
|
||||
depends_on:
|
||||
migrate:
|
||||
condition: service_completed_successfully
|
||||
@@ -298,6 +302,7 @@ services:
|
||||
- broker_url
|
||||
networks:
|
||||
- backend
|
||||
- ingest
|
||||
healthcheck:
|
||||
test: ["CMD", "python", "src/healthcheck.py", "dispatcher"]
|
||||
interval: 5s
|
||||
@@ -315,6 +320,9 @@ services:
|
||||
<<: *app
|
||||
command: ["python", "src/worker.py"]
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
<<: *app-network
|
||||
OTEL_SERVICE_NAME: messenger-worker
|
||||
depends_on:
|
||||
migrate:
|
||||
condition: service_completed_successfully
|
||||
@@ -329,6 +337,7 @@ services:
|
||||
networks:
|
||||
- backend
|
||||
- storage
|
||||
- ingest
|
||||
healthcheck:
|
||||
test: ["CMD", "python", "src/healthcheck.py", "worker"]
|
||||
interval: 5s
|
||||
@@ -353,7 +362,73 @@ services:
|
||||
<<: *api-resources
|
||||
replicas: 1
|
||||
|
||||
otel-collector:
|
||||
image: otel/opentelemetry-collector-contrib:0.145.0
|
||||
command: ["--config=/etc/otelcol-contrib/collector.yaml"]
|
||||
volumes:
|
||||
- ./infra/otel/collector.yaml:/etc/otelcol-contrib/collector.yaml:ro
|
||||
networks: [ingest, monitoring]
|
||||
mem_limit: 256m
|
||||
restart: unless-stopped
|
||||
|
||||
prometheus:
|
||||
image: prom/prometheus:v3.11.3
|
||||
command:
|
||||
- --config.file=/etc/prometheus/prometheus.yaml
|
||||
- --storage.tsdb.path=/prometheus
|
||||
- --storage.tsdb.retention.time=7d
|
||||
volumes:
|
||||
- ./infra/prometheus:/etc/prometheus:ro
|
||||
- prometheus_data:/prometheus
|
||||
networks: [monitoring]
|
||||
mem_limit: 384m
|
||||
restart: unless-stopped
|
||||
|
||||
loki:
|
||||
image: grafana/loki:3.6.8
|
||||
command: ["-config.file=/etc/loki/loki.yaml"]
|
||||
volumes:
|
||||
- ./infra/loki/loki.yaml:/etc/loki/loki.yaml:ro
|
||||
- loki_data:/loki
|
||||
networks: [monitoring]
|
||||
mem_limit: 512m
|
||||
restart: unless-stopped
|
||||
|
||||
tempo:
|
||||
image: grafana/tempo:2.9.0
|
||||
command: ["-config.file=/etc/tempo/tempo.yaml"]
|
||||
volumes:
|
||||
- ./infra/tempo/tempo.yaml:/etc/tempo/tempo.yaml:ro
|
||||
- tempo_data:/var/tempo
|
||||
networks: [monitoring]
|
||||
mem_limit: 384m
|
||||
restart: unless-stopped
|
||||
|
||||
grafana:
|
||||
image: grafana/grafana:13.2.4
|
||||
environment:
|
||||
GF_AUTH_ANONYMOUS_ENABLED: "true"
|
||||
GF_AUTH_ANONYMOUS_ORG_ROLE: Viewer
|
||||
GF_SECURITY_ADMIN_PASSWORD__FILE: /run/secrets/grafana_admin_password
|
||||
GF_USERS_ALLOW_SIGN_UP: "false"
|
||||
GF_ANALYTICS_REPORTING_ENABLED: "false"
|
||||
GF_ANALYTICS_CHECK_FOR_UPDATES: "false"
|
||||
secrets: [grafana_admin_password]
|
||||
ports:
|
||||
- "127.0.0.1:${GRAFANA_PORT}:3000"
|
||||
volumes:
|
||||
- ./infra/grafana/provisioning:/etc/grafana/provisioning:ro
|
||||
- ./infra/grafana/dashboards:/etc/grafana/dashboards:ro
|
||||
- grafana_data:/var/lib/grafana
|
||||
networks: [edge, monitoring]
|
||||
mem_limit: 384m
|
||||
restart: unless-stopped
|
||||
|
||||
networks:
|
||||
ingest:
|
||||
internal: true
|
||||
monitoring:
|
||||
internal: true
|
||||
edge: {}
|
||||
backend:
|
||||
internal: true
|
||||
@@ -367,9 +442,15 @@ volumes:
|
||||
postgres_data:
|
||||
s3_data:
|
||||
rabbitmq_data:
|
||||
prometheus_data:
|
||||
loki_data:
|
||||
tempo_data:
|
||||
grafana_data:
|
||||
|
||||
# Создаются scripts/init-secrets.sh; в git не попадают
|
||||
secrets:
|
||||
grafana_admin_password:
|
||||
file: ./secrets/grafana_admin_password
|
||||
broker_url:
|
||||
file: ./secrets/broker_url
|
||||
s3_access_key_id:
|
||||
|
||||
Reference in New Issue
Block a user