280 lines
8.1 KiB
JSON
280 lines
8.1 KiB
JSON
{
|
|
"annotations": { "list": [] },
|
|
"editable": true,
|
|
"fiscalYearStartMonth": 0,
|
|
"graphTooltip": 1,
|
|
"id": null,
|
|
"links": [],
|
|
"panels": [
|
|
{
|
|
"title": "API RPS",
|
|
"type": "timeseries",
|
|
"gridPos": { "h": 8, "w": 8, "x": 0, "y": 0 },
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"targets": [
|
|
{
|
|
"expr": "sum(rate(messenger_http_requests_total{http_route!~\"/health/.*\"}[1m]))",
|
|
"legendFormat": "rps",
|
|
"refId": "A"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "reqps",
|
|
"custom": { "drawStyle": "line", "fillOpacity": 10 }
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"title": "API error ratio (5xx / all business)",
|
|
"type": "timeseries",
|
|
"gridPos": { "h": 8, "w": 8, "x": 8, "y": 0 },
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"targets": [
|
|
{
|
|
"expr": "messenger:http_error_ratio:5m",
|
|
"legendFormat": "5m error ratio",
|
|
"refId": "A"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "percentunit",
|
|
"custom": { "drawStyle": "line", "fillOpacity": 10 }
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"title": "API latency p50/p95/p99",
|
|
"type": "timeseries",
|
|
"gridPos": { "h": 8, "w": 8, "x": 16, "y": 0 },
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"targets": [
|
|
{
|
|
"expr": "histogram_quantile(0.50, sum(rate(messenger_http_duration_seconds_bucket{http_route!~\"/health/.*\"}[5m])) by (le))",
|
|
"legendFormat": "p50",
|
|
"refId": "A"
|
|
},
|
|
{
|
|
"expr": "histogram_quantile(0.95, sum(rate(messenger_http_duration_seconds_bucket{http_route!~\"/health/.*\"}[5m])) by (le))",
|
|
"legendFormat": "p95",
|
|
"refId": "B"
|
|
},
|
|
{
|
|
"expr": "histogram_quantile(0.99, sum(rate(messenger_http_duration_seconds_bucket{http_route!~\"/health/.*\"}[5m])) by (le))",
|
|
"legendFormat": "p99",
|
|
"refId": "C"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "s",
|
|
"custom": { "drawStyle": "line", "fillOpacity": 5 }
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"title": "Jobs ready / failed / retry",
|
|
"type": "timeseries",
|
|
"gridPos": { "h": 8, "w": 8, "x": 0, "y": 8 },
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"targets": [
|
|
{
|
|
"expr": "sum by (job_outcome) (rate(messenger_jobs_processed_total[1m]))",
|
|
"legendFormat": "{{job_outcome}}",
|
|
"refId": "A"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "ops",
|
|
"custom": { "drawStyle": "line", "fillOpacity": 10 }
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"title": "Job duration p50/p95/p99",
|
|
"type": "timeseries",
|
|
"gridPos": { "h": 8, "w": 8, "x": 8, "y": 8 },
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"targets": [
|
|
{
|
|
"expr": "histogram_quantile(0.50, sum(rate(messenger_jobs_duration_seconds_bucket[5m])) by (le))",
|
|
"legendFormat": "p50",
|
|
"refId": "A"
|
|
},
|
|
{
|
|
"expr": "histogram_quantile(0.95, sum(rate(messenger_jobs_duration_seconds_bucket[5m])) by (le))",
|
|
"legendFormat": "p95",
|
|
"refId": "B"
|
|
},
|
|
{
|
|
"expr": "histogram_quantile(0.99, sum(rate(messenger_jobs_duration_seconds_bucket[5m])) by (le))",
|
|
"legendFormat": "p99",
|
|
"refId": "C"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "s",
|
|
"custom": { "drawStyle": "line", "fillOpacity": 5 }
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"title": "Time to ready p50/p95/p99",
|
|
"type": "timeseries",
|
|
"gridPos": { "h": 8, "w": 8, "x": 16, "y": 8 },
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"targets": [
|
|
{
|
|
"expr": "histogram_quantile(0.50, sum(rate(messenger_attachment_time_to_ready_seconds_bucket[5m])) by (le))",
|
|
"legendFormat": "p50",
|
|
"refId": "A"
|
|
},
|
|
{
|
|
"expr": "histogram_quantile(0.95, sum(rate(messenger_attachment_time_to_ready_seconds_bucket[5m])) by (le))",
|
|
"legendFormat": "p95",
|
|
"refId": "B"
|
|
},
|
|
{
|
|
"expr": "histogram_quantile(0.99, sum(rate(messenger_attachment_time_to_ready_seconds_bucket[5m])) by (le))",
|
|
"legendFormat": "p99",
|
|
"refId": "C"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "s",
|
|
"custom": { "drawStyle": "line", "fillOpacity": 5 }
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"title": "Queue depth",
|
|
"type": "timeseries",
|
|
"gridPos": { "h": 8, "w": 8, "x": 0, "y": 16 },
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"targets": [
|
|
{
|
|
"expr": "messenger_queue_depth{messaging_destination_name=~\"attachments\\\\.process|attachments\\\\.retry\"}",
|
|
"legendFormat": "{{messaging_destination_name}}",
|
|
"refId": "A"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "short",
|
|
"custom": { "drawStyle": "line", "fillOpacity": 10 }
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"title": "Oldest job age",
|
|
"type": "timeseries",
|
|
"gridPos": { "h": 8, "w": 8, "x": 8, "y": 16 },
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"targets": [
|
|
{
|
|
"expr": "max(messenger_queue_oldest_job_age_seconds{messaging_destination_name=\"attachments.process\"})",
|
|
"legendFormat": "oldest age",
|
|
"refId": "A"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "s",
|
|
"custom": { "drawStyle": "line", "fillOpacity": 10 }
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"title": "DB pool used / waiting",
|
|
"type": "timeseries",
|
|
"gridPos": { "h": 8, "w": 8, "x": 16, "y": 16 },
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"targets": [
|
|
{
|
|
"expr": "messenger_db_pool_used_ratio",
|
|
"legendFormat": "used {{service_name}}",
|
|
"refId": "A"
|
|
},
|
|
{
|
|
"expr": "messenger_db_pool_waiting_ratio",
|
|
"legendFormat": "waiting {{service_name}}",
|
|
"refId": "B"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "short",
|
|
"custom": { "drawStyle": "line", "fillOpacity": 5 }
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"title": "Worker busy / capacity",
|
|
"type": "timeseries",
|
|
"gridPos": { "h": 8, "w": 12, "x": 0, "y": 24 },
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"targets": [
|
|
{
|
|
"expr": "messenger_worker_busy_ratio",
|
|
"legendFormat": "busy",
|
|
"refId": "A"
|
|
},
|
|
{
|
|
"expr": "messenger_worker_capacity_ratio",
|
|
"legendFormat": "capacity",
|
|
"refId": "B"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "short",
|
|
"custom": { "drawStyle": "line", "fillOpacity": 5 }
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"title": "Process RSS",
|
|
"type": "timeseries",
|
|
"gridPos": { "h": 8, "w": 12, "x": 12, "y": 24 },
|
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
|
"targets": [
|
|
{
|
|
"expr": "messenger_process_rss_bytes",
|
|
"legendFormat": "{{service_name}}",
|
|
"refId": "A"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "bytes",
|
|
"custom": { "drawStyle": "line", "fillOpacity": 5 }
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"title": "API / worker logs",
|
|
"type": "logs",
|
|
"gridPos": { "h": 10, "w": 24, "x": 0, "y": 32 },
|
|
"datasource": { "type": "loki", "uid": "loki" },
|
|
"targets": [
|
|
{
|
|
"expr": "{service_name=~\"messenger-api|messenger-worker\"}",
|
|
"refId": "A"
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"schemaVersion": 39,
|
|
"tags": ["messenger", "lab6"],
|
|
"templating": { "list": [] },
|
|
"time": { "from": "now-30m", "to": "now" },
|
|
"timezone": "browser",
|
|
"title": "Messenger observability",
|
|
"uid": "messenger-lab6",
|
|
"version": 1
|
|
}
|