From 47763a335a4f35166c9198d485a7f6579b50704a Mon Sep 17 00:00:00 2001 From: ehco1996 Date: Wed, 19 Jan 2022 15:07:21 +0800 Subject: [PATCH 1/4] grafana(dm): fix grafana expr --- dm/dm/dm-ansible/scripts/DM-Monitor-Professional.json | 8 ++++---- dm/dm/dm-ansible/scripts/DM-Monitor-Standard.json | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dm/dm/dm-ansible/scripts/DM-Monitor-Professional.json b/dm/dm/dm-ansible/scripts/DM-Monitor-Professional.json index a7c0d6006cf..d1a2abf95db 100644 --- a/dm/dm/dm-ansible/scripts/DM-Monitor-Professional.json +++ b/dm/dm/dm-ansible/scripts/DM-Monitor-Professional.json @@ -3059,7 +3059,7 @@ "steppedLine": false, "targets": [ { - "expr": "dm_syncer_binlog_file{source_id=~\"$source\", task=~\"$task\", node=\"master\"} - ON( task,source_id) dm_syncer_binlog_file{source_id=~\"$source\", task=~\"$task\", node=\"syncer\"}", + "expr": "dm_syncer_binlog_file{source_id=~\"$source\", task=~\"$task\", node=\"master\"} - ON(task,source_id) dm_syncer_binlog_file{source_id=~\"$source\", task=~\"$task\", node=\"syncer\"}", "format": "time_series", "hide": false, "interval": "$interval", @@ -3716,12 +3716,12 @@ "steppedLine": false, "targets": [ { - "expr": "dm_relay_binlog_file{instance=~\"$instance\", node=\"relay\"} - ON(instance, task) dm_syncer_binlog_file{instance=~\"$instance\", task=~\"$task\", node=\"syncer\"}", + "expr": "dm_relay_binlog_file{instance=~\"$instance\", node=\"relay\"} - ON(instance) dm_syncer_binlog_file{instance=~\"$instance\", task=~\"$task\", node=\"syncer\"}", "format": "time_series", "hide": false, "interval": "$interval", "intervalFactor": 2, - "legendFormat": "{{task}} - {{instance}}", + "legendFormat": "{{{instance}}", "refId": "B" } ], @@ -5088,7 +5088,7 @@ "steppedLine": false, "targets": [ { - "expr": "dm_relay_binlog_file{instance=~\"$instance\", node=\"master\"} - ON(instance, job) dm_relay_binlog_file{instance=~\"$instance\", node=\"relay\"}", + "expr": "dm_relay_binlog_file{instance=~\"$instance\", node=\"master\"} - ON(instance) dm_relay_binlog_file{instance=~\"$instance\", node=\"relay\"}", "format": "time_series", "hide": false, "interval": "$interval", diff --git a/dm/dm/dm-ansible/scripts/DM-Monitor-Standard.json b/dm/dm/dm-ansible/scripts/DM-Monitor-Standard.json index 7b8bf19e037..e29a8005e40 100644 --- a/dm/dm/dm-ansible/scripts/DM-Monitor-Standard.json +++ b/dm/dm/dm-ansible/scripts/DM-Monitor-Standard.json @@ -450,7 +450,7 @@ "targets": [ { "exemplar": true, - "expr": "histogram_quantile(0.90, sum(rate(dm_syncer_replication_lag_bucket{instance=~\"$instance\",task=~\"$task\"}[$interval])) by (le,instance,task))", + "expr": "histogram_quantile(0.90, sum(rate(dm_syncer_replication_lag_bucket{source_id=~\"$source\",task=~\"$task\"}[$interval])) by (le,task,source_id))", "hide": false, "interval": "", "legendFormat": "{{task}} - {{source_id}} - 90", @@ -458,7 +458,7 @@ }, { "exemplar": true, - "expr": "histogram_quantile(0.95,\nsum(rate(dm_syncer_replication_lag_bucket{instance=~\"$instance\",task=~\"$task\"}[$interval])) by (le,instance,task))", + "expr": "histogram_quantile(0.95,\nsum(rate(dm_syncer_replication_lag_bucket{source_id=~\"$source\",task=~\"$task\"}[$interval])) by (le,task,source_id))", "hide": false, "interval": "", "legendFormat": "{{task}} - {{source_id}} - 95", @@ -466,7 +466,7 @@ }, { "exemplar": true, - "expr": "histogram_quantile(0.99,\nsum(rate(dm_syncer_replication_lag_bucket{instance=~\"$instance\",task=~\"$task\"}[$interval])) by (le,instance,task))", + "expr": "histogram_quantile(0.99,\nsum(rate(dm_syncer_replication_lag_bucket{source_id=~\"$source\",task=~\"$task\"}[$interval])) by (le,task,source_id))", "hide": false, "interval": "", "legendFormat": "{{task}} - {{source_id}} - 99", From 40b123b3da2621cf57ca29c131008d418e7a6454 Mon Sep 17 00:00:00 2001 From: ehco1996 Date: Mon, 24 Jan 2022 10:47:29 +0800 Subject: [PATCH 2/4] address commnet --- dm/dm/dm-ansible/scripts/DM-Monitor-Professional.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dm/dm/dm-ansible/scripts/DM-Monitor-Professional.json b/dm/dm/dm-ansible/scripts/DM-Monitor-Professional.json index d1a2abf95db..aac328f44c8 100644 --- a/dm/dm/dm-ansible/scripts/DM-Monitor-Professional.json +++ b/dm/dm/dm-ansible/scripts/DM-Monitor-Professional.json @@ -3721,7 +3721,7 @@ "hide": false, "interval": "$interval", "intervalFactor": 2, - "legendFormat": "{{{instance}}", + "legendFormat": "{{instance}}", "refId": "B" } ], From 9fbb8251a74c28636b7e4f1fedd5144de5a54480 Mon Sep 17 00:00:00 2001 From: ehco1996 Date: Mon, 24 Jan 2022 11:42:58 +0800 Subject: [PATCH 3/4] add group right for syncer binlog file metrci --- dm/dm/dm-ansible/scripts/DM-Monitor-Professional.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dm/dm/dm-ansible/scripts/DM-Monitor-Professional.json b/dm/dm/dm-ansible/scripts/DM-Monitor-Professional.json index aac328f44c8..4ce06a547ff 100644 --- a/dm/dm/dm-ansible/scripts/DM-Monitor-Professional.json +++ b/dm/dm/dm-ansible/scripts/DM-Monitor-Professional.json @@ -3716,12 +3716,12 @@ "steppedLine": false, "targets": [ { - "expr": "dm_relay_binlog_file{instance=~\"$instance\", node=\"relay\"} - ON(instance) dm_syncer_binlog_file{instance=~\"$instance\", task=~\"$task\", node=\"syncer\"}", + "expr": "dm_relay_binlog_file{instance=~\"$instance\", node=\"relay\"} - ON(instance) group_right dm_syncer_binlog_file{instance=~\"$instance\", task=~\"$task\", node=\"syncer\"}", "format": "time_series", "hide": false, "interval": "$interval", "intervalFactor": 2, - "legendFormat": "{{instance}}", + "legendFormat": "{{instance}} - {{ task }}", "refId": "B" } ], From b893ca33c730ad72f920e517e99951d1a16fcfbb Mon Sep 17 00:00:00 2001 From: ehco1996 Date: Mon, 24 Jan 2022 11:45:08 +0800 Subject: [PATCH 4/4] fix whitespace --- dm/dm/dm-ansible/scripts/DM-Monitor-Professional.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dm/dm/dm-ansible/scripts/DM-Monitor-Professional.json b/dm/dm/dm-ansible/scripts/DM-Monitor-Professional.json index 4ce06a547ff..d05a6730bc0 100644 --- a/dm/dm/dm-ansible/scripts/DM-Monitor-Professional.json +++ b/dm/dm/dm-ansible/scripts/DM-Monitor-Professional.json @@ -3721,7 +3721,7 @@ "hide": false, "interval": "$interval", "intervalFactor": 2, - "legendFormat": "{{instance}} - {{ task }}", + "legendFormat": "{{instance}} - {{task}}", "refId": "B" } ],