-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.override.yml.example
More file actions
71 lines (64 loc) · 2.64 KB
/
Copy pathdocker-compose.override.yml.example
File metadata and controls
71 lines (64 loc) · 2.64 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
# Observability overlay for RADIS.
#
# Tags every signal sent to OpenObserve with:
# service.name = the stack name (e.g. radis_prod, radis_staging)
# from OTEL_SERVICE_NAME=${STACK_NAME}
# service.component = the compose service that emitted it
# from SERVICE_COMPONENT, read by adit_radis_shared/telemetry.py
# service.namespace = openradx
# deployment.environment = production by default; change per stack (see below)
#
# PER-STACK SETUP:
# 1. cp docker-compose.override.yml.example docker-compose.override.yml
# 2. If this is a staging or development deployment, edit the
# `deployment.environment=production` value inside `OTEL_RESOURCE_ATTRIBUTES`
# below to `staging` or `development`:
# sed -i 's/deployment.environment=production/deployment.environment=staging/' \
# docker-compose.override.yml
#
# STACK_NAME is dynamically resolved by adit-radis-shared's CommandHelper and
# injected into the compose subprocess env by cli compose-up / compose-build /
# stack-deploy. No new .env entry required.
x-observability-net: &observability-net
networks:
- default
- openradx-observability
x-observability-env: &observability-env
OTEL_EXPORTER_OTLP_ENDPOINT: ${OTEL_EXPORTER_OTLP_ENDPOINT:-}
OTEL_PYTHON_DJANGO_EXCLUDED_URLS: "health/,static/.*"
OTEL_SERVICE_NAME: ${STACK_NAME}
OTEL_RESOURCE_ATTRIBUTES: "service.namespace=openradx,deployment.environment=production"
# Swarm interpolates {{.Task.Slot}} to the replica ordinal (1, 2, 3…); plain
# `docker compose up` passes the literal through, which telemetry.py drops.
TASK_SLOT: "{{.Task.Slot}}"
# Cap OTLP HTTP exporter retry deadline at 2 seconds. The default is 10s
# with exponential backoff, which previously exceeded Docker's 10s
# stop-grace-period during redeploys: when otel-collector was shut down
# before the apps, the OTel batch processors blocked on flush() trying
# to reach an unreachable collector, causing apps to be SIGKILLed
# (exit 137) instead of shutting down cleanly.
OTEL_EXPORTER_OTLP_TIMEOUT: ${OTEL_EXPORTER_OTLP_TIMEOUT:-2}
networks:
openradx-observability:
external: true
services:
init:
<<: *observability-net
environment:
<<: *observability-env
SERVICE_COMPONENT: init
web:
<<: *observability-net
environment:
<<: *observability-env
SERVICE_COMPONENT: web
default_worker:
<<: *observability-net
environment:
<<: *observability-env
SERVICE_COMPONENT: default_worker
llm_worker:
<<: *observability-net
environment:
<<: *observability-env
SERVICE_COMPONENT: llm_worker