-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Expand file tree
/
Copy pathcompose.observability.yaml
More file actions
168 lines (161 loc) · 4.8 KB
/
Copy pathcompose.observability.yaml
File metadata and controls
168 lines (161 loc) · 4.8 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
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
# Observability stack layer: adds Jaeger, Prometheus, OpenSearch, and Grafana,
# and patches the otel-collector to export 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
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"
# Patch frontend-proxy to wait for observability UIs
frontend-proxy:
depends_on:
jaeger:
condition: service_started
grafana:
condition: service_started
# 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