Skip to content

Commit 7b4692b

Browse files
percona-csalgueroShashank Sinha
andauthored
Test issue #458 (#494)
Co-authored-by: Shashank Sinha <[email protected]>
1 parent 3d4c9c9 commit 7b4692b

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ release: ## Build the binaries using goreleaser
7777
docker run --rm --privileged \
7878
-v ${PWD}:/go/src/github.com/user/repo \
7979
-w /go/src/github.com/user/repo \
80-
goreleaser/goreleaser release --snapshot --skip-publish --rm-dist
80+
goreleaser/goreleaser release --snapshot --skip-publish --rm-dist
8181

8282
FILES = $(shell find . -type f -name '*.go' -not -path "./vendor/*")
8383

exporter/diagnostic_data_collector.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ func (d *diagnosticDataCollector) collect(ch chan<- prometheus.Metric) {
9696

9797
nodeType, err := getNodeType(d.ctx, client)
9898
if err != nil {
99-
logger.Errorf("Cannot get node type to check if this is a mongos: %s", err)
99+
logger.WithFields(logrus.Fields{
100+
"component": "diagnosticDataCollector",
101+
}).Errorf("Cannot get node type to check if this is a mongos: %s", err)
100102
} else if nodeType == typeMongos {
101103
metrics = append(metrics, mongosMetrics(d.ctx, client, logger)...)
102104
}

exporter/exporter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func (e *Exporter) makeRegistry(ctx context.Context, client *mongo.Client, topol
137137

138138
nodeType, err := getNodeType(ctx, client)
139139
if err != nil {
140-
e.logger.Errorf("Cannot get node type to check if this is a mongos: %s", err)
140+
e.logger.Errorf("Registry - Cannot get node type to check if this is a mongos : %s", err)
141141
}
142142

143143
// Enable collectors like collstats and indexstats depending on the number of collections

exporter/topology_info.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,6 @@ func getClusterRole(ctx context.Context, client *mongo.Client) (string, error) {
184184
return "mongos", nil
185185
}
186186

187-
// standalone
188-
if walkTo(cmdOpts, []string{"parsed", "replication", "replSet"}) == nil {
189-
return "", nil
190-
}
191-
192187
clusterRole := ""
193188
if cr := walkTo(cmdOpts, []string{"parsed", "sharding", "clusterRole"}); cr != nil {
194189
clusterRole, _ = cr.(string)

0 commit comments

Comments
 (0)