Full-stack e-commerce app demonstrating OpenTelemetry backend integration with Sentry.
- Direct Mode: Single monolithic Express API sending telemetry directly to one Sentry project
- Collector Mode: Microservices (Gateway + Products + Orders) with OTEL Collector routing each service to separate Sentry projects
- Python Service: Demonstrates Sentry's OTLP integration for Python (simplest setup - just needs a DSN!)
Frontend: React app with Sentry SDK for distributed tracing and error tracking
Direct Mode:
┌─────────────────┐
│ Express API │
│ (Port 3000) │
└────────┬────────┘
│ OTLP/HTTP
▼
┌─────────────────┐
│ Sentry Project │
└─────────────────┘
Collector Mode (Multi-Project Routing):
┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
│ API Gateway │ │ Products Service │ │ Orders Service │
│ (port 3000) │ │ (port 3001) │ │ (port 3002) │
│ │ │ service.name: │ │ service.name: │
│ │ │ products-service │ │ orders-service │
└────────┬─────────┘ └────────┬─────────┘ └────────┬─────────┘
│ │ │
│ OTLP │ OTLP │ OTLP
▼ ▼ ▼
┌──────────────────────────────────────────────────────┐
│ OTEL Collector (Routing Connector) │
└────┬──────────────────────────┬──────────────────────┘
│ │
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ Sentry Project │ │ Sentry Project │
│ (Products) │ │ (Orders) │
└─────────────────┘ └─────────────────┘
- Node.js 18+
- Python 3.7+ (optional, for Python service demo)
- PostgreSQL database (recommend https://neon.tech)
- Free or Paid Sentry account
npm run install:all # Install all dependencies
cp api/.env.example api/.env # Configure API environment
cp frontend/.env.example frontend/.env # Configure frontend environment
npm run db:init # Auto-creates Neon database
npm run db:setup # Initialize databaseAdd your Sentry OTLP endpoint(s) to api/.env (see api/QUICKSTART.md)
Direct Mode (single Sentry project):
npm run demo:directCollector Mode (multi-project routing):
npm run demo:collectorBoth modes run on http://localhost:3000
Test:
# Load test (creates products, orders, payments, errors)
npm run test:api
# Or test manually with curl
curl http://localhost:3000/api/productsNEW: Demonstrates Sentry's Python OTLP integration - the simplest setup of all!
# Setup Python service (creates virtual environment automatically)
npm run python:install # Creates venv and installs dependencies
npm run python:setup # Copy .env.example to .env
# Edit python-service/.env - add your SENTRY_DSN and DATABASE_URL
npm run python # Run service on http://localhost:3003Key advantages:
- Python only needs a DSN - no manual OTLP endpoint configuration required!
- Uses virtual environment (best practice) - no system Python conflicts
See python-service/README.md for full documentation.
Frontend .env was already configured in step 1. Add your VITE_SENTRY_DSN to frontend/.env, then:
npm run frontend # Open http://localhost:5173Direct Mode:
api/instrument-otel.js- OTEL SDK instrumentationapi/src/server.js- Main application server
Collector Mode:
api/collector-config.yaml- Collector routing configurationapi/instrument-otel-gateway.js- Gateway instrumentationapi/instrument-otel-products.js- Products service instrumentationapi/instrument-otel-orders.js- Orders service instrumentation
Python Service (Sentry OTLP Integration):
python-service/src/instrument.py- Sentry OTLP integration setuppython-service/src/app.py- Flask application with auto-instrumentationpython-service/README.md- Full Python service documentation