Integrate Infrastructure Service Logs into Observability Stack
Purpose
Currently, only Node.js application logs (Ganymede, Gateway) are integrated into the observability stack via OTLP. Infrastructure service logs (PostgreSQL, Nginx, dnsmasq, PowerDNS, and gateway container services) are not yet collected, limiting our ability to correlate application issues with underlying infrastructure problems.
This issue tracks the implementation of OTLP Collector sidecars to collect and forward infrastructure service logs to the main observability stack (Loki via OTLP Collector).
Current State
✅ Already Integrated
- Node.js applications (Ganymede, Gateway) send logs via OTLP
- Logs are structured with trace context and service metadata
- Viewable in Grafana via Loki datasource
❌ Not Yet Integrated
Dev Container Services:
- PostgreSQL - Database logs
- Nginx (Stage 1) - Web server access/error logs (SSL termination)
- dnsmasq - DNS forwarder logs
- PowerDNS - DNS authoritative server logs
Gateway Container Services:
- Nginx (Stage 2) - Reverse proxy logs inside gateway containers
- OpenVPN - VPN server logs inside gateway containers
- app-gateway - Already sends logs via OTLP ✅
Architecture
The OTLP Collector runs in a sibling Docker container, not inside the dev container. This means we need log shipper agents (OTLP Collector sidecars) running inside:
- Dev container - To collect dev container service logs
- Gateway containers - To collect gateway container service logs
Both sidecars forward logs to the main OTLP Collector via HTTP/gRPC API.
Implementation Tasks
Phase 1: Dev Container Sidecar
Phase 2: Gateway Container Sidecar
Phase 3: Testing & Verification
Phase 4: Documentation & Cleanup
Acceptance Criteria
Log Locations Reference
Dev Container:
- Nginx:
/var/log/nginx/access.log, /var/log/nginx/error.log
- PowerDNS:
/var/log/pdns.log (after configuration)
- dnsmasq:
/var/log/dnsmasq.log (after configuration)
- PostgreSQL: Systemd journal (
journalctl -u postgresql)
Gateway Containers:
- Nginx:
/var/log/nginx/access.log, /var/log/nginx/error.log
- OpenVPN:
/tmp/ovpn-{random}/logs/openvpn.log (per VPN instance)
Related Documentation
- See
doc/guides/INFRASTRUCTURE_LOGS_OBSERVABILITY.md for detailed analysis and configuration examples
- See
scripts/local-dev/OBSERVABILITY_SETUP.md for observability stack setup
Notes
- OTLP Collector sidecar approach is chosen for unified pipeline (all logs via OTLP)
- Alternative solutions (Promtail, Fluent Bit) were considered but OTLP Collector provides better integration with existing stack
- Log volume considerations: Nginx access logs can be high volume, consider sampling or filtering if needed
- Gateway containers may run multiple OpenVPN instances, sidecar must handle wildcard log paths
Integrate Infrastructure Service Logs into Observability Stack
Purpose
Currently, only Node.js application logs (Ganymede, Gateway) are integrated into the observability stack via OTLP. Infrastructure service logs (PostgreSQL, Nginx, dnsmasq, PowerDNS, and gateway container services) are not yet collected, limiting our ability to correlate application issues with underlying infrastructure problems.
This issue tracks the implementation of OTLP Collector sidecars to collect and forward infrastructure service logs to the main observability stack (Loki via OTLP Collector).
Current State
✅ Already Integrated
❌ Not Yet Integrated
Dev Container Services:
Gateway Container Services:
Architecture
The OTLP Collector runs in a sibling Docker container, not inside the dev container. This means we need log shipper agents (OTLP Collector sidecars) running inside:
Both sidecars forward logs to the main OTLP Collector via HTTP/gRPC API.
Implementation Tasks
Phase 1: Dev Container Sidecar
otelcol-contribbinary/usr/local/bin//root/.local-dev/observability/collector-sidecar-config.yamlfilelogreceivers for:/var/log/nginx/access.log)/var/log/nginx/error.log)/var/log/pdns.log)/var/log/dnsmasq.log)journaldreceiver for PostgreSQLlog-queriesandlog-facility=/var/log/dnsmasq.login/etc/dnsmasq.conflog-dns-queries=yesandlog-facility=/var/log/pdns.login/etc/powerdns/pdns.conf/var/log/nginx/(already configured)http://observability-otlp-collector:4318Phase 2: Gateway Container Sidecar
otelcol-contrib)/opt/gateway/observability/collector-config.yamlfilelogreceivers for:/var/log/nginx/access.log)/var/log/nginx/error.log)/tmp/ovpn-*/logs/openvpn.log) - wildcard pattern for multiple VPN instancesservice.name,gateway_id,deployment.environmentotelcol-contrib --config=/opt/gateway/observability/collector-config.yaml &observability-networkORgateway-pool.shif neededPhase 3: Testing & Verification
ps aux | grep otelcol-contribdocker exec <container> ps aux | grep otelcol-contrib{service_name="nginx"}{service_name="dnsmasq"}{service_name="powerdns"}{service_name="postgresql"}{service_name="gateway-nginx"}{service_name="gateway-openvpn"}gateway_idattributePhase 4: Documentation & Cleanup
Acceptance Criteria
service.nameand other relevant attributesgateway_idfor filtering per-gateway logsLog Locations Reference
Dev Container:
/var/log/nginx/access.log,/var/log/nginx/error.log/var/log/pdns.log(after configuration)/var/log/dnsmasq.log(after configuration)journalctl -u postgresql)Gateway Containers:
/var/log/nginx/access.log,/var/log/nginx/error.log/tmp/ovpn-{random}/logs/openvpn.log(per VPN instance)Related Documentation
doc/guides/INFRASTRUCTURE_LOGS_OBSERVABILITY.mdfor detailed analysis and configuration examplesscripts/local-dev/OBSERVABILITY_SETUP.mdfor observability stack setupNotes