Исправила замечание 2 (согласование UID датасорсов): явно задала UID prometheus/loki/tempo в datasources.yaml и согласовала их во всех ссылках (панели, alert rules, derived fields), плюс тест проверяет существование UID и health=ok у rules
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
"uid": "messenger-lab6",
|
||||
"title": "Messenger — lab6 observability",
|
||||
"schemaVersion": 39,
|
||||
"version": 1,
|
||||
"version": 2,
|
||||
"editable": true,
|
||||
"timezone": "browser",
|
||||
"time": {"from": "now-30m", "to": "now"},
|
||||
@@ -23,8 +23,9 @@
|
||||
"type": "timeseries",
|
||||
"title": "API RPS (total)",
|
||||
"gridPos": {"x": 0, "y": 0, "w": 8, "h": 8},
|
||||
"datasource": {"type": "prometheus", "uid": "prometheus"},
|
||||
"targets": [
|
||||
{"expr": "sum(rate(http_requests_total[1m]))", "legendFormat": "rps"}
|
||||
{"expr": "sum(rate(http_requests_total[1m]))", "legendFormat": "rps", "refId": "A"}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -32,8 +33,9 @@
|
||||
"type": "timeseries",
|
||||
"title": "API error ratio (5xx / total)",
|
||||
"gridPos": {"x": 8, "y": 0, "w": 8, "h": 8},
|
||||
"datasource": {"type": "prometheus", "uid": "prometheus"},
|
||||
"targets": [
|
||||
{"expr": "sum(rate(http_requests_total{http_status_class=\"5xx\"}[5m])) / clamp_min(sum(rate(http_requests_total[5m])), 1e-9)", "legendFormat": "ratio"}
|
||||
{"expr": "sum(rate(http_requests_total{http_status_class=\"5xx\"}[5m])) / clamp_min(sum(rate(http_requests_total[5m])), 1e-9)", "legendFormat": "ratio", "refId": "A"}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -41,10 +43,11 @@
|
||||
"type": "timeseries",
|
||||
"title": "HTTP latency p50/p95/p99 (s)",
|
||||
"gridPos": {"x": 16, "y": 0, "w": 8, "h": 8},
|
||||
"datasource": {"type": "prometheus", "uid": "prometheus"},
|
||||
"targets": [
|
||||
{"expr": "histogram_quantile(0.50, sum by (le) (rate(http_request_duration_seconds_bucket[5m])))", "legendFormat": "p50"},
|
||||
{"expr": "histogram_quantile(0.95, sum by (le) (rate(http_request_duration_seconds_bucket[5m])))", "legendFormat": "p95"},
|
||||
{"expr": "histogram_quantile(0.99, sum by (le) (rate(http_request_duration_seconds_bucket[5m])))", "legendFormat": "p99"}
|
||||
{"expr": "histogram_quantile(0.50, sum by (le) (rate(http_request_duration_seconds_bucket[5m])))", "legendFormat": "p50", "refId": "A"},
|
||||
{"expr": "histogram_quantile(0.95, sum by (le) (rate(http_request_duration_seconds_bucket[5m])))", "legendFormat": "p95", "refId": "B"},
|
||||
{"expr": "histogram_quantile(0.99, sum by (le) (rate(http_request_duration_seconds_bucket[5m])))", "legendFormat": "p99", "refId": "C"}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -52,8 +55,9 @@
|
||||
"type": "timeseries",
|
||||
"title": "Jobs processed by outcome",
|
||||
"gridPos": {"x": 0, "y": 8, "w": 12, "h": 8},
|
||||
"datasource": {"type": "prometheus", "uid": "prometheus"},
|
||||
"targets": [
|
||||
{"expr": "sum by (outcome) (rate(jobs_processed_total[1m]))", "legendFormat": "{{outcome}}"}
|
||||
{"expr": "sum by (outcome) (rate(jobs_processed_total[1m]))", "legendFormat": "{{outcome}}", "refId": "A"}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -61,8 +65,9 @@
|
||||
"type": "timeseries",
|
||||
"title": "Job duration p95 (s) by outcome",
|
||||
"gridPos": {"x": 12, "y": 8, "w": 12, "h": 8},
|
||||
"datasource": {"type": "prometheus", "uid": "prometheus"},
|
||||
"targets": [
|
||||
{"expr": "histogram_quantile(0.95, sum by (le, outcome) (rate(job_processing_duration_seconds_bucket[5m])))", "legendFormat": "{{outcome}}"}
|
||||
{"expr": "histogram_quantile(0.95, sum by (le, outcome) (rate(job_processing_duration_seconds_bucket[5m])))", "legendFormat": "{{outcome}}", "refId": "A"}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -72,7 +77,7 @@
|
||||
"gridPos": {"x": 0, "y": 16, "w": 24, "h": 10},
|
||||
"datasource": {"type": "loki", "uid": "loki"},
|
||||
"targets": [
|
||||
{"expr": "{service_name=~\"messenger-api|messenger-worker|messenger-outbox\"}"}
|
||||
{"expr": "{service_name=~\"messenger-api|messenger-worker|messenger-outbox\"}", "refId": "A"}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -2,6 +2,7 @@ apiVersion: 1
|
||||
|
||||
datasources:
|
||||
- name: Prometheus
|
||||
uid: prometheus
|
||||
type: prometheus
|
||||
access: proxy
|
||||
url: http://prometheus:9090
|
||||
@@ -9,6 +10,7 @@ datasources:
|
||||
editable: false
|
||||
|
||||
- name: Loki
|
||||
uid: loki
|
||||
type: loki
|
||||
access: proxy
|
||||
url: http://loki:3100
|
||||
|
||||
Reference in New Issue
Block a user