-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
105 lines (99 loc) · 3.25 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
version: '3'
services:
# storage:
# image: ghcr.io/openzipkin/zipkin-mysql:${TAG:-latest}
# container_name: mysql
# # Uncomment to expose the storage port for testing
# # ports:
# # - 3306:3306
# Use MySQL instead of in-memory storage
zipkin:
image: ghcr.io/openzipkin/zipkin-slim:${TAG:-latest}
container_name: zipkin
ports:
- "9411:9411"
environment:
- STORAGE_TYPE=mem
- MYSQL_HOST=mysql
# Add the baked-in username and password for the zipkin-mysql image
- MYSQL_USER=zipkin
- MYSQL_PASS=zipkin
# depends_on:
# - storage
prometheus:
image: prom/prometheus:latest
container_name: prometheus
hostname: prometheus
command:
- --config.file=/etc/prometheus.yaml
- --web.enable-remote-write-receiver
- --enable-feature=exemplar-storage
volumes:
- ./prometheus.yaml:/etc/prometheus.yaml
ports:
- "9090:9090"
healthcheck:
interval: 5s
retries: 10
test: wget --no-verbose --tries=1 --spider http://localhost:9090/status || exit 1
otel-collector:
container_name: otel-collector
image: otel/opentelemetry-collector
command: [ "--config=/etc/otel-collector-config.yaml" ]
depends_on:
- zipkin
- prometheus
volumes:
- ./otel-collector-logging-config.yaml:/etc/otel-collector-config.yaml
ports:
- "1888: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
greeting-service:
container_name: greeting-service
image: com.example/greeting-service:v1.0.0
depends_on:
- otel-collector
environment:
OTEL_TRACES_EXPORTER: otlp
OTEL_METRICS_EXPORTER: otlp
OTEL_EXPORTER_OTLP_ENDPOINT: http://otel-collector:4317
# OTEL_TRACES_EXPORTER: zipkin
# OTEL_EXPORTER_ZIPKIN_ENDPOINT: http://zipkin:9411/api/v2/spans
# OTEL_METRICS_EXPORTER: prometheus
# OTEL_EXPORTER_PROMETHEUS_PORT: 8088
OTEL_RESOURCE_ATTRIBUTES: service.name=greeting-service,service-version=1.0
build:
context: ./greeting-service
ports:
- "9092:9092"
- "8088:8088"
- "8082:8082"
hello-service:
container_name: hello-service
image: com.example/hello-service:v1.0.0
depends_on:
- otel-collector
environment:
OTEL_TRACES_EXPORTER: otlp
OTEL_METRICS_EXPORTER: otlp
OTEL_EXPORTER_OTLP_ENDPOINT: http://otel-collector:4317
# OTEL_TRACES_EXPORTER: zipkin
# OTEL_EXPORTER_ZIPKIN_ENDPOINT: http://zipkin:9411/api/v2/spans
# OTEL_METRICS_EXPORTER: prometheus
# OTEL_EXPORTER_PROMETHEUS_PORT: 8089
OTEL_RESOURCE_ATTRIBUTES: service.name=hello-service,service-version=1.0
SPRING_APPLICATION_JSON: '{
"grpc.client.greeting-service.address":"static://greeting-service:9090",
"greeting.service.rest.endpoint":"http://greeting-service:8082"
}'
build:
context: ./hello-service
ports:
- "9091:9091"
- "8080:8080"
- "8089:8089"