Files
foxhunt/services/api_gateway
jgrusewski 1421c46ed4 feat: absorb monitoring service into API Gateway
Port Prometheus scraping and training metrics RPCs directly into
api_gateway, eliminating the monitoring-service backend proxy.
MonitoringServiceProxy replaced with MonitoringServiceHandler that
queries Prometheus directly for training metrics, GPU stats, and
active job counts.

Changes:
- monitoring_proxy.rs -> monitoring_handler.rs with embedded PrometheusClient
- Remove MonitoringBackendConfig and setup_monitoring_proxy from server.rs
- main.rs reads PROMETHEUS_URL + MONITORING_STREAM_INTERVAL instead of
  MONITORING_SERVICE_URL
- Remove monitoring-service from backend health check list
- Monitoring is always available (no graceful degradation needed)
- Fix fxt build.rs compile_protos type mismatch
- All 9 ported unit tests + 0 clippy warnings

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 21:05:27 +01:00
..

api_gateway

API Gateway service with 6-layer authentication, RBAC, rate limiting, and gRPC proxy routing.

Key Types

  • ApiGatewayService -- main service implementation
  • RoleBasedAccessControl -- RBAC authorization
  • RateLimiter -- 3-tier rate limiting (auth/trading/compute)
  • CircuitBreaker -- upstream service protection

Configuration

  • JWT_SECRET -- JWT signing secret (min 32 chars)
  • UPSTREAM_TRADING_URL -- trading service gRPC endpoint
  • UPSTREAM_ML_URL -- ML service gRPC endpoint

Features

  • mfa (default) -- multi-factor authentication support
  • Build without: cargo check -p api_gateway --no-default-features --features minimal