learning_ai_common_plat/services/monitoring/grafana/dashboards/extraction-service.json
saravanakumardb1 b8c0a73e89 feat(extraction): Phase 5 observability + error handling (5.7-5.12)
- 5.7: Enhanced structured logging with userId, productId, cacheHit, tokenCount
- 5.8: Metrics module (counters + histograms) + /extract/metrics endpoint
- 5.9: Grafana dashboard config for extraction-service (Loki queries)
- 5.10: Error mapping — sidecar errors → proper HTTP status codes (408, 429, 502, 503)
- 5.11: Circuit breaker for Python sidecar (5 failures → 30s OPEN)
- 5.12: Graceful degradation — circuit open returns 503, cached results still served
- 46 TS tests passing
2026-02-14 14:04:59 -08:00

96 lines
2.8 KiB
JSON

{
"annotations": { "list": [] },
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": null,
"links": [],
"panels": [
{
"title": "Extraction Requests (Loki logs)",
"type": "timeseries",
"gridPos": { "h": 8, "w": 12, "x": 0, "y": 0 },
"targets": [
{
"datasource": { "type": "loki", "uid": "loki" },
"expr": "count_over_time({container=\"extraction-service\"} |= \"extraction complete\" [5m])",
"legendFormat": "Extractions / 5m"
}
]
},
{
"title": "Cache Hits vs Misses",
"type": "timeseries",
"gridPos": { "h": 8, "w": 12, "x": 12, "y": 0 },
"targets": [
{
"datasource": { "type": "loki", "uid": "loki" },
"expr": "count_over_time({container=\"extraction-service\"} |= \"cache hit\" [5m])",
"legendFormat": "Cache Hits / 5m"
},
{
"datasource": { "type": "loki", "uid": "loki" },
"expr": "count_over_time({container=\"extraction-service\"} |= \"extraction complete\" |= \"cacheHit\":false [5m])",
"legendFormat": "Cache Misses / 5m"
}
]
},
{
"title": "Errors",
"type": "timeseries",
"gridPos": { "h": 8, "w": 12, "x": 0, "y": 8 },
"targets": [
{
"datasource": { "type": "loki", "uid": "loki" },
"expr": "count_over_time({container=\"extraction-service\"} |= \"error\" [5m])",
"legendFormat": "Errors / 5m"
}
]
},
{
"title": "Quota Exceeded (429s)",
"type": "stat",
"gridPos": { "h": 8, "w": 12, "x": 12, "y": 8 },
"targets": [
{
"datasource": { "type": "loki", "uid": "loki" },
"expr": "count_over_time({container=\"extraction-service\"} |= \"quota exceeded\" [24h])",
"legendFormat": "429s Today"
}
]
},
{
"title": "Python Sidecar Health",
"type": "stat",
"gridPos": { "h": 4, "w": 6, "x": 0, "y": 16 },
"targets": [
{
"datasource": { "type": "loki", "uid": "loki" },
"expr": "count_over_time({container=\"extraction-service\"} |= \"Sidecar unavailable\" [1h])",
"legendFormat": "Sidecar Errors (1h)"
}
]
},
{
"title": "Extraction Logs",
"type": "logs",
"gridPos": { "h": 10, "w": 24, "x": 0, "y": 20 },
"targets": [
{
"datasource": { "type": "loki", "uid": "loki" },
"expr": "{container=\"extraction-service\"}"
}
]
}
],
"schemaVersion": 39,
"tags": ["extraction", "lysnrai"],
"templating": { "list": [] },
"time": { "from": "now-6h", "to": "now" },
"timepicker": {},
"timezone": "",
"title": "Extraction Service",
"uid": "extraction-service",
"version": 1
}