Update Docker Compose configuration to enhance observability with health checks for Jaeger and OpenTelemetry Collector. Modify telemetry settings in the development configuration to enable metrics collection. Adjust endpoint settings for Jaeger in the OpenTelemetry Collector configuration.

This commit is contained in:
windyboy
2025-11-15 14:42:33 +08:00
parent cdb0cea8f7
commit 1378d6e31b
4 changed files with 15 additions and 3 deletions
+4
View File
@@ -119,6 +119,8 @@ tasks:
dev-run: dev-run:
desc: Run receiver locally against dev stack desc: Run receiver locally against dev stack
deps:
- up
env: env:
CAATSM_NATS_URL: nats://localhost:4222 CAATSM_NATS_URL: nats://localhost:4222
CAATSM_NATS_MODE: jetstream CAATSM_NATS_MODE: jetstream
@@ -129,6 +131,8 @@ tasks:
GO_ENV: dev GO_ENV: dev
cmds: cmds:
- | - |
echo "Ensuring observability stack is healthy (Jaeger @ http://localhost:16686)"
docker compose -f docker-compose.dev.yml ps jaeger otel-collector >/dev/null
echo "Running receiver with telemetry (mode=${CAATSM_NATS_MODE:-core})" echo "Running receiver with telemetry (mode=${CAATSM_NATS_MODE:-core})"
CAATSM_NATS_MODE=${CAATSM_NATS_MODE:-core} \ CAATSM_NATS_MODE=${CAATSM_NATS_MODE:-core} \
go run ./cmd/main listen go run ./cmd/main listen
+2 -2
View File
@@ -52,6 +52,6 @@ level = "info"
format = "json" format = "json"
[telemetry] [telemetry]
enabled = false enabled = true
endpoint = "otel-collector:4318" endpoint = "localhost:4318"
insecure = true insecure = true
+1 -1
View File
@@ -10,7 +10,7 @@ exporters:
logging: logging:
loglevel: info loglevel: info
otlp/jaeger: otlp/jaeger:
endpoint: jaeger:14250 endpoint: jaeger:4317
tls: tls:
insecure: true insecure: true
+8
View File
@@ -82,6 +82,8 @@ services:
OTEL_EXPORTER_OTLP_ENDPOINT: http://otel-collector:4318 OTEL_EXPORTER_OTLP_ENDPOINT: http://otel-collector:4318
otel-collector: otel-collector:
# Receives OTLP HTTP(4318)/gRPC(4317) traffic from the host dev app.
# Forwarding of traces/metrics is defined in configs/otel-collector.dev.yaml.
image: otel/opentelemetry-collector-contrib:0.99.0 image: otel/opentelemetry-collector-contrib:0.99.0
command: command:
- "--config=/etc/otelcol/config.yaml" - "--config=/etc/otelcol/config.yaml"
@@ -105,6 +107,12 @@ services:
environment: environment:
COLLECTOR_OTLP_ENABLED: "true" COLLECTOR_OTLP_ENABLED: "true"
LOG_LEVEL: debug LOG_LEVEL: debug
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:16686 2>/dev/null | grep -q Jaeger"]
interval: 10s
timeout: 3s
retries: 6
start_period: 5s
networks: networks:
- devnet - devnet