forked from open-telemetry/opentelemetry-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.observability.yaml
More file actions
211 lines (202 loc) · 5.99 KB
/
Copy pathcompose.observability.yaml
File metadata and controls
211 lines (202 loc) · 5.99 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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
# Observability stack layer: adds Jaeger, Prometheus, OpenSearch, Grafana, and
# an OpAMP server, and patches the otel-collector to export to or report to them.
#
# Usage:
# docker compose -f compose.yaml -f compose.observability.yaml up
# docker compose -f compose.yaml -f compose.full.yaml -f compose.observability.yaml up
services:
# Jaeger
jaeger:
image: ${JAEGERTRACING_IMAGE}
container_name: jaeger
command:
- "--config=file:/etc/jaeger/config.yml"
deploy:
resources:
limits:
memory: 1200M
restart: unless-stopped
ports:
- "${JAEGER_UI_PORT}"
- "${JAEGER_GRPC_PORT}"
environment:
- JAEGER_HOST
- JAEGER_GRPC_PORT
- PROMETHEUS_ADDR
- OTEL_COLLECTOR_HOST
- OTEL_COLLECTOR_PORT_HTTP
- MEMORY_MAX_TRACES=25000
volumes:
- ./src/jaeger/config.yml:/etc/jaeger/config.yml
- ./src/jaeger/ui-config.json:/etc/jaeger/ui-config.json
logging:
driver: "json-file"
options:
max-size: "5m"
max-file: "2"
# Grafana
grafana:
image: ${GRAFANA_IMAGE}
container_name: grafana
deploy:
resources:
limits:
memory: 175M
restart: unless-stopped
environment:
- "GF_INSTALL_PLUGINS=grafana-opensearch-datasource"
volumes:
- ./src/grafana/grafana.ini:/etc/grafana/grafana.ini
- ./src/grafana/provisioning/:/etc/grafana/provisioning/
ports:
- "${GRAFANA_PORT}"
logging:
driver: "json-file"
options:
max-size: "5m"
max-file: "2"
# Prometheus
prometheus:
image: ${PROMETHEUS_IMAGE}
container_name: prometheus
command:
- --web.console.templates=/etc/prometheus/consoles
- --web.console.libraries=/etc/prometheus/console_libraries
- --storage.tsdb.retention.time=7d
- --config.file=/etc/prometheus/prometheus-config.yaml
- --storage.tsdb.path=/prometheus
- --web.enable-lifecycle
- --web.route-prefix=/
- --web.enable-otlp-receiver
- --enable-feature=exemplar-storage
volumes:
- ./src/prometheus/prometheus-config.yaml:/etc/prometheus/prometheus-config.yaml
deploy:
resources:
limits:
memory: 200M
restart: unless-stopped
ports:
- "${PROMETHEUS_PORT}:${PROMETHEUS_PORT}"
logging:
driver: "json-file"
options:
max-size: "5m"
max-file: "2"
# OpenSearch
opensearch:
image: ${IMAGE_NAME}:${DEMO_VERSION}-opensearch
container_name: opensearch
build:
context: ./
dockerfile: ${OPENSEARCH_DOCKERFILE}
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-opensearch
deploy:
resources:
limits:
memory: 1G
restart: unless-stopped
environment:
- cluster.name=demo-cluster
- node.name=demo-node
- bootstrap.memory_lock=true
- discovery.type=single-node
- OPENSEARCH_JAVA_OPTS=-Xms400m -Xmx400m
- DISABLE_INSTALL_DEMO_CONFIG=true
- DISABLE_SECURITY_PLUGIN=true
# Workaround on OSX for https://bugs.openjdk.org/browse/JDK-8345296
- _JAVA_OPTIONS
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
ports:
- "9200"
healthcheck:
test: curl -s http://localhost:9200/_cluster/health | grep -E '"status":"(green|yellow)"'
start_period: 10s
interval: 5s
timeout: 10s
retries: 10
logging:
driver: "json-file"
options:
max-size: "5m"
max-file: "2"
# OpAMP Server
# The collector connects to this control plane and reports status through the
# opampextension.
opamp-server:
image: ${IMAGE_NAME}:${DEMO_VERSION}-opamp-server
container_name: opamp-server
build:
context: ./
dockerfile: ${OPAMP_SERVER_DOCKERFILE}
args:
OPAMP_GO_REF: ${OPAMP_GO_REF}
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-opamp-server
deploy:
resources:
limits:
memory: 65M
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:4321/"]
start_period: 10s
interval: 5s
timeout: 5s
retries: 10
logging:
driver: "json-file"
options:
max-size: "5m"
max-file: "2"
# Patch frontend-proxy to wait for observability UIs
frontend-proxy:
depends_on:
jaeger:
condition: service_started
grafana:
condition: service_started
opamp-server:
condition: service_healthy
# Patch otel-collector to add observability exporters and wait for backends.
# Note: otelcol-config-full.yml is included here to maintain correct config ordering
# (core → full → observability → extras). When running minimal+observability without
# compose.full.yaml, the Kafka/PostgreSQL receivers in the full config are harmless —
# they will simply fail to scrape since those services are not running.
otel-collector:
command:
- "--config=/etc/otelcol-config.yml"
- "--config=/etc/otelcol-config-full.yml"
- "--config=/etc/otelcol-config-observability.yml"
- "--config=/etc/otelcol-config-extras.yml"
- "--feature-gates=service.profilesSupport"
volumes:
- ${OTEL_COLLECTOR_CONFIG}:/etc/otelcol-config.yml
- ${OTEL_COLLECTOR_CONFIG_FULL}:/etc/otelcol-config-full.yml
- ${OTEL_COLLECTOR_CONFIG_OBSERVABILITY}:/etc/otelcol-config-observability.yml
- ${OTEL_COLLECTOR_CONFIG_EXTRAS}:/etc/otelcol-config-extras.yml
environment:
- KAFKA_ADDR
depends_on:
jaeger:
condition: service_started
opensearch:
condition: service_healthy
opamp-server:
condition: service_healthy
cart:
environment:
- OPAMP_SERVER_ENDPOINT=wss://${OPAMP_SERVER_HOST}:4320/v1/opamp
- OPAMP_SERVER_TLS_INSECURE_SKIP_VERIFY=true
depends_on:
opamp-server:
condition: service_healthy