-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* PMM-12848 Enable currentopmetrics collector in mongodb_exporter. * PMM-7 fix golint. * PMM-12848 Add currentopmetrics to scrape config. * PMM-12848 collect currentopmetrics in low resolution. * PMM-12848 Fix tests. * PMM-13141 Enable fcv collector. * enable pbm exporter by default * enable pbm collector in 2.42 * move pbm collector to 2.43 * update scrape configs * revert makefile changes * drop fcv collector until it is recognized by mongodb exporter * add release note highlight for PMM-10680 * merge both new mongodb exporter collectors * enable pbm collector by default * add new note for pbm collector * apply suggestion * fix tests * fix typo --------- Co-authored-by: Nurlan Moldomurov <[email protected]> Co-authored-by: Nurlan Moldomurov <[email protected]>
- Loading branch information
1 parent
3d20f7d
commit d9d956c
Showing
4 changed files
with
108 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -415,6 +415,84 @@ func TestMongodbExporterConfig2411(t *testing.T) { | |
}) | ||
} | ||
|
||
func TestMongodbExporterConfig2430(t *testing.T) { | ||
pmmAgentVersion := version.MustParse("2.43.0") | ||
node := &models.Node{ | ||
Address: "1.2.3.4", | ||
} | ||
mongodb := &models.Service{ | ||
Address: pointer.ToString("1.2.3.4"), | ||
Port: pointer.ToUint16(27017), | ||
} | ||
exporter := &models.Agent{ | ||
AgentID: "agent-id", | ||
AgentType: models.MongoDBExporterType, | ||
Username: pointer.ToString("username"), | ||
Password: pointer.ToString("s3cur3 p@$$w0r4."), | ||
AgentPassword: pointer.ToString("agent-password"), | ||
} | ||
actual, err := mongodbExporterConfig(node, mongodb, exporter, redactSecrets, pmmAgentVersion) | ||
expected := &agentpb.SetStateRequest_AgentProcess{ | ||
Type: inventorypb.AgentType_MONGODB_EXPORTER, | ||
TemplateLeftDelim: "{{", | ||
TemplateRightDelim: "}}", | ||
Args: []string{ | ||
"--collector.diagnosticdata", | ||
"--collector.pbm", | ||
"--collector.replicasetstatus", | ||
"--compatible-mode", | ||
"--discovering-mode", | ||
"--mongodb.global-conn-pool", | ||
"--web.listen-address=0.0.0.0:{{ .listen_port }}", | ||
"--web.config={{ .TextFiles.webConfigPlaceholder }}", | ||
}, | ||
Env: []string{ | ||
"MONGODB_URI=mongodb://username:s3cur3%20p%[email protected]:27017/?connectTimeoutMS=1000&directConnection=true&serverSelectionTimeoutMS=1000", | ||
}, | ||
RedactWords: []string{"s3cur3 p@$$w0r4.", "agent-password"}, | ||
TextFiles: map[string]string{ | ||
"webConfigPlaceholder": "basic_auth_users:\n pmm: agent-password\n", | ||
}, | ||
} | ||
require.NoError(t, err) | ||
requireNoDuplicateFlags(t, actual.Args) | ||
require.Equal(t, expected.Args, actual.Args) | ||
require.Equal(t, expected.Env, actual.Env) | ||
require.Equal(t, expected, actual) | ||
|
||
t.Run("Enabling all collectors", func(t *testing.T) { | ||
exporter.MongoDBOptions = &models.MongoDBOptions{ | ||
EnableAllCollectors: true, | ||
StatsCollections: []string{"db1.col1.one", "db2.col2", "db3"}, | ||
} | ||
|
||
expected.Args = []string{ | ||
"--collector.collstats", | ||
"--collector.collstats-limit=0", | ||
"--collector.currentopmetrics", | ||
"--collector.dbstats", | ||
"--collector.diagnosticdata", | ||
"--collector.indexstats", | ||
"--collector.pbm", | ||
"--collector.replicasetstatus", | ||
"--collector.shards", | ||
"--collector.topmetrics", | ||
"--compatible-mode", | ||
"--discovering-mode", | ||
// this should be here even if limit=0 because it could be used to filter dbstats | ||
// since dbstats is not depending on the number of collections present in the db. | ||
"--mongodb.collstats-colls=db1.col1.one,db2.col2,db3", | ||
"--mongodb.global-conn-pool", | ||
"--mongodb.indexstats-colls=db1.col1.one,db2.col2,db3", | ||
"--web.listen-address=0.0.0.0:{{ .listen_port }}", | ||
"--web.config={{ .TextFiles.webConfigPlaceholder }}", | ||
} | ||
actual, err := mongodbExporterConfig(node, mongodb, exporter, exposeSecrets, pmmAgentVersion) | ||
require.NoError(t, err) | ||
require.Equal(t, expected.Args, actual.Args) | ||
}) | ||
} | ||
|
||
func TestMongodbExporterConfig(t *testing.T) { | ||
pmmAgentVersion := version.MustParse("2.0.0") | ||
node := &models.Node{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters