diff --git a/cmd/init.sh b/cmd/init.sh index 82ef33af..37c2fddd 100644 --- a/cmd/init.sh +++ b/cmd/init.sh @@ -50,12 +50,16 @@ else fi # TiDB dashboard -cp /tmp/tidb.json $GF_PROVISIONING_PATH/dashboards +cp /tmp/tidb*.json $GF_PROVISIONING_PATH/dashboards sed -i 's/Test-Cluster-TiDB/'$TIDB_CLUSTER_NAME'-TiDB/g' $GF_PROVISIONING_PATH/dashboards/tidb.json +sed -i 's/Test-Cluster-TiDB/'$TIDB_CLUSTER_NAME'-TiDB/g' $GF_PROVISIONING_PATH/dashboards/tidb_runtime.json +sed -i 's/Test-Cluster-TiDB/'$TIDB_CLUSTER_NAME'-TiDB/g' $GF_PROVISIONING_PATH/dashboards/tidb_resource_control.json # Overview dashboard cp /tmp/overview.json $GF_PROVISIONING_PATH/dashboards +cp /tmp/performance_overview.json $GF_PROVISIONING_PATH/dashboards sed -i 's/Test-Cluster-Overview/'$TIDB_CLUSTER_NAME'-Overview/g' $GF_PROVISIONING_PATH/dashboards/overview.json +sed -i 's/Test-Cluster-Performance-Overview/'$TIDB_CLUSTER_NAME'-Performance-Overview/g' $GF_PROVISIONING_PATH/dashboards/performance_overview.json # PD dashboard cp /tmp/pd.json $GF_PROVISIONING_PATH/dashboards diff --git a/pkg/operator/dashboards.go b/pkg/operator/dashboards.go index 54862773..50e926a1 100644 --- a/pkg/operator/dashboards.go +++ b/pkg/operator/dashboards.go @@ -23,7 +23,10 @@ var ( dashboards = map[string]string{ "binlog.json": "Test-Cluster-Binlog", "tidb.json": "Test-Cluster-TiDB", + "tidb_resource_control.json": "Test-Cluster-TiDB-Resource-Control", + "tidb_runtime.json": "Test-Cluster-TiDB-Runtime", "overview.json": "Test-Cluster-Overview", + "performance_overview.json": "Test-Cluster-Performance-Overview", "tikv_details.json": "Test-Cluster-TiKV-Details", "tikv_summary.json": "Test-Cluster-TiKV-Summary", "tikv_trouble_shooting.json": "Test-Cluster-TiKV-Trouble-Shooting", diff --git a/platform-monitoring/operator/init.sh b/platform-monitoring/operator/init.sh index 6d999308..3ee8ae05 100755 --- a/platform-monitoring/operator/init.sh +++ b/platform-monitoring/operator/init.sh @@ -50,13 +50,17 @@ else fi # TiDB dashboard -cp /tmp/tidb.json $GF_PROVISIONING_PATH/dashboards +cp /tmp/tidb*.json $GF_PROVISIONING_PATH/dashboards sed -i 's/Test-Cluster-TiDB/Cluster-TiDB/g' $GF_PROVISIONING_PATH/dashboards/tidb.json +sed -i 's/Test-Cluster-TiDB/Cluster-TiDB/g' $GF_PROVISIONING_PATH/dashboards/tidb_runtime.json +sed -i 's/Test-Cluster-TiDB/Cluster-TiDB/g' $GF_PROVISIONING_PATH/dashboards/tidb_resource_control.json sed -i 's/label_values(pd_cluster_status, tidb_cluster)/label_values(tidb_server_connections, tidb_cluster)/g' $GF_PROVISIONING_PATH/dashboards/tidb.json # Overview dashboard cp /tmp/overview.json $GF_PROVISIONING_PATH/dashboards +cp /tmp/performance_overview.json $GF_PROVISIONING_PATH/dashboards sed -i 's/Test-Cluster-Overview/Cluster-Overview/g' $GF_PROVISIONING_PATH/dashboards/overview.json +sed -i 's/Test-Cluster-Performance-Overview/Cluster-Performance-Overview/g' $GF_PROVISIONING_PATH/dashboards/performance_overview.json sed -i 's/label_values(pd_cluster_status, tidb_cluster)/label_values(process_start_time_seconds, tidb_cluster)/g' $GF_PROVISIONING_PATH/dashboards/overview.json # PD dashboard