This repository was archived by the owner on Nov 24, 2023. It is now read-only.
File tree 2 files changed +6
-0
lines changed
2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ import (
20
20
"strings"
21
21
"time"
22
22
23
+ "github.com/prometheus/client_golang/prometheus"
24
+
23
25
"github.com/pingcap/dm/dm/config"
24
26
"github.com/pingcap/dm/dm/pb"
25
27
"github.com/pingcap/dm/dm/unit"
@@ -219,6 +221,7 @@ func (m *Dumpling) constructArgs() (*export.Config, error) {
219
221
dumpConfig .CompleteInsert = true // always keep column name in `INSERT INTO` statements.
220
222
dumpConfig .Logger = m .logger .Logger
221
223
dumpConfig .NoViews = false
224
+ dumpConfig .Labels = prometheus.Labels {"task" : cfg .Name }
222
225
223
226
if cfg .Threads > 0 {
224
227
dumpConfig .Threads = cfg .Threads
Original file line number Diff line number Diff line change 14
14
package dumpling
15
15
16
16
import (
17
+ "github.com/pingcap/dumpling/v4/export"
17
18
"github.com/prometheus/client_golang/prometheus"
18
19
19
20
"github.com/pingcap/dm/pkg/metricsproxy"
33
34
// RegisterMetrics registers metrics.
34
35
func RegisterMetrics (registry * prometheus.Registry ) {
35
36
registry .MustRegister (dumplingExitWithErrorCounter )
37
+ export .RegisterMetrics (registry )
36
38
}
37
39
38
40
func (m * Dumpling ) removeLabelValuesWithTaskInMetrics (task string ) {
39
41
dumplingExitWithErrorCounter .DeleteAllAboutLabels (prometheus.Labels {"task" : task })
42
+ export .RemoveLabelValuesWithTaskInMetrics (prometheus.Labels {"task" : task })
40
43
}
You can’t perform that action at this time.
0 commit comments