Skip to content

Commit acfa5ef

Browse files
authored
PMM-9224: Not disable fetching diagnostic info for arbiter (#655)
* PMM-9224: Enable diagnostic info for arbiter * PMM-9224: Configure authentication to Arbiter when it requires authentication * PMM-9224: Ignore linter error * PMM-9224: Refactor code * PMM-9224: Fix import order
1 parent 3f94dfa commit acfa5ef

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

exporter/dsn_fix/dsn_fix.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package dsn_fix
1919
import (
2020
"net/url"
2121

22+
"github.com/AlekSi/pointer"
2223
"go.mongodb.org/mongo-driver/mongo/options"
2324
)
2425

@@ -41,6 +42,8 @@ func ClientOptionsForDSN(dsn string) (*options.ClientOptions, error) {
4142
if username != "" || password != "" {
4243
clientOptions.Auth.Username = username
4344
clientOptions.Auth.Password = password
45+
// set this flag to connect to arbiter when there authentication is enabled
46+
clientOptions.AuthenticateToAnything = pointer.ToBool(true) //nolint:staticcheck
4447
}
4548

4649
return clientOptions, nil

exporter/exporter.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ func (e *Exporter) makeRegistry(ctx context.Context, client *mongo.Client, topol
173173

174174
// arbiter only have isMaster privileges
175175
if isArbiter {
176-
e.opts.EnableDiagnosticData = false
177176
e.opts.EnableDBStats = false
178177
e.opts.EnableCollStats = false
179178
e.opts.EnableTopMetrics = false

0 commit comments

Comments
 (0)