From 0856a85b0551d331f6ba26d7dadcf6812e017f53 Mon Sep 17 00:00:00 2001 From: djshow832 <873581766@qq.com> Date: Tue, 19 Dec 2023 10:14:53 +0800 Subject: [PATCH] fix promQL --- pkg/metrics/grafana/tiproxy_summary.json | 2 +- pkg/metrics/grafana/tiproxy_summary.jsonnet | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/metrics/grafana/tiproxy_summary.json b/pkg/metrics/grafana/tiproxy_summary.json index 6490e515..8a61640b 100644 --- a/pkg/metrics/grafana/tiproxy_summary.json +++ b/pkg/metrics/grafana/tiproxy_summary.json @@ -439,7 +439,7 @@ "steppedLine": false, "targets": [ { - "expr": "sum(increase(tiproxy_server_create_connection_total{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\"}[1m]))", + "expr": "sum(increase(tiproxy_server_create_connection_total{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\"}[1m])) by (instance)", "format": "time_series", "intervalFactor": 2, "legendFormat": "{{instance}}", diff --git a/pkg/metrics/grafana/tiproxy_summary.jsonnet b/pkg/metrics/grafana/tiproxy_summary.jsonnet index b7ed5959..bcc76566 100644 --- a/pkg/metrics/grafana/tiproxy_summary.jsonnet +++ b/pkg/metrics/grafana/tiproxy_summary.jsonnet @@ -115,7 +115,7 @@ local createConnP = graphPanel.new( ) .addTarget( prometheus.target( - 'sum(increase(tiproxy_server_create_connection_total{k8s_cluster="$k8s_cluster", tidb_cluster="$tidb_cluster", instance=~"$instance"}[1m]))', + 'sum(increase(tiproxy_server_create_connection_total{k8s_cluster="$k8s_cluster", tidb_cluster="$tidb_cluster", instance=~"$instance"}[1m])) by (instance)', legendFormat='{{instance}}', ) );