From 8a0a9527f4fa47a1f02cd6eed7f2cb54d77e5b1a Mon Sep 17 00:00:00 2001 From: baurine <2008.hbl@gmail.com> Date: Wed, 25 Sep 2024 07:45:29 +0000 Subject: [PATCH 1/2] chore(dashboard): update TiDB Dashboard to v7.5.4-ec6d9999a Signed-off-by: baurine <2008.hbl@gmail.com> --- go.mod | 2 +- go.sum | 4 ++-- scripts/dashboard-version | 2 +- tests/integrations/client/go.mod | 2 +- tests/integrations/client/go.sum | 4 ++-- tests/integrations/mcs/go.mod | 2 +- tests/integrations/mcs/go.sum | 4 ++-- tests/integrations/tso/go.mod | 2 +- tests/integrations/tso/go.sum | 4 ++-- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index 96cc675d564..907cf7e986f 100644 --- a/go.mod +++ b/go.mod @@ -42,7 +42,7 @@ require ( github.com/pingcap/kvproto v0.0.0-20230920042517-db656f45023b github.com/pingcap/log v1.1.1-0.20221110025148-ca232912c9f3 github.com/pingcap/sysutil v1.0.1-0.20230407040306-fb007c5aff21 - github.com/pingcap/tidb-dashboard v0.0.0-20240219055240-43fe8dac5770 + github.com/pingcap/tidb-dashboard v0.0.0-20240925072858-ec6d9999ae7e github.com/prometheus/client_golang v1.19.0 github.com/prometheus/common v0.48.0 github.com/sasha-s/go-deadlock v0.2.0 diff --git a/go.sum b/go.sum index 513e5ce008d..6f54e25b3ac 100644 --- a/go.sum +++ b/go.sum @@ -435,8 +435,8 @@ github.com/pingcap/log v1.1.1-0.20221110025148-ca232912c9f3 h1:HR/ylkkLmGdSSDaD8 github.com/pingcap/log v1.1.1-0.20221110025148-ca232912c9f3/go.mod h1:DWQW5jICDR7UJh4HtxXSM20Churx4CQL0fwL/SoOSA4= github.com/pingcap/sysutil v1.0.1-0.20230407040306-fb007c5aff21 h1:QV6jqlfOkh8hqvEAgwBZa+4bSgO0EeKC7s5c6Luam2I= github.com/pingcap/sysutil v1.0.1-0.20230407040306-fb007c5aff21/go.mod h1:QYnjfA95ZaMefyl1NO8oPtKeb8pYUdnDVhQgf+qdpjM= -github.com/pingcap/tidb-dashboard v0.0.0-20240219055240-43fe8dac5770 h1:RVEo1R18NiNjinSNIpbRU0Lhi7d+o6IJzsiHs6CgdA8= -github.com/pingcap/tidb-dashboard v0.0.0-20240219055240-43fe8dac5770/go.mod h1:ucZBRz52icb23T/5Z4CsuUHmarYiin7p2MeiVBe+o8c= +github.com/pingcap/tidb-dashboard v0.0.0-20240925072858-ec6d9999ae7e h1:L4sz5SKaujJS5TpzySWAuLWO4IxialUk/Z+HlxhNAl8= +github.com/pingcap/tidb-dashboard v0.0.0-20240925072858-ec6d9999ae7e/go.mod h1:ucZBRz52icb23T/5Z4CsuUHmarYiin7p2MeiVBe+o8c= github.com/pingcap/tipb v0.0.0-20220718022156-3e2483c20a9e h1:FBaTXU8C3xgt/drM58VHxojHo/QoG1oPsgWTGvaSpO4= github.com/pingcap/tipb v0.0.0-20220718022156-3e2483c20a9e/go.mod h1:A7mrd7WHBl1o63LE2bIBGEJMTNWXqhgmYiOvMLxozfs= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= diff --git a/scripts/dashboard-version b/scripts/dashboard-version index 5bc8fb0076f..5ca2b86a509 100644 --- a/scripts/dashboard-version +++ b/scripts/dashboard-version @@ -1,3 +1,3 @@ # This file is updated by running scripts/update-dashboard.sh # Don't edit it manullay -7.5.1-43fe8dac +7.5.4-ec6d9999a diff --git a/tests/integrations/client/go.mod b/tests/integrations/client/go.mod index 92667381572..70687a3bbe0 100644 --- a/tests/integrations/client/go.mod +++ b/tests/integrations/client/go.mod @@ -122,7 +122,7 @@ require ( github.com/pingcap/errcode v0.3.0 // indirect github.com/pingcap/errors v0.11.5-0.20211224045212-9687c2b0f87c // indirect github.com/pingcap/sysutil v1.0.1-0.20230407040306-fb007c5aff21 // indirect - github.com/pingcap/tidb-dashboard v0.0.0-20240219055240-43fe8dac5770 // indirect + github.com/pingcap/tidb-dashboard v0.0.0-20240925072858-ec6d9999ae7e // indirect github.com/pingcap/tipb v0.0.0-20220718022156-3e2483c20a9e // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect diff --git a/tests/integrations/client/go.sum b/tests/integrations/client/go.sum index 82bdb827182..4043f8bddf7 100644 --- a/tests/integrations/client/go.sum +++ b/tests/integrations/client/go.sum @@ -399,8 +399,8 @@ github.com/pingcap/log v1.1.1-0.20221110025148-ca232912c9f3 h1:HR/ylkkLmGdSSDaD8 github.com/pingcap/log v1.1.1-0.20221110025148-ca232912c9f3/go.mod h1:DWQW5jICDR7UJh4HtxXSM20Churx4CQL0fwL/SoOSA4= github.com/pingcap/sysutil v1.0.1-0.20230407040306-fb007c5aff21 h1:QV6jqlfOkh8hqvEAgwBZa+4bSgO0EeKC7s5c6Luam2I= github.com/pingcap/sysutil v1.0.1-0.20230407040306-fb007c5aff21/go.mod h1:QYnjfA95ZaMefyl1NO8oPtKeb8pYUdnDVhQgf+qdpjM= -github.com/pingcap/tidb-dashboard v0.0.0-20240219055240-43fe8dac5770 h1:RVEo1R18NiNjinSNIpbRU0Lhi7d+o6IJzsiHs6CgdA8= -github.com/pingcap/tidb-dashboard v0.0.0-20240219055240-43fe8dac5770/go.mod h1:ucZBRz52icb23T/5Z4CsuUHmarYiin7p2MeiVBe+o8c= +github.com/pingcap/tidb-dashboard v0.0.0-20240925072858-ec6d9999ae7e h1:L4sz5SKaujJS5TpzySWAuLWO4IxialUk/Z+HlxhNAl8= +github.com/pingcap/tidb-dashboard v0.0.0-20240925072858-ec6d9999ae7e/go.mod h1:ucZBRz52icb23T/5Z4CsuUHmarYiin7p2MeiVBe+o8c= github.com/pingcap/tipb v0.0.0-20220718022156-3e2483c20a9e h1:FBaTXU8C3xgt/drM58VHxojHo/QoG1oPsgWTGvaSpO4= github.com/pingcap/tipb v0.0.0-20220718022156-3e2483c20a9e/go.mod h1:A7mrd7WHBl1o63LE2bIBGEJMTNWXqhgmYiOvMLxozfs= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= diff --git a/tests/integrations/mcs/go.mod b/tests/integrations/mcs/go.mod index c69bd66786a..62b42b7e47d 100644 --- a/tests/integrations/mcs/go.mod +++ b/tests/integrations/mcs/go.mod @@ -122,7 +122,7 @@ require ( github.com/pingcap/errcode v0.3.0 // indirect github.com/pingcap/errors v0.11.5-0.20211224045212-9687c2b0f87c // indirect github.com/pingcap/sysutil v1.0.1-0.20230407040306-fb007c5aff21 // indirect - github.com/pingcap/tidb-dashboard v0.0.0-20240219055240-43fe8dac5770 // indirect + github.com/pingcap/tidb-dashboard v0.0.0-20240925072858-ec6d9999ae7e // indirect github.com/pingcap/tipb v0.0.0-20220718022156-3e2483c20a9e // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect diff --git a/tests/integrations/mcs/go.sum b/tests/integrations/mcs/go.sum index 263fbadbec3..be37aae1c6d 100644 --- a/tests/integrations/mcs/go.sum +++ b/tests/integrations/mcs/go.sum @@ -403,8 +403,8 @@ github.com/pingcap/log v1.1.1-0.20221110025148-ca232912c9f3 h1:HR/ylkkLmGdSSDaD8 github.com/pingcap/log v1.1.1-0.20221110025148-ca232912c9f3/go.mod h1:DWQW5jICDR7UJh4HtxXSM20Churx4CQL0fwL/SoOSA4= github.com/pingcap/sysutil v1.0.1-0.20230407040306-fb007c5aff21 h1:QV6jqlfOkh8hqvEAgwBZa+4bSgO0EeKC7s5c6Luam2I= github.com/pingcap/sysutil v1.0.1-0.20230407040306-fb007c5aff21/go.mod h1:QYnjfA95ZaMefyl1NO8oPtKeb8pYUdnDVhQgf+qdpjM= -github.com/pingcap/tidb-dashboard v0.0.0-20240219055240-43fe8dac5770 h1:RVEo1R18NiNjinSNIpbRU0Lhi7d+o6IJzsiHs6CgdA8= -github.com/pingcap/tidb-dashboard v0.0.0-20240219055240-43fe8dac5770/go.mod h1:ucZBRz52icb23T/5Z4CsuUHmarYiin7p2MeiVBe+o8c= +github.com/pingcap/tidb-dashboard v0.0.0-20240925072858-ec6d9999ae7e h1:L4sz5SKaujJS5TpzySWAuLWO4IxialUk/Z+HlxhNAl8= +github.com/pingcap/tidb-dashboard v0.0.0-20240925072858-ec6d9999ae7e/go.mod h1:ucZBRz52icb23T/5Z4CsuUHmarYiin7p2MeiVBe+o8c= github.com/pingcap/tipb v0.0.0-20220718022156-3e2483c20a9e h1:FBaTXU8C3xgt/drM58VHxojHo/QoG1oPsgWTGvaSpO4= github.com/pingcap/tipb v0.0.0-20220718022156-3e2483c20a9e/go.mod h1:A7mrd7WHBl1o63LE2bIBGEJMTNWXqhgmYiOvMLxozfs= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= diff --git a/tests/integrations/tso/go.mod b/tests/integrations/tso/go.mod index 9097276a5db..223250f5788 100644 --- a/tests/integrations/tso/go.mod +++ b/tests/integrations/tso/go.mod @@ -120,7 +120,7 @@ require ( github.com/pingcap/errors v0.11.5-0.20211224045212-9687c2b0f87c // indirect github.com/pingcap/log v1.1.1-0.20221110025148-ca232912c9f3 // indirect github.com/pingcap/sysutil v1.0.1-0.20230407040306-fb007c5aff21 // indirect - github.com/pingcap/tidb-dashboard v0.0.0-20240219055240-43fe8dac5770 // indirect + github.com/pingcap/tidb-dashboard v0.0.0-20240925072858-ec6d9999ae7e // indirect github.com/pingcap/tipb v0.0.0-20220718022156-3e2483c20a9e // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect diff --git a/tests/integrations/tso/go.sum b/tests/integrations/tso/go.sum index 0025721ea9b..1728e4dd5e5 100644 --- a/tests/integrations/tso/go.sum +++ b/tests/integrations/tso/go.sum @@ -397,8 +397,8 @@ github.com/pingcap/log v1.1.1-0.20221110025148-ca232912c9f3 h1:HR/ylkkLmGdSSDaD8 github.com/pingcap/log v1.1.1-0.20221110025148-ca232912c9f3/go.mod h1:DWQW5jICDR7UJh4HtxXSM20Churx4CQL0fwL/SoOSA4= github.com/pingcap/sysutil v1.0.1-0.20230407040306-fb007c5aff21 h1:QV6jqlfOkh8hqvEAgwBZa+4bSgO0EeKC7s5c6Luam2I= github.com/pingcap/sysutil v1.0.1-0.20230407040306-fb007c5aff21/go.mod h1:QYnjfA95ZaMefyl1NO8oPtKeb8pYUdnDVhQgf+qdpjM= -github.com/pingcap/tidb-dashboard v0.0.0-20240219055240-43fe8dac5770 h1:RVEo1R18NiNjinSNIpbRU0Lhi7d+o6IJzsiHs6CgdA8= -github.com/pingcap/tidb-dashboard v0.0.0-20240219055240-43fe8dac5770/go.mod h1:ucZBRz52icb23T/5Z4CsuUHmarYiin7p2MeiVBe+o8c= +github.com/pingcap/tidb-dashboard v0.0.0-20240925072858-ec6d9999ae7e h1:L4sz5SKaujJS5TpzySWAuLWO4IxialUk/Z+HlxhNAl8= +github.com/pingcap/tidb-dashboard v0.0.0-20240925072858-ec6d9999ae7e/go.mod h1:ucZBRz52icb23T/5Z4CsuUHmarYiin7p2MeiVBe+o8c= github.com/pingcap/tipb v0.0.0-20220718022156-3e2483c20a9e h1:FBaTXU8C3xgt/drM58VHxojHo/QoG1oPsgWTGvaSpO4= github.com/pingcap/tipb v0.0.0-20220718022156-3e2483c20a9e/go.mod h1:A7mrd7WHBl1o63LE2bIBGEJMTNWXqhgmYiOvMLxozfs= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= From 9a2853b2bcd73e6be8f8602f6940328d4a3ec5b8 Mon Sep 17 00:00:00 2001 From: mornyx Date: Wed, 25 Sep 2024 15:58:47 +0800 Subject: [PATCH 2/2] add env config Signed-off-by: mornyx --- pkg/dashboard/adapter/config.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkg/dashboard/adapter/config.go b/pkg/dashboard/adapter/config.go index 348b146c854..afa7386d93d 100644 --- a/pkg/dashboard/adapter/config.go +++ b/pkg/dashboard/adapter/config.go @@ -15,11 +15,18 @@ package adapter import ( + "os" + "strings" + "github.com/pingcap/tidb-dashboard/pkg/config" "github.com/tikv/pd/server" ) +const ( + envTidbDashboardDisableCustomPromAddr = "TIDB_DASHBOARD_DISABLE_CUSTOM_PROM_ADDR" +) + // GenDashboardConfig generates a configuration for Dashboard Server. func GenDashboardConfig(srv *server.Server) (*config.Config, error) { cfg := srv.GetConfig() @@ -47,5 +54,11 @@ func GenDashboardConfig(srv *server.Server) (*config.Config, error) { dashboardCfg.NormalizePublicPathPrefix() + // Allow setting DisableCustomPromAddr via environment variable. + disableCustomPromAddr := strings.ToLower(os.Getenv(envTidbDashboardDisableCustomPromAddr)) + if disableCustomPromAddr == "true" || disableCustomPromAddr == "1" { + dashboardCfg.DisableCustomPromAddr = true + } + return dashboardCfg, nil }