From b42cac7cbe6b04da216c7d9e3cb07a5a5f70cb3f Mon Sep 17 00:00:00 2001 From: Nurlan Moldomurov Date: Thu, 1 Aug 2024 17:38:19 +0300 Subject: [PATCH 01/10] PMM-12848 Enable currentopmetrics collector in mongodb_exporter. --- managed/services/agents/mongodb.go | 214 ++++++------------------ managed/services/agents/mongodb_test.go | 29 ++++ managed/utils/collectors/collectors.go | 17 ++ 3 files changed, 96 insertions(+), 164 deletions(-) diff --git a/managed/services/agents/mongodb.go b/managed/services/agents/mongodb.go index 0e043e3904..e692d4cce6 100644 --- a/managed/services/agents/mongodb.go +++ b/managed/services/agents/mongodb.go @@ -30,17 +30,13 @@ import ( "github.com/percona/pmm/version" ) -type collectorArgs struct { - enabled bool - enableParam string -} - var ( // New MongoDB Exporter will be released with PMM agent v2.10.0. newMongoExporterPMMVersion = version.MustParse("2.9.99") v2_25_0 = version.MustParse("2.25.0-0") v2_26_0 = version.MustParse("2.26.0-0") v2_41_1 = version.MustParse("2.41.1-0") + v2_42_0 = version.MustParse("2.42.0-0") ) // mongodbExporterConfig returns desired configuration of mongodb_exporter process. @@ -50,20 +46,7 @@ func mongodbExporterConfig(node *models.Node, service *models.Service, exporter listenAddress := getExporterListenAddress(node, exporter) tdp := exporter.TemplateDelimiters(service) - var args []string - // Starting with PMM 2.10.0, we are shipping the new mongodb_exporter - // Starting with PMM 2.25.0, we change the discovering-mode making it to discover all databases. - // Until now, discovering mode was not working properly and was enabled only if mongodb.collstats-colls= - // was specified in the command line. - // Starting with PMM 2.26.0, we disabled all collectors by default and added flags to enable them. - // Starting with PMM 2.41.1 we added shards collector. - if pmmAgentVersion.Less(v2_26_0) { - args = oldPMMAgentArgs(exporter, tdp, listenAddress, pmmAgentVersion) - } else { - args = v226Args(exporter, tdp, listenAddress, pmmAgentVersion) - } - - args = collectors.FilterOutCollectors("--collect.", args, exporter.DisabledCollectors) + args := getArgs(exporter, tdp, listenAddress, pmmAgentVersion) if pointer.GetString(exporter.MetricsPath) != "" { args = append(args, "--web.telemetry-path="+*exporter.MetricsPath) @@ -101,171 +84,74 @@ func mongodbExporterConfig(node *models.Node, service *models.Service, exporter return res, nil } -func oldPMMAgentArgs(exporter *models.Agent, tdp *models.DelimiterPair, listenAddress string, pmmAgentVersion *version.Parsed) []string { +// getArgs returns the appropriate arguments based on the PMM agent version. +func getArgs(exporter *models.Agent, tdp *models.DelimiterPair, listenAddress string, pmmAgentVersion *version.Parsed) []string { var args []string + switch { - case !pmmAgentVersion.Less(v2_25_0): // >= 2.25 - args = v225Args(exporter, tdp, listenAddress) - case !pmmAgentVersion.Less(newMongoExporterPMMVersion): // >= 2.10 - args = []string{ - "--mongodb.global-conn-pool", - "--compatible-mode", - "--web.listen-address=" + listenAddress + ":" + tdp.Left + " .listen_port " + tdp.Right, //nolint:goconst + case !pmmAgentVersion.Less(v2_25_0): // >= 2.26.0 + args = buildBaseArgs(listenAddress, tdp) + args = append(args, "--discovering-mode") + + defaultEnabledCollectors := []string{"diagnosticdata", "replicasetstatus"} + collectAll := exporter.MongoDBOptions != nil && exporter.MongoDBOptions.EnableAllCollectors + + if !pmmAgentVersion.Less(v2_26_0) { + defaultEnabledCollectors = []string{} + args = append(args, "--collector.diagnosticdata", "--collector.replicasetstatus") + if collectAll { + args = append(args, "--collector.collstats", "--collector.dbstats", "--collector.indexstats", "--collector.topmetrics") + } } - default: - args = []string{ - "--collect.collection", - "--collect.database", - "--collect.topmetrics", - "--no-collect.connpoolstats", - "--no-collect.indexusage", - "--web.listen-address=" + listenAddress + ":" + tdp.Left + " .listen_port " + tdp.Right, + if !pmmAgentVersion.Less(v2_41_1) && collectAll { // >= 2.41.1 + args = append(args, "--collector.shards") + } + if !pmmAgentVersion.Less(v2_42_0) && collectAll { // >= 2.42.0 + args = append(args, "--collector.currentopmetrics") } - } - return args -} - -func v226Args(exporter *models.Agent, tdp *models.DelimiterPair, listenAddress string, pmmAgentVersion *version.Parsed) []string { - collectAll := false - if exporter.MongoDBOptions != nil { - collectAll = exporter.MongoDBOptions.EnableAllCollectors - } - - collstatsLimit := int32(200) - if exporter.MongoDBOptions != nil && exporter.MongoDBOptions.CollectionsLimit != -1 { - collstatsLimit = exporter.MongoDBOptions.CollectionsLimit - } - collectors := defaultCollectors(collectAll) + args = collectors.FilterOutCollectors("--collector.", args, exporter.DisabledCollectors) + args = append(args, collectors.DisableDefaultEnabledCollectors("--no-collector.", defaultEnabledCollectors, exporter.DisabledCollectors)...) - if !pmmAgentVersion.Less(v2_41_1) { // >= 2.41.1 - collectors["shards"] = collectorArgs{ - enabled: collectAll, - enableParam: "--collector.shards", + if exporter.MongoDBOptions != nil && len(exporter.MongoDBOptions.StatsCollections) != 0 { + args = append(args, "--mongodb.collstats-colls="+strings.Join(exporter.MongoDBOptions.StatsCollections, ",")) + if !pmmAgentVersion.Less(v2_26_0) { + args = append(args, "--mongodb.indexstats-colls="+strings.Join(exporter.MongoDBOptions.StatsCollections, ",")) + } } - } - for _, collector := range exporter.DisabledCollectors { - col, ok := collectors[strings.ToLower(collector)] - if !ok { - continue + if exporter.MongoDBOptions != nil { + collstatsLimit := int32(200) + if exporter.MongoDBOptions.CollectionsLimit != -1 { + collstatsLimit = exporter.MongoDBOptions.CollectionsLimit + } + args = append(args, fmt.Sprintf("--collector.collstats-limit=%d", collstatsLimit)) } - col.enabled = false - collectors[strings.ToLower(collector)] = col - } - - args := []string{ - "--mongodb.global-conn-pool", - "--compatible-mode", - "--web.listen-address=" + listenAddress + ":" + tdp.Left + " .listen_port " + tdp.Right, - "--discovering-mode", - } - if exporter.MongoDBOptions != nil && len(exporter.MongoDBOptions.StatsCollections) != 0 { - args = append(args, "--mongodb.collstats-colls="+strings.Join(exporter.MongoDBOptions.StatsCollections, ",")) - args = append(args, "--mongodb.indexstats-colls="+strings.Join(exporter.MongoDBOptions.StatsCollections, ",")) - } + case !pmmAgentVersion.Less(newMongoExporterPMMVersion): // >= 2.10.0 + args = buildBaseArgs(listenAddress, tdp) - if exporter.MongoDBOptions != nil { - args = append(args, fmt.Sprintf("--collector.collstats-limit=%d", collstatsLimit)) - } - - for _, collector := range collectors { - if collector.enabled && collector.enableParam != "" { - args = append(args, collector.enableParam) + default: // < 2.10.0 + args = []string{ + "--collect.collection", + "--collect.database", + "--collect.topmetrics", + "--no-collect.connpoolstats", + "--no-collect.indexusage", + "--web.listen-address=" + listenAddress + ":" + tdp.Left + " .listen_port " + tdp.Right, } + + args = collectors.FilterOutCollectors("--collect.", args, exporter.DisabledCollectors) } return args } -func v225Args(exporter *models.Agent, tdp *models.DelimiterPair, listenAddress string) []string { - type collectorArgs struct { - enabled bool - enableParam string - disableParam string - } - - collectors := map[string]collectorArgs{ - "diagnosticdata": { - enabled: true, - disableParam: "--no-collector.diagnosticdata", - }, - "replicasetstatus": { - enabled: true, - disableParam: "--no-collector.replicasetstatus", - }, - // disabled until we have better information on the resources usage impact - "dbstats": { - enabled: false, - enableParam: "--collector.dbstats", - }, - // disabled until we have better information on the resources usage impact - "topmetrics": { - enabled: false, - enableParam: "--collector.topmetrics", - }, - } - - for _, collector := range exporter.DisabledCollectors { - col := collectors[strings.ToLower(collector)] - col.enabled = false - collectors[strings.ToLower(collector)] = col - } - - args := []string{ +func buildBaseArgs(listenAddress string, tdp *models.DelimiterPair) []string { + return []string{ "--mongodb.global-conn-pool", "--compatible-mode", "--web.listen-address=" + listenAddress + ":" + tdp.Left + " .listen_port " + tdp.Right, - "--discovering-mode", - } - - if exporter.MongoDBOptions != nil && len(exporter.MongoDBOptions.StatsCollections) != 0 { - args = append(args, "--mongodb.collstats-colls="+strings.Join(exporter.MongoDBOptions.StatsCollections, ",")) - } - - if exporter.MongoDBOptions != nil && exporter.MongoDBOptions.CollectionsLimit != 0 { - args = append(args, fmt.Sprintf("--collector.collstats-limit=%d", exporter.MongoDBOptions.CollectionsLimit)) - } - - for _, collector := range collectors { - if collector.enabled && collector.enableParam != "" { - args = append(args, collector.enableParam) - } - if !collector.enabled && collector.disableParam != "" { - args = append(args, collector.disableParam) - } - } - - return args -} - -func defaultCollectors(collectAll bool) map[string]collectorArgs { - return map[string]collectorArgs{ - "diagnosticdata": { - enabled: true, - enableParam: "--collector.diagnosticdata", - }, - "replicasetstatus": { - enabled: true, - enableParam: "--collector.replicasetstatus", - }, - "collstats": { - enabled: collectAll, - enableParam: "--collector.collstats", - }, - "dbstats": { - enabled: collectAll, - enableParam: "--collector.dbstats", - }, - "indexstats": { - enabled: collectAll, - enableParam: "--collector.indexstats", - }, - "topmetrics": { - enabled: collectAll, - enableParam: "--collector.topmetrics", - }, } } diff --git a/managed/services/agents/mongodb_test.go b/managed/services/agents/mongodb_test.go index 8accc04e9e..0864effc51 100644 --- a/managed/services/agents/mongodb_test.go +++ b/managed/services/agents/mongodb_test.go @@ -384,6 +384,35 @@ func TestMongodbExporterConfig2411(t *testing.T) { require.NoError(t, err) require.Equal(t, expected.Args, actual.Args) }) + + t.Run("Enable all collectors and disable some", func(t *testing.T) { + exporter.MongoDBOptions = &models.MongoDBOptions{ + EnableAllCollectors: true, + StatsCollections: []string{"db1.col1.one", "db2.col2", "db3"}, + } + exporter.DisabledCollectors = []string{"dbstats", "topmetrics"} + + expected.Args = []string{ + "--collector.collstats", + "--collector.collstats-limit=0", + "--collector.diagnosticdata", + "--collector.indexstats", + "--collector.replicasetstatus", + "--collector.shards", + "--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 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) { diff --git a/managed/utils/collectors/collectors.go b/managed/utils/collectors/collectors.go index 66e464ff40..5286e61518 100644 --- a/managed/utils/collectors/collectors.go +++ b/managed/utils/collectors/collectors.go @@ -42,3 +42,20 @@ func FilterOutCollectors(prefix string, args, disabledCollectors []string) []str } return enabledArgs } + +// DisableDefaultEnabledCollectors returns CLI arguments to disable default enabled collectors based on input. +// DefaultCollectors and disabledCollectors should be collector names without prefix. +// Result will be returned with prefix. +func DisableDefaultEnabledCollectors(prefix string, defaultCollectors []string, disabledCollectors []string) []string { + defaultCollectorsMap := make(map[string]struct{}) + for _, defaultCollector := range defaultCollectors { + defaultCollectorsMap[defaultCollector] = struct{}{} + } + args := []string{} + for _, collector := range disabledCollectors { + if _, ok := defaultCollectorsMap[collector]; ok { + args = append(args, fmt.Sprintf("%s%s", prefix, collector)) + } + } + return args +} From ad4289c58a91d844cbe9abe62d66d2456b765720 Mon Sep 17 00:00:00 2001 From: Nurlan Moldomurov Date: Thu, 1 Aug 2024 18:33:40 +0300 Subject: [PATCH 02/10] PMM-7 fix golint. --- managed/services/agents/mongodb.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/managed/services/agents/mongodb.go b/managed/services/agents/mongodb.go index e692d4cce6..3b1fa5f68d 100644 --- a/managed/services/agents/mongodb.go +++ b/managed/services/agents/mongodb.go @@ -49,7 +49,7 @@ func mongodbExporterConfig(node *models.Node, service *models.Service, exporter args := getArgs(exporter, tdp, listenAddress, pmmAgentVersion) if pointer.GetString(exporter.MetricsPath) != "" { - args = append(args, "--web.telemetry-path="+*exporter.MetricsPath) + args = append(args, "--web.telemetry-path="+*exporter.MetricsPath) //nolint:goconst } args = withLogLevel(args, exporter.LogLevel, pmmAgentVersion, true) @@ -138,7 +138,7 @@ func getArgs(exporter *models.Agent, tdp *models.DelimiterPair, listenAddress st "--collect.topmetrics", "--no-collect.connpoolstats", "--no-collect.indexusage", - "--web.listen-address=" + listenAddress + ":" + tdp.Left + " .listen_port " + tdp.Right, + "--web.listen-address=" + listenAddress + ":" + tdp.Left + " .listen_port " + tdp.Right, //nolint:goconst } args = collectors.FilterOutCollectors("--collect.", args, exporter.DisabledCollectors) From 089f76204068601b3c4598d0f95176915276668e Mon Sep 17 00:00:00 2001 From: Nurlan Moldomurov Date: Mon, 5 Aug 2024 13:38:29 +0300 Subject: [PATCH 03/10] PMM-12848 Add currentopmetrics to scrape config. --- managed/services/victoriametrics/scrape_configs.go | 1 + 1 file changed, 1 insertion(+) diff --git a/managed/services/victoriametrics/scrape_configs.go b/managed/services/victoriametrics/scrape_configs.go index 9dc595a871..ad3b14dad0 100644 --- a/managed/services/victoriametrics/scrape_configs.go +++ b/managed/services/victoriametrics/scrape_configs.go @@ -404,6 +404,7 @@ func scrapeConfigsForMongoDBExporter(params *scrapeConfigParams) ([]*config.Scra "diagnosticdata", "replicasetstatus", "topmetrics", + "currentopmetrics", }) if err != nil { return nil, err From b8bfe56714aaf2602c2ee23ecfbda55b3f46aa20 Mon Sep 17 00:00:00 2001 From: Nurlan Moldomurov Date: Mon, 5 Aug 2024 13:50:47 +0300 Subject: [PATCH 04/10] PMM-12848 collect currentopmetrics in low resolution. --- managed/services/victoriametrics/scrape_configs.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/managed/services/victoriametrics/scrape_configs.go b/managed/services/victoriametrics/scrape_configs.go index ad3b14dad0..a9b593240a 100644 --- a/managed/services/victoriametrics/scrape_configs.go +++ b/managed/services/victoriametrics/scrape_configs.go @@ -404,7 +404,6 @@ func scrapeConfigsForMongoDBExporter(params *scrapeConfigParams) ([]*config.Scra "diagnosticdata", "replicasetstatus", "topmetrics", - "currentopmetrics", }) if err != nil { return nil, err @@ -423,6 +422,9 @@ func scrapeConfigsForMongoDBExporter(params *scrapeConfigParams) ([]*config.Scra if !params.pmmAgentVersion.Less(version.MustParse("2.41.1-0")) { defaultCollectors = append(defaultCollectors, "shards") } + if params.pmmAgentVersion.Less(version.MustParse("2.42.0-0")) { + defaultCollectors = append(defaultCollectors, "currentopmetrics") + } lr, err := scrapeConfigForStandardExporter("lr", params.metricsResolution.LR, params, defaultCollectors) if err != nil { From 659fc6048001b0ded2fc3b14233ca23eaf20e8b5 Mon Sep 17 00:00:00 2001 From: Nurlan Moldomurov Date: Mon, 5 Aug 2024 14:06:12 +0300 Subject: [PATCH 05/10] PMM-12848 Fix tests. --- managed/services/victoriametrics/scrape_configs.go | 2 +- managed/services/victoriametrics/scrape_configs_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/managed/services/victoriametrics/scrape_configs.go b/managed/services/victoriametrics/scrape_configs.go index a9b593240a..d2a3104fcd 100644 --- a/managed/services/victoriametrics/scrape_configs.go +++ b/managed/services/victoriametrics/scrape_configs.go @@ -422,7 +422,7 @@ func scrapeConfigsForMongoDBExporter(params *scrapeConfigParams) ([]*config.Scra if !params.pmmAgentVersion.Less(version.MustParse("2.41.1-0")) { defaultCollectors = append(defaultCollectors, "shards") } - if params.pmmAgentVersion.Less(version.MustParse("2.42.0-0")) { + if !params.pmmAgentVersion.Less(version.MustParse("2.42.0-0")) { defaultCollectors = append(defaultCollectors, "currentopmetrics") } diff --git a/managed/services/victoriametrics/scrape_configs_test.go b/managed/services/victoriametrics/scrape_configs_test.go index d09afa1988..c327bbac9d 100644 --- a/managed/services/victoriametrics/scrape_configs_test.go +++ b/managed/services/victoriametrics/scrape_configs_test.go @@ -758,7 +758,7 @@ func TestScrapeConfig(t *testing.T) { ScrapeTimeout: scrapeTimeout(s.LR), MetricsPath: "/metrics", Params: map[string][]string{ - "collect[]": {"collstats", "dbstats", "indexstats", "shards"}, + "collect[]": {"collstats", "currentopmetrics", "dbstats", "indexstats", "shards"}, }, HTTPClientConfig: config.HTTPClientConfig{ BasicAuth: &config.BasicAuth{ @@ -790,7 +790,7 @@ func TestScrapeConfig(t *testing.T) { node: node, service: service, agent: agent, - pmmAgentVersion: version.MustParse("2.41.1"), + pmmAgentVersion: version.MustParse("2.42.0"), metricsResolution: s, }) require.NoError(t, err) From 29149d518306ca394ecd8516f7bdbf16de46da28 Mon Sep 17 00:00:00 2001 From: Nurlan Moldomurov Date: Thu, 8 Aug 2024 13:09:37 +0300 Subject: [PATCH 06/10] PMM-13141 Enable fcv collector. --- managed/services/agents/mongodb.go | 4 ++++ managed/services/victoriametrics/scrape_configs.go | 3 +++ 2 files changed, 7 insertions(+) diff --git a/managed/services/agents/mongodb.go b/managed/services/agents/mongodb.go index 3b1fa5f68d..b27ed91c5c 100644 --- a/managed/services/agents/mongodb.go +++ b/managed/services/agents/mongodb.go @@ -37,6 +37,7 @@ var ( v2_26_0 = version.MustParse("2.26.0-0") v2_41_1 = version.MustParse("2.41.1-0") v2_42_0 = version.MustParse("2.42.0-0") + v2_43_0 = version.MustParse("2.43.0-0") ) // mongodbExporterConfig returns desired configuration of mongodb_exporter process. @@ -109,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) && collectAll { // >= 2.43.0 + args = append(args, "--collector.fcv") + } args = collectors.FilterOutCollectors("--collector.", args, exporter.DisabledCollectors) args = append(args, collectors.DisableDefaultEnabledCollectors("--no-collector.", defaultEnabledCollectors, exporter.DisabledCollectors)...) diff --git a/managed/services/victoriametrics/scrape_configs.go b/managed/services/victoriametrics/scrape_configs.go index d2a3104fcd..4d1d556a5d 100644 --- a/managed/services/victoriametrics/scrape_configs.go +++ b/managed/services/victoriametrics/scrape_configs.go @@ -425,6 +425,9 @@ 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") + } lr, err := scrapeConfigForStandardExporter("lr", params.metricsResolution.LR, params, defaultCollectors) if err != nil { From ad9395f74f4ad10adba861391f5177fcb9bcb1cb Mon Sep 17 00:00:00 2001 From: Nurlan Moldomurov Date: Thu, 12 Sep 2024 18:59:42 +0300 Subject: [PATCH 07/10] PMM-13141 Enable fcv by default. --- managed/services/agents/mongodb.go | 4 ++-- managed/services/victoriametrics/scrape_configs.go | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/managed/services/agents/mongodb.go b/managed/services/agents/mongodb.go index abdadf898a..919c89dc15 100644 --- a/managed/services/agents/mongodb.go +++ b/managed/services/agents/mongodb.go @@ -110,9 +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) && collectAll { // >= 2.43.0 + 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/victoriametrics/scrape_configs.go b/managed/services/victoriametrics/scrape_configs.go index a3c6cbe022..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 } @@ -427,11 +429,12 @@ func scrapeConfigsForMongoDBExporter(params *scrapeConfigParams) ([]*config.Scra } 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 From 024c9f31eb3ed5a4875fbef7e44befa417cb78df Mon Sep 17 00:00:00 2001 From: Nurlan Moldomurov Date: Fri, 13 Sep 2024 23:43:45 +0300 Subject: [PATCH 08/10] PMM-13141 fix test --- managed/services/agents/mongodb_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/managed/services/agents/mongodb_test.go b/managed/services/agents/mongodb_test.go index 74c9fc4a6e..17247ca999 100644 --- a/managed/services/agents/mongodb_test.go +++ b/managed/services/agents/mongodb_test.go @@ -473,6 +473,7 @@ func TestMongodbExporterConfig2430(t *testing.T) { "--collector.dbstats", "--collector.diagnosticdata", "--collector.indexstats", + "--collector.fcv", "--collector.pbm", "--collector.replicasetstatus", "--collector.shards", From b207a591fa634452fac31a5f775d12c30490b517 Mon Sep 17 00:00:00 2001 From: Nurlan Moldomurov Date: Sat, 14 Sep 2024 00:02:08 +0300 Subject: [PATCH 09/10] PMM-13141 fix test --- managed/services/agents/mongodb_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/managed/services/agents/mongodb_test.go b/managed/services/agents/mongodb_test.go index 17247ca999..d5761e3a80 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", From 361d2bacad1824da4b8bdeaa0af7d2ae4d1fd105 Mon Sep 17 00:00:00 2001 From: Nurlan Moldomurov Date: Sat, 14 Sep 2024 00:15:03 +0300 Subject: [PATCH 10/10] PMM-13141 fix test --- managed/services/agents/mongodb_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/managed/services/agents/mongodb_test.go b/managed/services/agents/mongodb_test.go index d5761e3a80..b33ffd2d13 100644 --- a/managed/services/agents/mongodb_test.go +++ b/managed/services/agents/mongodb_test.go @@ -473,8 +473,8 @@ func TestMongodbExporterConfig2430(t *testing.T) { "--collector.currentopmetrics", "--collector.dbstats", "--collector.diagnosticdata", - "--collector.indexstats", "--collector.fcv", + "--collector.indexstats", "--collector.pbm", "--collector.replicasetstatus", "--collector.shards",