NeXuS

Prometheus

Prometheus collects metrics from all NeXuS services at 15-second intervals. It runs internally at nexus-prometheus:9090.

Configuration

The Prometheus config lives at infrastructure/prometheus/prometheus.yml:

global:
  scrape_interval: 15s
  evaluation_interval: 15s
  external_labels:
    cluster: 'nexus'
    environment: 'production'

Scrape Targets

Prometheus is configured to scrape all NeXuS services:

Job Target Metrics Path Labels
prometheus localhost:9090 /metrics service=prometheus
docker host.docker.internal:9323 /metrics service=docker-daemon
nexus-api nexus-api:4000 /metrics service=api-gateway, tier=core
nexus-frontend nexus-frontend:3000 /api/metrics service=frontend, tier=web
nexus-auth nexus-auth:6000 /metrics service=auth, tier=core
nexus-cms nexus-cms:7000 /metrics service=cms, tier=application
nexus-cdn nexus-cdn:7001 /metrics service=cdn, tier=application
nexus-cache nexus-cache:7002 /metrics service=cache, tier=application
nexus-waf nexus-waf:7003 /metrics service=waf, tier=security
nexus-ai nexus-ai:5000 /metrics service=ai-gateway, tier=ai
nexus-mcp nexus-mcp:5001 /metrics service=mcp-server, tier=integration

Service Tiers

Services are labeled by tier for filtering in Grafana:

Tier Services
core API Gateway, Auth
web Frontend
application CMS, CDN, Cache
security WAF
ai AI Gateway
integration MCP Server

Example Queries

# Total HTTP requests across all services
sum(rate(http_requests_total[5m]))

# Requests by service
sum by (service) (rate(http_requests_total[5m]))

# Memory usage across all containers
sum(container_memory_usage_bytes)

# Redis connected clients
redis_connected_clients

# Top 5 containers by CPU
topk(5, rate(container_cpu_usage_seconds_total[5m]))

Future Exporters

The config includes commented-out sections for database exporters:

Uncomment and add the exporter containers to enable detailed database metrics.