-
Notifications
You must be signed in to change notification settings - Fork 5
/
docker-compose.yml
104 lines (99 loc) · 2.98 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
x-default-logging: &logging
options:
max-size: "5m"
max-file: "2"
networks:
default:
name: otel-lab
driver: bridge
services:
py-otel-client:
container_name: py-otel-client
image: ${IMAGE_NAME}:${IMAGE_VERSION}-py-otel-client
build:
context: ${CONTEXT}
dockerfile: Dockerfile.client
depends_on:
otel-collector:
condition: service_started
py-otel-server:
condition: service_started
environment:
- OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://otel-collector:4317
- OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://otel-collector:4317
- OTEL_RESOURCE_ATTRIBUTES=service.name=py-otel-client,service.version=0.1.0
- DESTINATION_URL=http://py-otel-server:8082/rolldice
stop_grace_period: 1s
py-otel-server:
container_name: py-otel-server
image: ${IMAGE_NAME}:${IMAGE_VERSION}-py-otel-server
build:
context: ${CONTEXT}
dockerfile: Dockerfile.server
depends_on:
otel-collector:
condition: service_started
ports:
- "8082:8082"
environment:
- OTEL_TRACES_EXPORTER=console,otlp
- OTEL_METRICS_EXPORTER=console,otlp
- OTEL_LOGS_EXPORTER=console,otlp
- OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317
- OTEL_RESOURCE_ATTRIBUTES=service.name=py-otel-server,service.version=0.1.0
- OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED=true
- OTEL_PYTHON_LOG_CORRELATION=true
- OTEL_PYTHON_LOG_LEVEL=debug
stop_grace_period: 1s
py-prometheus-app:
container_name: py-prometheus-app
image: ${IMAGE_NAME}:${IMAGE_VERSION}-py-prometheus-app
build:
context: ${CONTEXT}
dockerfile: Dockerfile.app
ports:
- "8080:8080"
stop_grace_period: 1s
# ********************
# Telemetry Components
# ********************
# Jaeger
jaeger:
image: jaegertracing/all-in-one
container_name: jaeger
command:
- "--memory.max-traces"
- "10000"
- "--query.base-path"
- "/jaeger/ui"
deploy:
resources:
limits:
memory: 300M
restart: unless-stopped
ports:
- "16686:16686" # Jaeger UI
- "4317" # OTLP gRPC default port
environment:
- COLLECTOR_OTLP_ENABLED=true
- METRICS_STORAGE_TYPE=prometheus
logging: *logging
# OpenTelemetry Collector
otel-collector:
image: otel/opentelemetry-collector-contrib:0.93.0
container_name: otel-collector
deploy:
resources:
limits:
memory: 125M
restart: unless-stopped
command: [ "--config=/etc/otelcol-config.yml", "--config=/etc/otelcol-config-extras.yml" ]
volumes:
- ./src/otelcollector/otelcol-config.yml:/etc/otelcol-config.yml
- ./src/otelcollector/otelcol-config-extras.yml:/etc/otelcol-config-extras.yml
ports:
- "4317"
- "4318"
depends_on:
- jaeger
logging: *logging