-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy pathinfrastructure.yaml
More file actions
159 lines (141 loc) · 5.32 KB
/
infrastructure.yaml
File metadata and controls
159 lines (141 loc) · 5.32 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
152
153
154
155
156
157
158
version: "3.3"
services:
#######################################################
# Rabbitmq
#######################################################
rabbitmq:
image: rabbitmq:management
container_name: rabbitmq
restart: unless-stopped
ports:
- 5672:5672
- 15672:15672
networks:
- infrastructure
#######################################################
# Postgress
#######################################################
postgres:
container_name: postgres
image: postgres:latest
restart: unless-stopped
ports:
- '5432:5432'
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
volumes:
- postgres-data:/var/lib/postgresql/data
networks:
- infrastructure
#######################################################
# Prometheus
#######################################################
prometheus:
image: prom/prometheus:latest
restart: unless-stopped
ports:
# just expose container port not host port - https://docs.docker.com/reference/compose-file/services/#expose
- 9090:9090 # http and ui port
volumes:
- ./../configs/prometheus.yaml:/etc/prometheus/prometheus.yml
# to passe one flag, such as "--log.level=debug" or "--web.enable-remote-write-receiver", we need to override the whole command, as we can't just pass one extra argument
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
- "--web.console.libraries=/usr/share/prometheus/console_libraries"
- "--web.console.templates=/usr/share/prometheus/consoles"
# need this for the OpenTelemetry collector to be able to put metrics into Prometheus
- "--web.enable-remote-write-receiver"
- "--log.level=debug"
networks:
- infrastructure
#######################################################
# Tempo
#######################################################
tempo:
image: grafana/tempo:latest
container_name: tempo
restart: unless-stopped
command: ["-config.file=/etc/tempo.yaml"]
volumes:
- ./../configs/tempo.yaml:/etc/tempo.yaml
expose:
# just expose container port not host port - https://docs.docker.com/reference/compose-file/services/#expose
- 3200 # HTTP port, doesn't have direct ui port and should visualize in grafana (container port)
- 9095 # gRPC port (container port)
- 4317 # otlp grpc (container port)
- 4318 # otlp http (container port)
networks:
- infrastructure
#######################################################
# Loki
#######################################################
loki:
image: grafana/loki:latest
hostname: loki
container_name: loki
expose:
# just expose container port not host port - https://docs.docker.com/reference/compose-file/services/#expose
- 3100 # HTTP port, doesn't have direct ui port and should visualize in grafana (container port)
- 9096 # gRPC port (container port)
command: -config.file=/etc/loki/local-config.yaml
volumes:
- ./../configs/loki-config.yaml:/etc/loki/local-config.yaml
networks:
- infrastructure
#######################################################
# Grafana
#######################################################
grafana:
image: grafana/grafana:latest
container_name: grafana
restart: unless-stopped
environment:
- GF_INSTALL_PLUGINS=grafana-clock-panel,grafana-simple-json-datasource
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_FEATURE_TOGGLES_ENABLE=traceqlEditor
depends_on:
- prometheus
ports:
- "3000:3000"
volumes:
- ./../configs/grafana/provisioning:/etc/grafana/provisioning
- ./../configs/grafana/dashboards:/var/lib/grafana/dashboards
## https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/
# - ./../configs/grafana/grafana.ini:/etc/grafana/grafana.ini
networks:
- infrastructure
#######################################################
# OtelCollector
#######################################################
otel-collector:
image: otel/opentelemetry-collector-contrib:latest
container_name: otel-collector
restart: unless-stopped
command: ["--config=/etc/otelcol-contrib/config.yaml"]
volumes:
- ./../configs/otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml
ports:
- "11888:1888" # pprof extension
- "8888:8888" # Prometheus metrics exposed by the Collector
- "8889:8889" # Prometheus exporter metrics
- "13133:13133" # health_check extension
- "4317:4317" # OTLP gRPC receiver
- "4318:4318" # OTLP http receiver
- "55679:55679" # zpages extension
environment:
# set enviroments for otel collector configs to set Exporter endpoints (with defaults matching your original config)
- ASPIRE_OTLP_ENDPOINT=http://aspire-dashboard:18889 # Using Docker network DNS
- ASPIRE_API_KEY=your_api_key
- PROMETHEUS_ENDPOINT=0.0.0.0:8889
- PROMETHEUS_REMOTE_WRITE_ENDPOINT=http://prometheus:9090/api/v1/write
- LOKI_ENDPOINT=http://loki:3100/otlp
- TEMPO_ENDPOINT=http://tempo:4317
networks:
- infrastructure
networks:
infrastructure:
volumes:
postgres-data: