-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.demo.yml
More file actions
48 lines (45 loc) · 1.68 KB
/
Copy pathcompose.demo.yml
File metadata and controls
48 lines (45 loc) · 1.68 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
# Demo overlay: a tiny auto-instrumented FastAPI service plus a load
# generator, so the stack has real traces, metrics, and correlated logs
# to show. Not for production — no restart-across-reboots on purpose.
#
# just demo # core stack + this overlay
# just demo-down # remove just the demo services
x-demo-logging: &demo-logging
driver: json-file
options:
max-size: "10m"
max-file: "3"
services:
demo-api:
build: ./demo
restart: on-failure
depends_on: [ otel-collector ]
environment:
OTEL_SERVICE_NAME: demo-api
OTEL_RESOURCE_ATTRIBUTES: env=demo
OTEL_EXPORTER_OTLP_ENDPOINT: http://otel-collector:4318
OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf
OTEL_EXPORTER_OTLP_HEADERS: Authorization=Bearer ${OTLP_AUTH_TOKEN:?set OTLP_AUTH_TOKEN in .env}
# Traces/metrics/logs exporters all default to otlp via opentelemetry-distro.
# Ship Python log records via OTLP with trace context attached.
OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED: "true"
OTEL_METRIC_EXPORT_INTERVAL: "10000"
# Emit the *stable* HTTP semconv (http.server.request.duration in seconds,
# http.route) rather than the legacy names. Stable metric names are frozen,
# so the Service Health dashboard's app-SDK panel survives library bumps.
OTEL_SEMCONV_STABILITY_OPT_IN: http
logging: *demo-logging
demo-load:
image: curlimages/curl:8.21.0
restart: on-failure
depends_on: [ demo-api ]
command:
- sh
- -c
- |
while true; do
curl -s -o /dev/null demo-api:8000/
curl -s -o /dev/null demo-api:8000/work
sleep 1
done
logging: *demo-logging