Apollo GraphQL Router v2 integration with Dash0 observability platform. This project implements a federated GraphQL architecture with load testing to generate realistic telemetry data for evaluating Dash0 as an observability vendor.
This project creates a production-like environment to evaluate how Apollo Router v2 exports OpenTelemetry metrics and traces to Dash0. The architecture includes:
- Apollo Router v2: The supergraph gateway that federates multiple subgraphs
- Custom Subgraphs: Four Node.js-based GraphQL subgraphs (products, reviews, accounts, inventory)
- Load Generation: Vegeta-based HTTP load testing with realistic GraphQL queries
- Observability: OpenTelemetry integration sending metrics and traces to Dash0
┌─────────────┐
│ Vegeta │ (Load Generator)
│ Load Tests │
└──────┬──────┘
│ GraphQL Queries
▼
┌─────────────────────────────┐
│ Apollo Router v2 │
│ (Port 4000) │
│ │
│ - Query Planning │
│ - Federation │
│ - OTLP Export to Dash0 │
└──────┬──────────────────────┘
│
├─────────┬─────────┬─────────┐
▼ ▼ ▼ ▼
┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐
│Products│ │Reviews │ │Accounts│ │Inventory│
│ :4003 │ │ :4002 │ │ :4001 │ │ :4004 │
└────────┘ └────────┘ └────────┘ └────────┘
│ │ │ │
└─────────┴─────────┴─────────┘
│
▼
┌──────────────┐
│ Dash0 │
│ (Cloud OTLP) │
└──────────────┘
- Multiple subgraphs composed into a unified supergraph
- Type federation across services (e.g., User type extended across accounts and reviews)
- Realistic e-commerce data model with products, reviews, and user accounts
- Metrics: Request rates, latencies, error rates from Apollo Router
- Traces: Distributed tracing showing the full request flow through the router and subgraphs
- OpenTelemetry Protocol: Standard OTLP export over HTTP with authentication
- Vegeta HTTP load generator simulating realistic traffic patterns
- Multiple query patterns: simple queries, nested queries, and complex federated queries
- Configurable request rates to demonstrate performance under load
- Apollo Router v2: Latest version of Apollo's high-performance Rust-based router
- Node.js Subgraphs: Custom-built federation-compatible GraphQL services
- Vegeta: Modern HTTP load testing tool
- Docker Compose: Container orchestration for local development
- Dash0: Cloud-native observability platform with OpenTelemetry support
The project is organized into two clear deployment paths - choose the one that fits your needs:
.
├── docker-compose/ # Docker Compose deployment (local development)
│ ├── docker-compose.yaml # Core services only (router + subgraphs + DB)
│ ├── start.sh # Quick start script
│ ├── stop.sh # Shutdown script
│ ├── status.sh # Check status
│ └── README.md # Compose-specific documentation
│
├── kubernetes/ # Kubernetes deployment (k3d)
│ ├── start.sh # Start k3d cluster
│ ├── stop.sh # Tear down cluster
│ ├── status.sh # Check cluster status
│ ├── helm-values/ # Helm chart values for router
│ ├── base/ # Kubernetes manifests
│ ├── scripts/ # Deployment scripts (k3d-up.sh, etc.)
│ ├── README.md # Main Kubernetes docs
│ └── README-DEPLOYMENT.md # Deployment guide
│
├── shared/ # Shared across both deployments
│ ├── router/ # Apollo Router config and schema
│ │ ├── router.yaml # Router configuration
│ │ └── supergraph.graphql # Federation schema
│ └── subgraphs/ # All subgraph services
│ ├── accounts/ # User accounts subgraph
│ ├── products-py/ # Product catalog (Python)
│ ├── reviews/ # Reviews subgraph
│ ├── inventory/ # Inventory management
│ └── shared/ # Common utilities
│
├── .env # Your credentials (shared by both paths)
├── .env.sample # Template with all options
├── dashboards/ # Dash0 dashboard templates
├── docs/ # Documentation
├── scripts/ # Root-level utilities
├── terraform/ # Infrastructure as code
├── README.md # This file
└── CLAUDE.md # AI assistant guidelines
- Supergraph composition with introspection enabled
- Query plan caching for performance
- OpenTelemetry exporter configured for Dash0
- Trace sampling and resource attributes
- HTTP/2 support for OTLP
- Federation v2 directives
- Entity resolution for type extensions
- Reference resolvers for federated types
- Custom scalar types
- Realistic data generators
- Products Query: Simple top products list
- Reviews Query: Federated query across users and reviews
- Large Query: Complex nested query to test performance
- Recommended Query: Multi-hop federated query
Willful Waste Retail Store (New Feature!)
- Complete e-commerce demo with frontend, bot, and full observability
- Quick start: See docs/START_HERE.md
- Full setup: See docs/WILLFUL_WASTE_SETUP.md
- Website docs: See website/README.md
- Bot docs: See website-bot/README.md
General Documentation
- Project structure guide: docs/STRUCTURE.md
- Migration guide: docs/MIGRATION.md (what changed in restructuring)
- Quick commands: docs/QUICK_REFERENCE.md
- Complete index: docs/INDEX.md
- Implementation details: docs/IMPLEMENTATION_DETAILS.md
Database Observability
- PostgreSQL Metrics (New!): docs/POSTGRESQL_METRICS_QUICKSTART.md - Get database metrics flowing in 5 minutes
- PostgreSQL detailed guide: docs/POSTGRESQL_METRICS.md - Comprehensive setup and configuration
- PostgreSQL setup: docs/POSTGRES_SETUP.md - Database initialization guide
- Docker (or Colima on macOS)
- Dash0 account with API token (for observability features)
- (Optional) Node.js 18+ for local subgraph development
Choose your deployment path:
Perfect for fast iteration and testing. ~1-2 minute startup.
# 1. Configure credentials
cp .env.sample .env
# Edit .env and set:
# - DASH0_AUTH_TOKEN
# - DASH0_REGION
# 2. Start services
cd compose
./start.sh
# 3. Access GraphQL API
# http://localhost:4000For more details, see compose/README.md.
Full Kubernetes cluster with Dash0 operator, auto-instrumentation, and CloudNativePG database. ~5-10 minute setup.
# 1. Configure credentials
cp .env.sample .env
# Edit .env and set:
# - DASH0_AUTH_TOKEN
# - DASH0_REGION
# - DASH0_METRICS_ENDPOINT
# - DASH0_TRACES_ENDPOINT
# 2. Start cluster
cd kubernetes
./start.sh
# 3. Check status
./status.shFor more details, see kubernetes/README-DEPLOYMENT.md.
| Feature | Docker Compose | Kubernetes |
|---|---|---|
| Setup time | ~1-2 min | ~5-10 min |
| Complexity | Low | Medium |
| Observability | Basic | Full (Dash0) |
| Database | Single PostgreSQL | CloudNativePG replicated |
| Best for | Local dev, quick tests | Production evaluation |
Start load generation:
docker compose --profile load-testing up -d vegetaAdjust load parameters in .env:
VEGETA_RATE=10 # Requests per second
VEGETA_DURATION=0 # 0 = infinite duration
VEGETA_TIMEOUT=10s # Request timeoutThis project uses environment variables for secure configuration management.
# Copy the sample environment file
cp .env.sample .env
# Edit .env with your credentials
nano .env| Variable | Description | Example |
|---|---|---|
DASH0_AUTH_TOKEN |
Dash0 API token with "Bearer " prefix | Bearer auth_abc123... |
DASH0_REGION |
Your Dash0 region | us-west-2 |
| Variable | Description | Default |
|---|---|---|
APOLLO_KEY |
Apollo GraphOS API key | Not set |
APOLLO_GRAPH_REF |
Apollo GraphOS graph reference | Not set |
SERVICE_NAME |
OpenTelemetry service name | apollo-router-demo |
SERVICE_VERSION |
Service version | 2.0 |
ENVIRONMENT |
Deployment environment | demo |
VEGETA_RATE |
Load test requests/sec | 5 |
-
API Token:
- Log into https://app.dash0.com
- Navigate to Settings → API Tokens
- Create new token with write permissions for metrics and traces
- Copy token and add "Bearer " prefix in
.env
-
Region:
- Found in your Dash0 dashboard URL or Settings → Endpoints
- Common:
us-west-2,us-east-1,eu-central-1
The router configuration uses environment variable expansion:
telemetry:
exporters:
metrics:
otlp:
endpoint: "${env.DASH0_METRICS_ENDPOINT}"
http:
headers:
"Authorization": "${env.DASH0_AUTH_TOKEN}"Docker Compose loads variables from .env and passes them to containers.
Development session notes are organized in docs/sessions/. Each session has its own directory with:
notes.md- Detailed session notes, findings, and configurationswrap-up.md- Session summary and next steps
Latest session: 2025-10-12 - Fixed Docker health checks and trace sampling for complete service map visibility
This project includes a comprehensive Apollo Router performance dashboard converted from the official Apollo GraphOS Datadog template.
Location: dashboards/
Features:
- Automated conversion from Datadog to Dash0 Perses format
- 41 monitoring panels across all Apollo Router metrics
- One-command deployment via Dash0 API
- Full PromQL query conversion
Quick Start:
cd dashboards
node convert.js # Convert Datadog template to Dash0 format
./deploy.sh # Deploy to your Dash0 accountSee dashboards/README.md for detailed documentation.
- ✅
Test/try out connecting to https://api.us-west-2.aws.dash0.com/mcp with Claude Code- Completed (See 2025-10-11 notes) - ✅
Test Dash0 MCP server functionality- Completed (All MCP tools verified working) - ✅
Pull in Datadog template and recreate in Dash0- Completed (See dashboards/README.md) - ✅
Fix broken dashboard panels and temporality configuration- Completed (See 2025-10-15 wrap-up) - ✅
Add Kubernetes (k3d) deployment option- Completed (See kubernetes/README.md) - ✅
Integrate Dash0 Kubernetes operator- Completed (See 2025-10-17 wrap-up)
- Test dashboard with diverse GraphQL queries to verify all panels
- Verify Node.js subgraph auto-instrumentation in k8s
- Add Dash0 alert rules for key metrics (error rate, latency spikes)
- Add load testing deployment to k8s
- Document metric thresholds and troubleshooting runbook
This project is inspired by the Apollo Router Performance Workshop, adapted for Dash0 observability evaluation.