{ "dashboard": { "title": "API Gateway - Authentication & Performance", "tags": ["api-gateway", "authentication", "hft"], "timezone": "browser", "schemaVersion": 16, "version": 1, "refresh": "5s", "panels": [ { "id": 1, "title": "Authentication Overview", "type": "row", "gridPos": { "x": 0, "y": 0, "w": 24, "h": 1 } }, { "id": 2, "title": "Auth Requests (Total vs Success vs Failure)", "type": "graph", "gridPos": { "x": 0, "y": 1, "w": 12, "h": 8 }, "targets": [ { "expr": "rate(api_gateway_auth_requests_total[1m])", "legendFormat": "Total Requests/s", "refId": "A" }, { "expr": "rate(api_gateway_auth_requests_success[1m])", "legendFormat": "Success/s", "refId": "B" }, { "expr": "rate(api_gateway_auth_requests_failure[1m])", "legendFormat": "Failures/s", "refId": "C" } ], "yaxes": [ { "format": "reqps", "label": "Requests/s" }, { "format": "short" } ] }, { "id": 3, "title": "Auth Success Rate (%)", "type": "singlestat", "gridPos": { "x": 12, "y": 1, "w": 6, "h": 4 }, "targets": [ { "expr": "100 * rate(api_gateway_auth_requests_success[5m]) / rate(api_gateway_auth_requests_total[5m])", "refId": "A" } ], "format": "percent", "thresholds": "90,95", "colors": ["#d44a3a", "#e0b400", "#299c46"] }, { "id": 4, "title": "Auth SLA Compliance (<10μs)", "type": "singlestat", "gridPos": { "x": 18, "y": 1, "w": 6, "h": 4 }, "targets": [ { "expr": "100 * rate(api_gateway_auth_sla_met[5m]) / (rate(api_gateway_auth_sla_met[5m]) + rate(api_gateway_auth_sla_exceeded[5m]))", "refId": "A" } ], "format": "percent", "thresholds": "95,99", "colors": ["#d44a3a", "#e0b400", "#299c46"] }, { "id": 5, "title": "Authentication Layer Latencies (μs)", "type": "graph", "gridPos": { "x": 0, "y": 9, "w": 24, "h": 8 }, "targets": [ { "expr": "histogram_quantile(0.99, rate(api_gateway_jwt_extraction_duration_microseconds_bucket[1m]))", "legendFormat": "JWT Extraction p99", "refId": "A" }, { "expr": "histogram_quantile(0.99, rate(api_gateway_jwt_validation_duration_microseconds_bucket[1m]))", "legendFormat": "JWT Validation p99", "refId": "B" }, { "expr": "histogram_quantile(0.99, rate(api_gateway_revocation_check_duration_microseconds_bucket[1m]))", "legendFormat": "Revocation Check p99", "refId": "C" }, { "expr": "histogram_quantile(0.99, rate(api_gateway_rbac_check_duration_microseconds_bucket[1m]))", "legendFormat": "RBAC Check p99", "refId": "D" }, { "expr": "histogram_quantile(0.99, rate(api_gateway_rate_limit_check_duration_microseconds_bucket[1m]))", "legendFormat": "Rate Limit Check p99", "refId": "E" }, { "expr": "histogram_quantile(0.99, rate(api_gateway_auth_total_duration_microseconds_bucket[1m]))", "legendFormat": "Total Auth p99", "refId": "F" } ], "yaxes": [ { "format": "µs", "label": "Latency (μs)" }, { "format": "short" } ], "alert": { "name": "Auth Latency SLA Violation", "conditions": [ { "evaluator": { "params": [10], "type": "gt" }, "query": { "params": ["F", "5m", "now"] }, "type": "query" } ], "message": "Authentication latency exceeded 10μs SLA" } }, { "id": 6, "title": "Authentication Errors by Type", "type": "graph", "gridPos": { "x": 0, "y": 17, "w": 12, "h": 8 }, "targets": [ { "expr": "rate(api_gateway_auth_errors_missing_jwt[1m])", "legendFormat": "Missing JWT", "refId": "A" }, { "expr": "rate(api_gateway_auth_errors_invalid_jwt[1m])", "legendFormat": "Invalid JWT", "refId": "B" }, { "expr": "rate(api_gateway_auth_errors_expired_jwt[1m])", "legendFormat": "Expired JWT", "refId": "C" }, { "expr": "rate(api_gateway_auth_errors_revoked_jwt[1m])", "legendFormat": "Revoked JWT", "refId": "D" }, { "expr": "rate(api_gateway_auth_errors_permission_denied[1m])", "legendFormat": "Permission Denied", "refId": "E" }, { "expr": "rate(api_gateway_auth_errors_rate_limited[1m])", "legendFormat": "Rate Limited", "refId": "F" } ], "yaxes": [ { "format": "reqps", "label": "Errors/s" }, { "format": "short" } ] }, { "id": 7, "title": "Cache Performance", "type": "graph", "gridPos": { "x": 12, "y": 17, "w": 12, "h": 8 }, "targets": [ { "expr": "100 * rate(api_gateway_jwt_cache_hits[1m]) / (rate(api_gateway_jwt_cache_hits[1m]) + rate(api_gateway_jwt_cache_misses[1m]))", "legendFormat": "JWT Cache Hit Rate %", "refId": "A" }, { "expr": "100 * rate(api_gateway_rbac_cache_hits[1m]) / (rate(api_gateway_rbac_cache_hits[1m]) + rate(api_gateway_rbac_cache_misses[1m]))", "legendFormat": "RBAC Cache Hit Rate %", "refId": "B" } ], "yaxes": [ { "format": "percent", "label": "Hit Rate %", "min": 0, "max": 100 }, { "format": "short" } ] }, { "id": 8, "title": "Backend Services", "type": "row", "gridPos": { "x": 0, "y": 25, "w": 24, "h": 1 } }, { "id": 9, "title": "Backend Request Latency by Service (p99)", "type": "graph", "gridPos": { "x": 0, "y": 26, "w": 12, "h": 8 }, "targets": [ { "expr": "histogram_quantile(0.99, rate(api_gateway_backend_request_duration_milliseconds_bucket{service=\"trading\"}[1m]))", "legendFormat": "Trading Service p99", "refId": "A" }, { "expr": "histogram_quantile(0.99, rate(api_gateway_backend_request_duration_milliseconds_bucket{service=\"backtesting\"}[1m]))", "legendFormat": "Backtesting Service p99", "refId": "B" }, { "expr": "histogram_quantile(0.99, rate(api_gateway_backend_request_duration_milliseconds_bucket{service=\"ml_training\"}[1m]))", "legendFormat": "ML Training Service p99", "refId": "C" } ], "yaxes": [ { "format": "ms", "label": "Latency (ms)" }, { "format": "short" } ] }, { "id": 10, "title": "Circuit Breaker States", "type": "graph", "gridPos": { "x": 12, "y": 26, "w": 12, "h": 8 }, "targets": [ { "expr": "api_gateway_circuit_breaker_state{service=\"trading\"}", "legendFormat": "Trading (0=closed, 2=open)", "refId": "A" }, { "expr": "api_gateway_circuit_breaker_state{service=\"backtesting\"}", "legendFormat": "Backtesting", "refId": "B" }, { "expr": "api_gateway_circuit_breaker_state{service=\"ml_training\"}", "legendFormat": "ML Training", "refId": "C" } ], "yaxes": [ { "format": "short", "label": "State", "min": 0, "max": 2 }, { "format": "short" } ], "alert": { "name": "Circuit Breaker Open", "conditions": [ { "evaluator": { "params": [1.5], "type": "gt" }, "query": { "params": ["A", "1m", "now"] }, "type": "query" } ], "message": "Circuit breaker opened for backend service" } }, { "id": 11, "title": "Backend Health Status", "type": "table", "gridPos": { "x": 0, "y": 34, "w": 12, "h": 6 }, "targets": [ { "expr": "api_gateway_health_status", "format": "table", "instant": true, "refId": "A" } ], "styles": [ { "pattern": "Value", "type": "string", "mappingType": 1, "valueMaps": [ { "value": "0", "text": "Unhealthy" }, { "value": "1", "text": "Healthy" } ] } ] }, { "id": 12, "title": "Connection Pool Utilization", "type": "graph", "gridPos": { "x": 12, "y": 34, "w": 12, "h": 6 }, "targets": [ { "expr": "100 * api_gateway_connection_pool_active / api_gateway_connection_pool_max", "legendFormat": "{{service}} Pool Utilization %", "refId": "A" } ], "yaxes": [ { "format": "percent", "label": "Pool Utilization %", "min": 0, "max": 100 }, { "format": "short" } ] }, { "id": 13, "title": "Configuration & Hot-Reload", "type": "row", "gridPos": { "x": 0, "y": 40, "w": 24, "h": 1 } }, { "id": 14, "title": "Configuration Reload Events", "type": "graph", "gridPos": { "x": 0, "y": 41, "w": 12, "h": 6 }, "targets": [ { "expr": "rate(api_gateway_config_updates_auth[5m])", "legendFormat": "Auth Config Updates", "refId": "A" }, { "expr": "rate(api_gateway_config_updates_routing[5m])", "legendFormat": "Routing Config Updates", "refId": "B" }, { "expr": "rate(api_gateway_config_updates_rate_limit[5m])", "legendFormat": "Rate Limit Config Updates", "refId": "C" }, { "expr": "rate(api_gateway_config_updates_backend[5m])", "legendFormat": "Backend Config Updates", "refId": "D" } ], "yaxes": [ { "format": "ops", "label": "Updates/s" }, { "format": "short" } ] }, { "id": 15, "title": "Hot-Reload Latency (p95)", "type": "graph", "gridPos": { "x": 12, "y": 41, "w": 12, "h": 6 }, "targets": [ { "expr": "histogram_quantile(0.95, rate(api_gateway_config_reload_duration_milliseconds_bucket[1m]))", "legendFormat": "Config Reload p95", "refId": "A" }, { "expr": "histogram_quantile(0.95, rate(api_gateway_config_fetch_duration_milliseconds_bucket[1m]))", "legendFormat": "Config Fetch p95", "refId": "B" } ], "yaxes": [ { "format": "ms", "label": "Latency (ms)" }, { "format": "short" } ] }, { "id": 16, "title": "NOTIFY Listener Status", "type": "singlestat", "gridPos": { "x": 0, "y": 47, "w": 6, "h": 4 }, "targets": [ { "expr": "api_gateway_notify_listener_connected", "refId": "A" } ], "valueName": "current", "valueMaps": [ { "value": "0", "text": "Disconnected" }, { "value": "1", "text": "Connected" } ], "thresholds": "0.5,1", "colors": ["#d44a3a", "#e0b400", "#299c46"] }, { "id": 17, "title": "Rate Limiting", "type": "row", "gridPos": { "x": 0, "y": 51, "w": 24, "h": 1 } }, { "id": 18, "title": "Rate Limit Hits by User (Top 10)", "type": "graph", "gridPos": { "x": 0, "y": 52, "w": 12, "h": 8 }, "targets": [ { "expr": "topk(10, rate(api_gateway_rate_limits_by_user[1m]))", "legendFormat": "{{user_id}}", "refId": "A" } ], "yaxes": [ { "format": "reqps", "label": "Rate Limit Hits/s" }, { "format": "short" } ] }, { "id": 19, "title": "Active Rate Limiter Entries", "type": "singlestat", "gridPos": { "x": 12, "y": 52, "w": 6, "h": 4 }, "targets": [ { "expr": "api_gateway_rate_limiter_entries", "refId": "A" } ], "format": "short", "valueName": "current" } ] } }