localgreenchain/infra/prometheus/prometheus.yml
Claude 5ea8bab5c3
Add production deployment infrastructure (Agent 4)
- Docker: Multi-stage Dockerfile with security hardening, docker-compose
  for production and development environments
- Environment: Comprehensive .env.example with all config options,
  lib/config/env.ts for typed environment validation
- Logging: Structured JSON logging with request/response middleware
- Monitoring: Prometheus metrics endpoint, Grafana dashboard, health
  checks (liveness/readiness probes)
- Security: Security headers, rate limiting, CORS middleware
- CI/CD: GitHub Actions workflows for CI, production deploy, and
  preview deployments
- Error tracking: Sentry integration foundation

Files created:
- Docker: Dockerfile, docker-compose.yml, docker-compose.dev.yml, .dockerignore
- Config: lib/config/env.ts, lib/config/index.ts
- Logging: lib/logging/logger.ts, lib/logging/middleware.ts
- Monitoring: lib/monitoring/sentry.ts, lib/monitoring/metrics.ts,
  lib/monitoring/health.ts
- Security: lib/security/headers.ts, lib/security/rateLimit.ts,
  lib/security/cors.ts
- API: pages/api/health/*, pages/api/metrics.ts
- Infra: infra/prometheus/prometheus.yml, infra/grafana/*
2025-11-23 03:54:03 +00:00

65 lines
1.5 KiB
YAML

# LocalGreenChain Prometheus Configuration
# Agent 4: Production Deployment
global:
scrape_interval: 15s
evaluation_interval: 15s
external_labels:
monitor: 'localgreenchain'
# Alerting configuration (optional)
alerting:
alertmanagers:
- static_configs:
- targets: []
# - alertmanager:9093
# Rule files (optional)
rule_files: []
# - "first_rules.yml"
# - "second_rules.yml"
# Scrape configurations
scrape_configs:
# Prometheus self-monitoring
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']
metrics_path: /metrics
# LocalGreenChain Application
- job_name: 'localgreenchain'
static_configs:
- targets: ['app:3001']
metrics_path: /api/metrics
scrape_interval: 30s
scrape_timeout: 10s
# PostgreSQL (if using postgres_exporter)
- job_name: 'postgresql'
static_configs:
- targets: []
# - postgres-exporter:9187
scrape_interval: 60s
# Redis (if using redis_exporter)
- job_name: 'redis'
static_configs:
- targets: []
# - redis-exporter:9121
scrape_interval: 30s
# Node Exporter (if running)
- job_name: 'node'
static_configs:
- targets: []
# - node-exporter:9100
scrape_interval: 30s
# Remote write configuration (optional)
# For long-term storage or external Prometheus
# remote_write:
# - url: "https://remote-prometheus.example.com/api/v1/write"
# basic_auth:
# username: user
# password: pass