-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose-observability.yml
108 lines (101 loc) · 3.3 KB
/
docker-compose-observability.yml
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
---
# Copyright 2022 Digital Asset (Switzerland) GmbH and/or its affiliates
#
# SPDX-License-Identifier: Apache-2.0
#
volumes:
grafana:
name: daml_observability_grafana
logs:
name: daml_observability_logs
loki:
name: daml_observability_loki
prometheus:
name: daml_observability_prometheus
services:
prometheus:
# Prometheus LTS version
# https://prometheus.io/docs/introduction/release-cycle/
image: prom/prometheus:v2.45.1
container_name: daml_observability_prometheus
command:
# Prometheus configuration
- --config.file=/etc/prometheus/prometheus.yml
# Prometheus data location
- --storage.tsdb.path=/prometheus
# Enable reload HTTP endpoint
- --web.enable-lifecycle
# Avoid local disk exhaustion
- --storage.tsdb.retention.size=10GB
- --storage.tsdb.retention.time=1d
volumes:
# Prometheus configuration
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
# Prometheus persistent data
- prometheus:/prometheus
ports:
- 9090:9090
grafana:
# Grafana version
# https://github.com/grafana/grafana/blob/main/CHANGELOG.md
image: grafana/grafana:9.5.12-ubuntu
container_name: daml_observability_grafana
volumes:
# Grafana configuration
- ./grafana/grafana.ini:/etc/grafana/grafana.ini
# Grafana data sources
- ./grafana/datasources.yml:/etc/grafana/provisioning/datasources/default.yml
# Grafana dashboard sources
- ./grafana/dashboards.yml:/etc/grafana/provisioning/dashboards/default.yml
# Grafana dashboards (auto-loading)
- ./grafana/dashboards:/var/lib/grafana/dashboards
# Grafana persistent data
- grafana:/var/lib/grafana
ports:
- 3000:3000
depends_on:
- prometheus
- loki
- exporter
exporter:
# Prometheus Node Exporter
# https://github.com/prometheus/node_exporter/
image: prom/node-exporter:v1.4.1
container_name: daml_observability_node_exporter
postgres-exporter:
# PostgreSQL Server Exporter
# https://github.com/prometheus-community/postgres_exporter/blob/master/CHANGELOG.md
image: quay.io/prometheuscommunity/postgres-exporter:v0.14.0
container_name: daml_observability_postgres_exporter
environment:
DATA_SOURCE_USER: "postgres"
DATA_SOURCE_PASS: "postgres"
DATA_SOURCE_URI: "postgres:5432/postgres?sslmode=disable"
PG_EXPORTER_AUTO_DISCOVER_DATABASES: true
volumes:
# PostgreSQL Server Exporter configuration
- ./postgres/postgres_exporter.yml:/postgres_exporter.yml
loki:
# Loki version
# https://github.com/grafana/loki/blob/main/CHANGELOG.md
image: grafana/loki:2.7.7
container_name: daml_observability_loki
command: -config.file=/etc/loki/loki.yaml
volumes:
# Loki configuration
- ./loki/loki.yaml:/etc/loki/loki.yaml
# Loki persistent data
- loki:/loki
depends_on:
- promtail
promtail:
# Loki version
# https://github.com/grafana/loki/blob/main/CHANGELOG.md
image: grafana/promtail:2.7.7
container_name: daml_observability_promtail
command: -config.file=/etc/promtail/promtail.yml
volumes:
# Loki configuration
- ./loki/promtail.yaml:/etc/promtail/promtail.yml
# Logs to scrape
- logs:/var/log/promtail