Skip to content

Commit

Permalink
PMM-13571: increase min version to enable pbm collector (#3346)
Browse files Browse the repository at this point in the history
* increase min version to enable pbm collector

* fix tests
  • Loading branch information
idoqo authored Nov 27, 2024
1 parent 919fbe4 commit 1dec00c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion managed/services/agents/mongodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ var (
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")
v2_43_2 = version.MustParse("2.43.2-0")
)

// mongodbExporterConfig returns desired configuration of mongodb_exporter process.
Expand Down Expand Up @@ -113,7 +114,7 @@ func getArgs(exporter *models.Agent, tdp *models.DelimiterPair, listenAddress st
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
if !pmmAgentVersion.Less(v2_43_2) { // >= 2.43.2, enable pbm collector by default
args = append(args, "--collector.pbm")
}

Expand Down
4 changes: 2 additions & 2 deletions managed/services/agents/mongodb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,8 @@ func TestMongodbExporterConfig2411(t *testing.T) {
})
}

func TestMongodbExporterConfig2430(t *testing.T) {
pmmAgentVersion := version.MustParse("2.43.0")
func TestMongodbExporterConfig2432(t *testing.T) {
pmmAgentVersion := version.MustParse("2.43.2")
node := &models.Node{
Address: "1.2.3.4",
}
Expand Down
5 changes: 4 additions & 1 deletion managed/services/victoriametrics/scrape_configs.go
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,10 @@ func scrapeConfigsForMongoDBExporter(params *scrapeConfigParams) ([]*config.Scra

var defaultCollectors []string
if !params.pmmAgentVersion.Less(version.MustParse("2.43.0-0")) {
defaultCollectors = append(defaultCollectors, "fcv", "pbm")
defaultCollectors = append(defaultCollectors, "fcv")
}
if !params.pmmAgentVersion.Less(version.MustParse("2.43.2-0")) {
defaultCollectors = append(defaultCollectors, "pbm")
}

if params.agent.MongoDBOptions != nil && params.agent.MongoDBOptions.EnableAllCollectors {
Expand Down
2 changes: 1 addition & 1 deletion managed/services/victoriametrics/scrape_configs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ func TestScrapeConfig(t *testing.T) {
node: node,
service: service,
agent: agent,
pmmAgentVersion: version.MustParse("2.43.0"),
pmmAgentVersion: version.MustParse("2.43.2"),
metricsResolution: s,
})
require.NoError(t, err)
Expand Down

0 comments on commit 1dec00c

Please sign in to comment.