-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathcompose.yaml
126 lines (116 loc) · 4.64 KB
/
compose.yaml
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
# ============================================================================ #
# Grafana OnCall
# ============================================================================ #
# Usage:
# COMPOSE_EXPERIMENTAL_GIT_REMOTE=true docker compose up -d --remove-orphans
# COMPOSE_EXPERIMENTAL_GIT_REMOTE=true docker compose down
# Note:
# include is available in Docker Compose version 2.20 and later, and Docker Desktop version 4.22 and later.
# docs: https://docs.docker.com/compose/multiple-compose-files/include/#include-and-overrides
include:
# # use git remote
# - path: https://github.com/qclaogui/codelab-monitoring.git#main:docker-compose/monolithic-mode/all-in-one/compose.yaml # All in one(Logs Traces Metrics Profiles)
# - path: https://github.com/qclaogui/codelab-monitoring.git#main:docker-compose/monolithic-mode/metrics/compose.yaml # Metrics
# - path: https://github.com/qclaogui/codelab-monitoring.git#main:docker-compose/monolithic-mode/logs/compose.yaml # Metrics and Logs
# - path: https://github.com/qclaogui/codelab-monitoring.git#main:docker-compose/monolithic-mode/traces/compose.yaml # Metrics and Traces
# - path: https://github.com/qclaogui/codelab-monitoring.git#main:docker-compose/monolithic-mode/profiles/compose.yaml # Metrics and Profiles
# use local path
- path: ../../docker-compose/monolithic-mode/logs/compose.yaml
x-environment: &oncall-environment
SEND_ANONYMOUS_USAGE_STATS: ${SEND_ANONYMOUS_USAGE_STATS:-false}
DATABASE_TYPE: sqlite3
BROKER_TYPE: redis
BASE_URL: ${BASE_URL:-http://engine:8080}
SECRET_KEY: ${SECRET_KEY:-r4KriYc9sL6PJLaGdDRQL3PKqT6bufTx2uhj}
FEATURE_PROMETHEUS_EXPORTER_ENABLED: ${FEATURE_PROMETHEUS_EXPORTER_ENABLED:-true}
REDIS_URI: redis://redis:6379/0
DJANGO_SETTINGS_MODULE: settings.hobby
CELERY_WORKER_QUEUE: "default,critical,long,slack,telegram,webhook,retry,celery,grafana"
CELERY_WORKER_CONCURRENCY: "1"
CELERY_WORKER_MAX_TASKS_PER_CHILD: "100"
CELERY_WORKER_SHUTDOWN_INTERVAL: "65m"
CELERY_WORKER_BEAT_ENABLED: "True"
GRAFANA_API_URL: ${GRAFANA_API_URL:-http://grafana:3000}
EMAIL_HOST: inbucket
EMAIL_PORT: 2500
EMAIL_FROM_ADDRESS: [email protected]
EMAIL_USE_TLS: false
FEATURE_TELEGRAM_INTEGRATION_ENABLED: ${FEATURE_TELEGRAM_INTEGRATION_ENABLED:-false}
FEATURE_SLACK_INTEGRATION_ENABLED: ${FEATURE_SLACK_INTEGRATION_ENABLED:-false}
SLACK_CLIENT_OAUTH_ID: ${SLACK_CLIENT_OAUTH_ID:-}
SLACK_CLIENT_OAUTH_SECRET: ${SLACK_CLIENT_OAUTH_SECRET:-}
SLACK_INSTALL_RETURN_REDIRECT_HOST: ${SLACK_INSTALL_RETURN_REDIRECT_HOST:-}
SLACK_SIGNING_SECRET: ${SLACK_SIGNING_SECRET:-}
GRAFANA_CLOUD_NOTIFICATIONS_ENABLED: ${GRAFANA_CLOUD_NOTIFICATIONS_ENABLED:-false}
GRAFANA_CLOUD_ONCALL_HEARTBEAT_ENABLED: ${GRAFANA_CLOUD_ONCALL_HEARTBEAT_ENABLED:-false}
GRAFANA_CLOUD_ONCALL_TOKEN: ${GRAFANA_CLOUD_ONCALL_TOKEN:-}
services:
engine:
# https://github.com/qclaogui/codelab-monitoring/blob/main/alloy-modules/compose/README.md
labels:
metrics.grafana.com/scrape: true
# metrics are exposed on path /metrics/ and not on /metrics
# Related Issues-3597: https://github.com/grafana/oncall/issues/3597
metrics.grafana.com/path: "/metrics/"
depends_on:
oncall_db_migration:
condition: service_completed_successfully
redis:
condition: service_healthy
image: &oncallImage grafana/oncall:v1.11.0
restart: always
ports:
# - "8080"
- "8080:8080"
command: sh -c "uwsgi --ini uwsgi.ini"
environment:
<<: *oncall-environment
volumes:
- oncall_data:/var/lib/oncall
celery:
labels:
metrics.grafana.com/scrape: false
depends_on:
oncall_db_migration:
condition: service_completed_successfully
redis:
condition: service_healthy
image: *oncallImage
restart: always
command: sh -c "./celery_with_exporter.sh"
environment:
<<: *oncall-environment
volumes:
- oncall_data:/var/lib/oncall
oncall_db_migration:
labels:
metrics.grafana.com/scrape: false
depends_on:
redis:
condition: service_healthy
image: *oncallImage
command: python manage.py migrate --noinput
environment:
<<: *oncall-environment
volumes:
- oncall_data:/var/lib/oncall
redis:
labels:
metrics.grafana.com/scrape: false
image: redis:7.0.5
restart: always
volumes:
- redis_data:/data
deploy:
resources:
limits:
memory: 100m
cpus: "0.1"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
timeout: 5s
interval: 5s
retries: 10
volumes:
oncall_data:
redis_data: