Repository navigation
Expand file tree
/
Copy pathdocker-compose.observability.yml
More file actions
151 lines (139 loc) · 4.21 KB
/
Copy pathdocker-compose.observability.yml
File metadata and controls
151 lines (139 loc) · 4.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# EfficientAI optional observability stack.
#
# Usage:
# docker compose -f docker-compose.yml -f docker-compose.observability.yml up -d
#
# Also set observability.enabled: true in config.docker.yml to expose app metrics
# and enable in-app Loki/org logging.
services:
db:
depends_on:
- loki
logging:
driver: loki
options:
loki-url: "http://localhost:3100/loki/api/v1/push"
loki-retries: "5"
loki-max-backoff: "800ms"
loki-external-labels: "service=postgres,environment=docker"
redis:
depends_on:
- loki
logging:
driver: loki
options:
loki-url: "http://localhost:3100/loki/api/v1/push"
loki-retries: "5"
loki-max-backoff: "800ms"
loki-external-labels: "service=redis,environment=docker"
api:
depends_on:
- loki
logging:
driver: loki
options:
loki-url: "http://localhost:3100/loki/api/v1/push"
loki-retries: "5"
loki-max-backoff: "800ms"
loki-external-labels: "service=api,environment=docker"
worker:
depends_on:
- loki
logging:
driver: loki
options:
loki-url: "http://localhost:3100/loki/api/v1/push"
loki-retries: "5"
loki-max-backoff: "800ms"
loki-external-labels: "service=worker,environment=docker"
worker-imports:
depends_on:
- loki
logging:
driver: loki
options:
loki-url: "http://localhost:3100/loki/api/v1/push"
loki-retries: "5"
loki-max-backoff: "800ms"
loki-external-labels: "service=worker-imports,environment=docker"
loki:
image: grafana/loki:latest
container_name: efficientai_loki
environment:
# Set LOKI_CONFIG_FILE to switch between filesystem and S3 backends:
# filesystem (default): loki-config.yml
# S3: loki-config.s3.yml
LOKI_AUTH_ENABLED: ${LOKI_AUTH_ENABLED:-false}
LOKI_S3_BUCKET_NAME: ${LOKI_S3_BUCKET_NAME:-}
LOKI_S3_REGION: ${LOKI_S3_REGION:-us-east-1}
LOKI_S3_ACCESS_KEY_ID: ${LOKI_S3_ACCESS_KEY_ID:-}
LOKI_S3_SECRET_ACCESS_KEY: ${LOKI_S3_SECRET_ACCESS_KEY:-}
LOKI_S3_PREFIX: ${LOKI_S3_PREFIX:-logs/}
volumes:
- ./observability/loki:/etc/loki:ro
- loki_data:/loki
ports:
- "3100:3100"
command: -config.file=/etc/loki/${LOKI_CONFIG_FILE:-loki-config.yml} -config.expand-env=true
prometheus:
image: prom/prometheus:latest
container_name: efficientai_prometheus
volumes:
- ./observability/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus_data:/prometheus
ports:
- "9090:9090"
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.retention.time=15d"
depends_on:
- api
grafana:
image: grafana/grafana:latest
container_name: efficientai_grafana
environment:
GF_SECURITY_ADMIN_USER: ${GRAFANA_ADMIN_USER:-admin}
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_ADMIN_PASSWORD:-admin}
volumes:
- grafana_data:/var/lib/grafana
- ./observability/grafana/provisioning:/etc/grafana/provisioning:ro
- ./observability/grafana/dashboards:/var/lib/grafana/dashboards:ro
ports:
- "3000:3000"
depends_on:
- prometheus
- loki
postgres-exporter:
image: prometheuscommunity/postgres-exporter:latest
container_name: efficientai_postgres_exporter
environment:
DATA_SOURCE_NAME: "postgresql://${POSTGRES_USER:-efficientai}:${POSTGRES_PASSWORD:-password}@db:5432/${POSTGRES_DB:-efficientai}?sslmode=disable"
ports:
- "9187:9187"
depends_on:
db:
condition: service_healthy
redis-exporter:
image: oliver006/redis_exporter:latest
container_name: efficientai_redis_exporter
environment:
REDIS_ADDR: "redis://redis:6379"
ports:
- "9121:9121"
depends_on:
redis:
condition: service_healthy
celery-exporter:
image: danihodovic/celery-exporter:latest
container_name: efficientai_celery_exporter
environment:
CE_BROKER_URL: "redis://redis:6379/0"
ports:
- "9808:9808"
depends_on:
redis:
condition: service_healthy
volumes:
prometheus_data:
grafana_data:
loki_data: