{ "uid": "factory-api-overview", "title": "Factory — API Overview", "tags": ["factory", "observability", "api"], "timezone": "browser", "schemaVersion": 39, "version": 1, "editable": true, "refresh": "30s", "time": { "from": "now-3h", "to": "now" }, "panels": [ { "id": 1, "type": "stat", "title": "Requests / s (5 m)", "datasource": { "type": "prometheus", "uid": "factory-prometheus" }, "gridPos": { "h": 4, "w": 4, "x": 0, "y": 0 }, "fieldConfig": { "defaults": { "unit": "reqps", "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [] }, "options": { "colorMode": "value", "graphMode": "area" }, "targets": [ { "refId": "A", "expr": "sum(rate(http_request_count_total{service_name=\"factory-api\"}[5m]))", "legendFormat": "rps" } ] }, { "id": 2, "type": "stat", "title": "p95 (overall, 5 m)", "datasource": { "type": "prometheus", "uid": "factory-prometheus" }, "gridPos": { "h": 4, "w": 4, "x": 4, "y": 0 }, "fieldConfig": { "defaults": { "unit": "s", "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 0.5 } ] } }, "overrides": [] }, "options": { "colorMode": "value", "graphMode": "area" }, "targets": [ { "refId": "A", "expr": "max(factory_api:http_request_duration_seconds:p95{quantile=\"0.95\"})", "legendFormat": "p95" } ] }, { "id": 3, "type": "stat", "title": "Error rate 5xx (5 m)", "datasource": { "type": "prometheus", "uid": "factory-prometheus" }, "gridPos": { "h": 4, "w": 4, "x": 8, "y": 0 }, "fieldConfig": { "defaults": { "unit": "percentunit", "decimals": 2, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 0.01 } ] } }, "overrides": [] }, "options": { "colorMode": "value", "graphMode": "area" }, "targets": [ { "refId": "A", "expr": "factory_api:http_request_error_rate:5m", "legendFormat": "5xx ratio" } ] }, { "id": 4, "type": "timeseries", "title": "Requests / s by route group", "datasource": { "type": "prometheus", "uid": "factory-prometheus" }, "gridPos": { "h": 8, "w": 12, "x": 0, "y": 4 }, "fieldConfig": { "defaults": { "unit": "reqps", "custom": { "drawStyle": "line", "fillOpacity": 10 } }, "overrides": [] }, "options": { "legend": { "displayMode": "table", "placement": "right" } }, "targets": [ { "refId": "A", "expr": "sum by (route_group) (rate(http_request_count_total{service_name=\"factory-api\"}[5m]))", "legendFormat": "{{route_group}}" } ] }, { "id": 5, "type": "timeseries", "title": "Latency quantiles by route group (p50 / p95 / p99)", "datasource": { "type": "prometheus", "uid": "factory-prometheus" }, "gridPos": { "h": 8, "w": 12, "x": 12, "y": 4 }, "fieldConfig": { "defaults": { "unit": "s", "custom": { "drawStyle": "line", "fillOpacity": 5 } }, "overrides": [] }, "options": { "legend": { "displayMode": "table", "placement": "right" } }, "targets": [ { "refId": "A", "expr": "factory_api:http_request_duration_seconds:p50", "legendFormat": "{{route_group}} p50" }, { "refId": "B", "expr": "factory_api:http_request_duration_seconds:p95", "legendFormat": "{{route_group}} p95" }, { "refId": "C", "expr": "factory_api:http_request_duration_seconds:p99", "legendFormat": "{{route_group}} p99" } ] }, { "id": 6, "type": "timeseries", "title": "Requests by status", "datasource": { "type": "prometheus", "uid": "factory-prometheus" }, "gridPos": { "h": 8, "w": 8, "x": 0, "y": 12 }, "fieldConfig": { "defaults": { "unit": "reqps", "custom": { "drawStyle": "line" } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" } }, "targets": [ { "refId": "A", "expr": "sum by (status) (rate(http_request_count_total{service_name=\"factory-api\"}[5m]))", "legendFormat": "HTTP {{status}}" } ] }, { "id": 7, "type": "timeseries", "title": "5xx by route group", "datasource": { "type": "prometheus", "uid": "factory-prometheus" }, "gridPos": { "h": 8, "w": 8, "x": 8, "y": 12 }, "fieldConfig": { "defaults": { "unit": "reqps", "custom": { "drawStyle": "line" } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" } }, "targets": [ { "refId": "A", "expr": "sum by (route_group) (rate(http_request_count_total{service_name=\"factory-api\", status=~\"5..\"}[5m]))", "legendFormat": "{{route_group}}" } ] }, { "id": 8, "type": "timeseries", "title": "Handled errors by code (error_total, 5 m)", "datasource": { "type": "prometheus", "uid": "factory-prometheus" }, "gridPos": { "h": 8, "w": 8, "x": 16, "y": 12 }, "fieldConfig": { "defaults": { "unit": "ops", "custom": { "drawStyle": "bars" } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" } }, "targets": [ { "refId": "A", "expr": "sum by (code) (rate(error_total{service_name=\"factory-api\"}[5m]))", "legendFormat": "{{code}}" } ] }, { "id": 9, "type": "timeseries", "title": "DB query p95 by model (10 m)", "datasource": { "type": "prometheus", "uid": "factory-prometheus" }, "gridPos": { "h": 8, "w": 12, "x": 0, "y": 20 }, "fieldConfig": { "defaults": { "unit": "s", "custom": { "drawStyle": "line" } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" } }, "targets": [ { "refId": "A", "expr": "factory_api:db_query_duration_seconds:p95", "legendFormat": "{{model}}" } ] }, { "id": 10, "type": "timeseries", "title": "Redis command p95 (10 m)", "datasource": { "type": "prometheus", "uid": "factory-prometheus" }, "gridPos": { "h": 8, "w": 12, "x": 12, "y": 20 }, "fieldConfig": { "defaults": { "unit": "s", "custom": { "drawStyle": "line" } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" } }, "targets": [ { "refId": "A", "expr": "histogram_quantile(0.95, sum by (le, command) (rate(redis_command_duration_seconds_bucket{service_name=~\"factory-(api|worker)\"}[10m])))", "legendFormat": "{{command}}" } ] } ] }