diff --git a/managed/services/agents/mongodb.go b/managed/services/agents/mongodb.go index a9c39c14f3..919c89dc15 100644 --- a/managed/services/agents/mongodb.go +++ b/managed/services/agents/mongodb.go @@ -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") } diff --git a/managed/services/agents/mongodb_test.go b/managed/services/agents/mongodb_test.go index 74c9fc4a6e..b33ffd2d13 100644 --- a/managed/services/agents/mongodb_test.go +++ b/managed/services/agents/mongodb_test.go @@ -438,6 +438,7 @@ func TestMongodbExporterConfig2430(t *testing.T) { TemplateRightDelim: "}}", Args: []string{ "--collector.diagnosticdata", + "--collector.fcv", "--collector.pbm", "--collector.replicasetstatus", "--compatible-mode", @@ -472,6 +473,7 @@ func TestMongodbExporterConfig2430(t *testing.T) { "--collector.currentopmetrics", "--collector.dbstats", "--collector.diagnosticdata", + "--collector.fcv", "--collector.indexstats", "--collector.pbm", "--collector.replicasetstatus", diff --git a/managed/services/victoriametrics/scrape_configs.go b/managed/services/victoriametrics/scrape_configs.go index 4106a1fd62..cc12a4f732 100644 --- a/managed/services/victoriametrics/scrape_configs.go +++ b/managed/services/victoriametrics/scrape_configs.go @@ -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 } @@ -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