forked from mtusi2026/mtusi2026lab6
reyalysed grade 3
This commit is contained in:
@@ -11,6 +11,8 @@ x-base-env: &base-env
|
||||
APP_HOST: ${APP_HOST:?Set APP_HOST in .env}
|
||||
APP_PORT: ${APP_PORT:?Set APP_PORT in .env}
|
||||
APP_ENV: ${APP_ENV:?Set APP_ENV in .env}
|
||||
OTEL_ENABLED: ${OTEL_ENABLED:-true}
|
||||
OTEL_EXPORTER_OTLP_ENDPOINT: ${OTEL_EXPORTER_OTLP_ENDPOINT:-http://otel-collector:4318}
|
||||
LOG_LEVEL: ${LOG_LEVEL:?Set LOG_LEVEL in .env}
|
||||
MAX_MESSAGES: ${MAX_MESSAGES:?Set MAX_MESSAGES in .env}
|
||||
MAX_IN_FLIGHT: ${MAX_IN_FLIGHT:?Set MAX_IN_FLIGHT in .env}
|
||||
@@ -388,11 +390,105 @@ services:
|
||||
cpus: "0.5"
|
||||
memory: 128M
|
||||
|
||||
|
||||
otel-collector:
|
||||
image: otel/opentelemetry-collector-contrib:0.165.0
|
||||
command: ["--config=/etc/otelcol/config.yaml"]
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./infra/otel/collector.yaml:/etc/otelcol/config.yaml:ro
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: "0.5"
|
||||
memory: 256M
|
||||
|
||||
prometheus:
|
||||
image: prom/prometheus:v3.16.0
|
||||
command: ["--config.file=/etc/prometheus/prometheus.yml", "--storage.tsdb.retention.time=3d"]
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./infra/otel/prometheus.yaml:/etc/prometheus/prometheus.yml:ro
|
||||
- prometheusdata:/prometheus
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "-q", "-O", "/dev/null", "http://127.0.0.1:9090/-/ready"]
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 20
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: "0.5"
|
||||
memory: 512M
|
||||
|
||||
loki:
|
||||
image: grafana/loki:3.7.10
|
||||
command: ["-config.file=/etc/loki/config.yaml"]
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./infra/otel/loki.yaml:/etc/loki/config.yaml:ro
|
||||
- lokidata:/loki
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: "0.5"
|
||||
memory: 512M
|
||||
|
||||
tempo:
|
||||
image: grafana/tempo:2.9.0
|
||||
user: "0:0"
|
||||
command: ["-config.file=/etc/tempo/config.yaml"]
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./infra/otel/tempo.yaml:/etc/tempo/config.yaml:ro
|
||||
- tempodata:/var/tempo
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: "0.5"
|
||||
memory: 512M
|
||||
|
||||
grafana:
|
||||
image: grafana/grafana:13.3.1
|
||||
restart: unless-stopped
|
||||
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_HOST_PORT:-13000}:3000"
|
||||
volumes:
|
||||
- ./infra/otel/grafana/provisioning:/etc/grafana/provisioning:ro
|
||||
- ./infra/otel/grafana/dashboards:/var/lib/grafana/dashboards:ro
|
||||
- grafanadata:/var/lib/grafana
|
||||
healthcheck:
|
||||
# Loki/Tempo/Collector не содержат shell/HTTP-клиент: проверяем их из Grafana.
|
||||
test:
|
||||
- CMD-SHELL
|
||||
- wget -q -T 2 -O /dev/null http://127.0.0.1:3000/api/health && wget -q -T 2 -O /dev/null http://loki:3100/ready && wget -q -T 2 -O /dev/null http://tempo:3200/ready && wget -q -T 2 -O /dev/null http://otel-collector:13133/
|
||||
interval: 5s
|
||||
timeout: 10s
|
||||
retries: 36
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: "0.5"
|
||||
memory: 512M
|
||||
|
||||
volumes:
|
||||
pgdata:
|
||||
redisdata:
|
||||
miniodata:
|
||||
rabbitmqdata:
|
||||
prometheusdata:
|
||||
lokidata:
|
||||
tempodata:
|
||||
grafanadata:
|
||||
|
||||
networks:
|
||||
default:
|
||||
@@ -400,6 +496,8 @@ networks:
|
||||
internal: true
|
||||
|
||||
secrets:
|
||||
grafana_admin_password:
|
||||
file: ./secrets/grafana_admin_password
|
||||
broker_password:
|
||||
file: ./secrets/broker_password
|
||||
db_password:
|
||||
|
||||
Reference in New Issue
Block a user