Skip to content

Commit

Permalink
PMM-13141 enable fcv collector (#3142)
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.

* PMM-13141 Enable fcv by default.

* PMM-13141 fix test

---------

Co-authored-by: Alex Demidoff <[email protected]>
  • Loading branch information
BupycHuk and ademidoff authored Sep 13, 2024
1 parent cbfaffc commit 79a2310
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
3 changes: 3 additions & 0 deletions managed/services/agents/mongodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ func getArgs(exporter *models.Agent, tdp *models.DelimiterPair, listenAddress st
if !pmmAgentVersion.Less(v2_42_0) && collectAll { // >= 2.42.0
args = append(args, "--collector.currentopmetrics")
}
if !pmmAgentVersion.Less(v2_43_0) { // >= 2.43.0, enable by default
args = append(args, "--collector.fcv")
}
if !pmmAgentVersion.Less(v2_43_0) { // >= 2.43.0, enable pbm collector by default
args = append(args, "--collector.pbm")
}
Expand Down
2 changes: 2 additions & 0 deletions managed/services/agents/mongodb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ func TestMongodbExporterConfig2430(t *testing.T) {
TemplateRightDelim: "}}",
Args: []string{
"--collector.diagnosticdata",
"--collector.fcv",
"--collector.pbm",
"--collector.replicasetstatus",
"--compatible-mode",
Expand Down Expand Up @@ -472,6 +473,7 @@ func TestMongodbExporterConfig2430(t *testing.T) {
"--collector.currentopmetrics",
"--collector.dbstats",
"--collector.diagnosticdata",
"--collector.fcv",
"--collector.indexstats",
"--collector.pbm",
"--collector.replicasetstatus",
Expand Down
10 changes: 8 additions & 2 deletions managed/services/victoriametrics/scrape_configs.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,11 +400,13 @@ func scrapeConfigsForMongoDBExporter(params *scrapeConfigParams) ([]*config.Scra
}
return r, nil
}
hr, err := scrapeConfigForStandardExporter("hr", params.metricsResolution.HR, params, []string{
hrOptions := []string{
"diagnosticdata",
"replicasetstatus",
"topmetrics",
})
}
hrOptions = collectors.FilterOutCollectors("", hrOptions, params.agent.DisabledCollectors)
hr, err := scrapeConfigForStandardExporter("hr", params.metricsResolution.HR, params, hrOptions)
if err != nil {
return nil, err
}
Expand All @@ -425,10 +427,14 @@ func scrapeConfigsForMongoDBExporter(params *scrapeConfigParams) ([]*config.Scra
if !params.pmmAgentVersion.Less(version.MustParse("2.42.0-0")) {
defaultCollectors = append(defaultCollectors, "currentopmetrics")
}
if !params.pmmAgentVersion.Less(version.MustParse("2.43.0-0")) {
defaultCollectors = append(defaultCollectors, "fcv")
}
if !params.pmmAgentVersion.Less(version.MustParse("2.43.0-0")) {
defaultCollectors = append(defaultCollectors, "pbm")
}

defaultCollectors = collectors.FilterOutCollectors("", defaultCollectors, params.agent.DisabledCollectors)
lr, err := scrapeConfigForStandardExporter("lr", params.metricsResolution.LR, params, defaultCollectors)
if err != nil {
return nil, err
Expand Down

0 comments on commit 79a2310

Please sign in to comment.