Skip to content

Commit 034b0eb

Browse files
committed
use own role to determine self-label
1 parent cadb9d7 commit 034b0eb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

exporter/pbm_collector.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ import (
2525
"github.com/prometheus/client_golang/prometheus"
2626
"github.com/sirupsen/logrus"
2727
"go.mongodb.org/mongo-driver/mongo"
28+
29+
"github.com/percona/mongodb_exporter/internal/util"
2830
)
2931

3032
// pbm collector collects metrics from PBM (Percona Backup for MongoDb).
@@ -125,7 +127,7 @@ func (p *pbmCollector) collect(ch chan<- prometheus.Metric) {
125127
}
126128

127129
func (p *pbmCollector) pbmAgentMetrics(ctx context.Context, pbmClient *sdk.Client, l *logrus.Entry) []prometheus.Metric {
128-
currentNode, err := sdk.GetNodeInfo(ctx, pbmClient)
130+
currentNode, err := util.MyRole(ctx, p.base.client)
129131
if err != nil {
130132
l.Errorf("failed to get current node info: %s", err.Error())
131133
return nil

0 commit comments

Comments
 (0)