Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
aos
GitHub Repository: aos/grafana-agent
Path: blob/main/example/docker-compose/docker-compose.yaml
4095 views
1
version: "3"
2
services:
3
#
4
# Core services. These services allow a Grafana Agent to send data somewhere
5
# and visualize it in Grafana.
6
#
7
# Backends: grafana, loki, cortex, tempo
8
# Example services: avalanche
9
#
10
11
grafana:
12
image: grafana/grafana:9.2.3
13
entrypoint:
14
- /usr/share/grafana/bin/grafana-server
15
- --homepath=/usr/share/grafana
16
- --config=/etc/grafana-config/grafana.ini
17
volumes:
18
- ./grafana/config:/etc/grafana-config
19
- ./grafana/datasources:/etc/grafana/provisioning/datasources
20
- ./grafana/dashboards-provisioning:/etc/grafana/provisioning/dashboards
21
- ./grafana/dashboards:/var/lib/grafana/dashboards
22
ports:
23
- "3000:3000"
24
25
loki:
26
image: grafana/loki:2.6.1
27
command: -config.file=/etc/loki/local-config.yaml
28
ports:
29
- "3100:3100"
30
31
cortex:
32
image: cortexproject/cortex:v1.8.1
33
volumes:
34
- ./cortex/config:/etc/cortex-config
35
entrypoint:
36
- /bin/cortex
37
- -config.file=/etc/cortex-config/cortex.yaml
38
ports:
39
- "9009:9009"
40
41
tempo:
42
image: grafana/tempo:1.5.0
43
command:
44
- "-search.enabled=true"
45
- "-storage.trace.backend=local" # tell tempo where to permanently put traces
46
- "-storage.trace.local.path=/tmp/tempo/traces"
47
- "-storage.trace.wal.path=/tmp/tempo/wal" # tell tempo where to store the wal
48
- "-auth.enabled=false" # disables the requirement for the X-Scope-OrgID header
49
- "-server.http-listen-port=3200"
50
ports:
51
- "3200:3200"
52
- "4317:4317"
53
54
avalanche:
55
image: quay.io/freshtracks.io/avalanche:latest
56
command:
57
- --metric-count=3000
58
- --series-interval=3600
59
- --metric-interval=7200
60
ports:
61
- "9001:9001"
62
63
# tracing load generator
64
synthetic-load-generator:
65
profiles: [agent] # Should only be run if the Agent is present
66
image: omnition/synthetic-load-generator:1.0.25
67
volumes:
68
- ./load-generator:/etc/load-generator
69
environment:
70
- TOPOLOGY_FILE=/etc/load-generator/load-generator.json
71
- JAEGER_COLLECTOR_URL=http://agent:14268
72
depends_on:
73
- agent
74
75
#
76
# Optional Grafana Agent which can collect telemetry and send it to
77
# Loki/Cortex/Tempo.
78
#
79
# Enable with the "agent" profile.
80
#
81
82
agent:
83
profiles: [agent]
84
image: grafana/agent:latest
85
volumes:
86
- ./agent/config:/etc/agent-config
87
entrypoint:
88
- /bin/agent
89
- -server.http.address=0.0.0.0:12345
90
- -config.file=/etc/agent-config/agent.yaml
91
- -metrics.wal-directory=/tmp/agent/wal
92
- -enable-features=integrations-next
93
- -config.expand-env
94
- -config.enable-read-api
95
environment:
96
HOSTNAME: agent
97
REMOTE_WRITE_HOST: cortex:9009
98
LOKI_HOST: loki:3100
99
TEMPO_HOST: tempo:4317
100
AVALANCHE_HOST: avalanche:9001
101
MYSQL_HOST: mysql:3306
102
POSTGRES_HOST: postgres:5432
103
REDIS_HOST: redis:6379
104
DNSMASQ_HOST: dnsmasq:53
105
MEMCACHED_HOST: memcached:11211
106
CONSUL_HOST: consul:8500
107
ELASTICSEARCH_HOST: elasticsearch:9200
108
KAFKA_HOST: kafka:9093
109
MONGODB_HOST: mongodb:27017
110
ports:
111
- "12345:12345"
112
depends_on:
113
- cortex
114
- loki
115
- tempo
116
117
#
118
# Integrations. These services act as sample SUOs that you can test
119
# integrations against.
120
#
121
# They are disabled by default. Enable the "integrations" profile to enable
122
# all of them, or pass an integration by name (i.e., mysql) to enable a
123
# specific one.
124
#
125
126
mysql:
127
profiles: [integrations,mysql]
128
image: mysql/mysql-server:5.7
129
environment:
130
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
131
- MYSQL_ROOT_HOST=%
132
ports:
133
- 127.0.0.1:3306:3306
134
135
postgres:
136
profiles: [integrations,postgres]
137
image: postgres:13.0
138
environment:
139
- POSTGRES_USER=postgres
140
- POSTGRES_PASSWORD=password
141
ports:
142
- 5432:5432
143
144
redis:
145
profiles: [integrations,redis]
146
image: redis:6
147
ports:
148
- "6379:6379"
149
150
dnsmasq:
151
profiles: [integrations,dnsmasq]
152
image: andyshinn/dnsmasq:2.81
153
cap_add: [NET_ADMIN]
154
volumes:
155
- /tmp/dnsmasq-leases:/var/lib/misc
156
ports:
157
- "30053:53/udp"
158
159
memcached:
160
profiles: [integrations,memcached]
161
image: memcached
162
ports:
163
- "11211:11211"
164
165
consul:
166
profiles: [integrations,consul]
167
image: consul
168
ports:
169
- "8500:8500"
170
171
elasticsearch:
172
profiles: [integrations,elasticsearch]
173
image: docker.elastic.co/elasticsearch/elasticsearch:7.10.1
174
environment:
175
- node.name=elasticsearch
176
- cluster.name=es-grafana-agent-cluster
177
- discovery.type=single-node
178
volumes:
179
- elasticsearch_data:/usr/share/elasticsearch/data
180
ports:
181
- "9200:9200"
182
183
zookeeper:
184
profiles: [integrations,zookeeper]
185
image: wurstmeister/zookeeper:3.4.6
186
expose:
187
- "2181"
188
restart: always
189
190
kafka:
191
profiles: [integrations,kafka]
192
image: wurstmeister/kafka:2.12-2.3.0
193
depends_on:
194
- zookeeper
195
ports:
196
- "127.0.0.1:9093:9093"
197
expose:
198
- "9092"
199
- "9094"
200
environment:
201
KAFKA_CREATE_TOPICS: "sarama_topic:2:1"
202
KAFKA_ADVERTISED_LISTENERS: INSIDE://kafka:9092,OUTSIDE://127.0.0.1:9093,DOCKER://kafka:9094
203
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT,DOCKER:PLAINTEXT
204
KAFKA_LISTENERS: INSIDE://kafka:9092,OUTSIDE://:9093,DOCKER://kafka:9094
205
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
206
KAFKA_INTER_BROKER_LISTENER_NAME: INSIDE
207
restart: always
208
209
kafka-producer:
210
profiles: [integrations,kafka]
211
image: gaantunes/kafka-client:latest
212
depends_on:
213
- kafka
214
command:
215
--producer --kafka.server kafka:9094
216
restart: always
217
218
kafka-consumer:
219
profiles: [integrations,kafka]
220
image: gaantunes/kafka-client:latest
221
depends_on:
222
- kafka
223
command:
224
--consumer --kafka.server kafka:9094
225
restart: always
226
227
mongodb:
228
profiles: [integrations,mongodb]
229
image: mongo:4.2
230
ports:
231
- "127.0.0.1:27017:27017"
232
233
volumes:
234
elasticsearch_data:
235
driver: local
236
237