forked from mtusi2026/mtusi2026lab6
191 lines
5.2 KiB
JSON
191 lines
5.2 KiB
JSON
{
|
|
"annotations": {
|
|
"list": []
|
|
},
|
|
"editable": true,
|
|
"fiscalYearStartMonth": 0,
|
|
"graphTooltip": 1,
|
|
"id": null,
|
|
"links": [],
|
|
"panels": [
|
|
{
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "reqps"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"gridPos": { "h": 8, "w": 8, "x": 0, "y": 0 },
|
|
"id": 1,
|
|
"targets": [
|
|
{
|
|
"expr": "sum(rate(messenger_http_requests_total[1m]))",
|
|
"legendFormat": "RPS",
|
|
"refId": "A"
|
|
}
|
|
],
|
|
"title": "API RPS",
|
|
"type": "timeseries"
|
|
},
|
|
{
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "percentunit",
|
|
"min": 0
|
|
},
|
|
"overrides": []
|
|
},
|
|
"gridPos": { "h": 8, "w": 8, "x": 8, "y": 0 },
|
|
"id": 2,
|
|
"targets": [
|
|
{
|
|
"expr": "sum(rate(messenger_http_requests_total{http_response_status_class=~\"5xx\"}[1m])) / clamp_min(sum(rate(messenger_http_requests_total[1m])), 1e-9)",
|
|
"legendFormat": "5xx ratio",
|
|
"refId": "A"
|
|
},
|
|
{
|
|
"expr": "sum(rate(messenger_http_requests_total{http_response_status_class=~\"4xx\"}[1m])) / clamp_min(sum(rate(messenger_http_requests_total[1m])), 1e-9)",
|
|
"legendFormat": "4xx ratio",
|
|
"refId": "B"
|
|
}
|
|
],
|
|
"title": "API error ratio",
|
|
"type": "timeseries"
|
|
},
|
|
{
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "s"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"gridPos": { "h": 8, "w": 8, "x": 16, "y": 0 },
|
|
"id": 3,
|
|
"targets": [
|
|
{
|
|
"expr": "histogram_quantile(0.50, sum(rate(messenger_http_request_duration_seconds_bucket[5m])) by (le))",
|
|
"legendFormat": "p50",
|
|
"refId": "A"
|
|
},
|
|
{
|
|
"expr": "histogram_quantile(0.95, sum(rate(messenger_http_request_duration_seconds_bucket[5m])) by (le))",
|
|
"legendFormat": "p95",
|
|
"refId": "B"
|
|
},
|
|
{
|
|
"expr": "histogram_quantile(0.99, sum(rate(messenger_http_request_duration_seconds_bucket[5m])) by (le))",
|
|
"legendFormat": "p99",
|
|
"refId": "C"
|
|
}
|
|
],
|
|
"title": "API duration",
|
|
"type": "timeseries"
|
|
},
|
|
{
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "ops"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"gridPos": { "h": 8, "w": 12, "x": 0, "y": 8 },
|
|
"id": 4,
|
|
"targets": [
|
|
{
|
|
"expr": "sum(rate(messenger_jobs_processed_total{job_outcome=\"success\"}[1m])) by (job_type)",
|
|
"legendFormat": "success {{job_type}}",
|
|
"refId": "A"
|
|
},
|
|
{
|
|
"expr": "sum(rate(messenger_jobs_processed_total{job_outcome=\"error\"}[1m])) by (job_type)",
|
|
"legendFormat": "error {{job_type}}",
|
|
"refId": "B"
|
|
}
|
|
],
|
|
"title": "Worker jobs success / error",
|
|
"type": "timeseries"
|
|
},
|
|
{
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "s"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"gridPos": { "h": 8, "w": 12, "x": 12, "y": 8 },
|
|
"id": 5,
|
|
"targets": [
|
|
{
|
|
"expr": "histogram_quantile(0.50, sum(rate(messenger_job_duration_seconds_bucket[5m])) by (le, job_outcome))",
|
|
"legendFormat": "p50 {{job_outcome}}",
|
|
"refId": "A"
|
|
},
|
|
{
|
|
"expr": "histogram_quantile(0.95, sum(rate(messenger_job_duration_seconds_bucket[5m])) by (le, job_outcome))",
|
|
"legendFormat": "p95 {{job_outcome}}",
|
|
"refId": "B"
|
|
}
|
|
],
|
|
"title": "Worker job duration",
|
|
"type": "timeseries"
|
|
},
|
|
{
|
|
"datasource": { "type": "loki", "uid": "loki" },
|
|
"gridPos": { "h": 8, "w": 12, "x": 0, "y": 16 },
|
|
"id": 6,
|
|
"options": {
|
|
"showTime": true,
|
|
"sortOrder": "Descending",
|
|
"wrapLogMessage": true
|
|
},
|
|
"targets": [
|
|
{
|
|
"expr": "{service_name=~\"messenger-api|messenger-worker\"}",
|
|
"refId": "A"
|
|
}
|
|
],
|
|
"title": "API / worker logs",
|
|
"type": "logs"
|
|
},
|
|
{
|
|
"datasource": { "type": "tempo", "uid": "tempo" },
|
|
"gridPos": { "h": 8, "w": 12, "x": 12, "y": 16 },
|
|
"id": 7,
|
|
"targets": [
|
|
{
|
|
"queryType": "traceqlSearch",
|
|
"limit": 20,
|
|
"tableType": "traces",
|
|
"filters": [
|
|
{
|
|
"id": "service-name",
|
|
"operator": "=",
|
|
"scope": "resource",
|
|
"tag": "service.name",
|
|
"value": ["messenger-api", "messenger-worker"],
|
|
"valueType": "string"
|
|
}
|
|
],
|
|
"refId": "A"
|
|
}
|
|
],
|
|
"title": "Recent traces",
|
|
"type": "traces"
|
|
}
|
|
],
|
|
"refresh": "10s",
|
|
"schemaVersion": 39,
|
|
"tags": ["messenger", "lab6"],
|
|
"templating": { "list": [] },
|
|
"time": { "from": "now-15m", "to": "now" },
|
|
"timezone": "browser",
|
|
"title": "Messenger lab6 observability",
|
|
"uid": "messenger-lab6",
|
|
"version": 1
|
|
}
|