This repository was archived by the owner on Nov 24, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ import (
2020 "strings"
2121 "time"
2222
23+ "github.com/prometheus/client_golang/prometheus"
24+
2325 "github.com/pingcap/dm/dm/config"
2426 "github.com/pingcap/dm/dm/pb"
2527 "github.com/pingcap/dm/dm/unit"
@@ -219,6 +221,7 @@ func (m *Dumpling) constructArgs() (*export.Config, error) {
219221 dumpConfig .CompleteInsert = true // always keep column name in `INSERT INTO` statements.
220222 dumpConfig .Logger = m .logger .Logger
221223 dumpConfig .NoViews = false
224+ dumpConfig .Labels = prometheus.Labels {"task" : cfg .Name }
222225
223226 if cfg .Threads > 0 {
224227 dumpConfig .Threads = cfg .Threads
Original file line number Diff line number Diff line change 1414package dumpling
1515
1616import (
17+ "github.com/pingcap/dumpling/v4/export"
1718 "github.com/prometheus/client_golang/prometheus"
1819
1920 "github.com/pingcap/dm/pkg/metricsproxy"
3334// RegisterMetrics registers metrics.
3435func RegisterMetrics (registry * prometheus.Registry ) {
3536 registry .MustRegister (dumplingExitWithErrorCounter )
37+ export .RegisterMetrics (registry )
3638}
3739
3840func (m * Dumpling ) removeLabelValuesWithTaskInMetrics (task string ) {
3941 dumplingExitWithErrorCounter .DeleteAllAboutLabels (prometheus.Labels {"task" : task })
42+ export .RemoveLabelValuesWithTaskInMetrics (prometheus.Labels {"task" : task })
4043}
You can’t perform that action at this time.
0 commit comments