forked from jaruizes/observability-otel-grafana
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
174 lines (174 loc) · 5.2 KB
/
docker-compose.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
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
services:
service-a:
image: node/service-a:base-inst
container_name: service-a
depends_on:
service-b:
condition: service_healthy
environment:
OPENTELEMETRY_TRACER_EXPORTER_OTLP_ENDPOINT: "http://otel-collector:4317"
SERVICEB_URL: "http://service-b:8081"
KAFKA_BOOTSTRAP_SERVERS: "kafka:9092"
ports:
- "8080:8080"
logging:
driver: fluentd
options:
fluentd-async-connect: "true"
fluentd-address: "localhost:24224"
service-b:
image: spring/service-b:base-inst
container_name: service-b
depends_on:
kafka:
condition: service_healthy
environment:
JAVA_TOOL_OPTIONS: "-javaagent:/app/lib/opentelemetry-javaagent-1.22.1.jar"
OTEL_SERVICE_NAME: "service-b(Spring)"
OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-collector:4317"
OTEL_METRICS_EXPORTER: "none"
SPRING_KAFKA_PRODUCER_BOOTSTRAP-SERVERS: "kafka:9092"
ports:
- "8081:8081"
healthcheck:
test: [ "CMD", "curl", "-f", "http://service-b:8081/actuator/health" ]
start_period: 60s
interval: 10s
timeout: 10s
retries: 12
logging:
driver: fluentd
options:
fluentd-async-connect: "true"
fluentd-address: "localhost:24224"
service-c:
image: quarkus/service-c:base-inst
container_name: service-c
depends_on:
service-b:
condition: service_healthy
environment:
QUARKUS_OPENTELEMETRY_TRACER_EXPORTER_OTLP_ENDPOINT: "http://otel-collector:4317"
ports:
- "8082:8082"
logging:
driver: fluentd
options:
fluentd-async-connect: "true"
fluentd-address: "localhost:24224"
service-d:
image: quarkus/service-d:base-inst
container_name: service-d
depends_on:
service-b:
condition: service_healthy
environment:
QUARKUS_DATASOURCE_JDBC_URL: "jdbc:postgresql://database:5432/a_service"
QUARKUS_OPENTELEMETRY_TRACER_EXPORTER_OTLP_ENDPOINT: "http://otel-collector:4317"
ports:
- "8083:8083"
logging:
driver: fluentd
options:
fluentd-async-connect: "true"
fluentd-address: "localhost:24224"
zookeeper:
image: quay.io/strimzi/kafka:0.33.0-kafka-3.3.2
container_name: zookeeper
command: [
"sh", "-c",
"bin/zookeeper-server-start.sh config/zookeeper.properties"
]
ports:
- "2181:2181"
environment:
ZOOKEEPER_CLIENT_PORT: 2181
LOG_DIR: /tmp/logs
kafka:
image: quay.io/strimzi/kafka:0.33.0-kafka-3.3.2
container_name: kafka
command: [
"sh", "-c",
"bin/kafka-server-start.sh config/server.properties --override listeners=$${KAFKA_LISTENERS} --override advertised.listeners=$${KAFKA_ADVERTISED_LISTENERS} --override zookeeper.connect=$${KAFKA_ZOOKEEPER_CONNECT}"
]
depends_on:
- zookeeper
ports:
- "9092:9092"
environment:
LOG_DIR: "/tmp/logs"
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092
KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_CREATE_TOPICS: "topic-b:1:1, topic-d:1:1"
healthcheck:
test: nc -z localhost 9092 || exit -1
start_period: 30s
interval: 5s
timeout: 10s
retries: 10
otel-collector:
image: otel/opentelemetry-collector:latest
container_name: otel-collector
command: [ "--config=/etc/otel-collector-config.yaml" ]
volumes:
- ./resources/otel-collector/otel-collector-config.yaml:/etc/otel-collector-config.yaml:Z
ports:
- "13133:13133"
- "4317:4317"
- "4318:4318"
# jaeger:
# image: jaegertracing/all-in-one:latest
# ports:
# - "16686:16686"
# - "14268:14268"
# - "14250:14250"
grafana:
image: grafana/grafana:9.1.2
container_name: grafana
depends_on:
- loki
ports:
- "3000:3000"
environment:
- GF_SECURITY_ADMIN_USER=user
- GF_SECURITY_ADMIN_PASSWORD=password
volumes:
- ./resources/grafana/datasource.yml:/etc/grafana/provisioning/datasources/datasource.yml
- ./resources/grafana/dashboards:/etc/grafana/provisioning/dashboards
- ./resources/grafana/grafana.ini:/etc/grafana/grafana.ini
loki:
image: grafana/loki:2.6.1
container_name: loki
depends_on:
- fluent-bit
ports:
- "3100:3100"
volumes:
- ./resources/loki/local-config.yml:/etc/loki/local-config.yaml
fluent-bit:
image: grafana/fluent-bit-plugin-loki:2.6.1-amd64
container_name: fluent-bit
ports:
- "24224:24224"
environment:
- LOKI_URL=http://loki:3100/loki/api/v1/push
volumes:
- ./resources/fluent-bit/fluent-bit.conf:/fluent-bit/etc/fluent-bit.conf
tempo:
image: grafana/tempo:1.5.0
container_name: tempo
command: -config.file /etc/tempo-config.yml
ports:
- "3110:3100" # Tempo
- "44317:4317" # OTel
volumes:
- ./resources/tempo/tempo.yml:/etc/tempo-config.yml
prometheus:
image: prom/prometheus:v2.38.0
container_name: prometheus
command: --web.enable-remote-write-receiver --config.file=/etc/prometheus/prometheus.yml
ports:
- "9090:9090"
volumes:
- ./resources/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml