-
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
* use pmm agent for node IP lookup * re-order switch cases * make address selection more explicit * always expose in pull mode * update tests
- Loading branch information
Showing
8 changed files
with
49 additions
and
39 deletions.
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 |
---|---|---|
|
@@ -53,7 +53,7 @@ func TestMongodbExporterConfig225(t *testing.T) { | |
"--compatible-mode", | ||
"--discovering-mode", | ||
"--mongodb.global-conn-pool", | ||
"--web.listen-address=1.2.3.4:{{ .listen_port }}", | ||
"--web.listen-address=0.0.0.0:{{ .listen_port }}", | ||
}, | ||
Env: []string{ | ||
"MONGODB_URI=mongodb://username:s3cur3%20p%[email protected]:27017/?connectTimeoutMS=1000&directConnection=true&serverSelectionTimeoutMS=1000", | ||
|
@@ -78,7 +78,7 @@ func TestMongodbExporterConfig225(t *testing.T) { | |
"--discovering-mode", | ||
"--mongodb.collstats-colls=col1,col2,col3", | ||
"--mongodb.global-conn-pool", | ||
"--web.listen-address=1.2.3.4:{{ .listen_port }}", | ||
"--web.listen-address=0.0.0.0:{{ .listen_port }}", | ||
} | ||
actual, err := mongodbExporterConfig(node, mongodb, exporter, exposeSecrets, pmmAgentVersion) | ||
require.NoError(t, err) | ||
|
@@ -113,7 +113,7 @@ func TestMongodbExporterConfig226(t *testing.T) { | |
"--compatible-mode", | ||
"--discovering-mode", | ||
"--mongodb.global-conn-pool", | ||
"--web.listen-address=1.2.3.4:{{ .listen_port }}", | ||
"--web.listen-address=0.0.0.0:{{ .listen_port }}", | ||
}, | ||
Env: []string{ | ||
"MONGODB_URI=mongodb://username:s3cur3%20p%[email protected]:27017/?connectTimeoutMS=1000&directConnection=true&serverSelectionTimeoutMS=1000", | ||
|
@@ -141,7 +141,7 @@ func TestMongodbExporterConfig226(t *testing.T) { | |
"--mongodb.collstats-colls=col1,col2,col3", | ||
"--mongodb.global-conn-pool", | ||
"--mongodb.indexstats-colls=col1,col2,col3", | ||
"--web.listen-address=1.2.3.4:{{ .listen_port }}", | ||
"--web.listen-address=0.0.0.0:{{ .listen_port }}", | ||
} | ||
actual, err := mongodbExporterConfig(node, mongodb, exporter, exposeSecrets, pmmAgentVersion) | ||
require.NoError(t, err) | ||
|
@@ -168,7 +168,7 @@ func TestMongodbExporterConfig226(t *testing.T) { | |
"--mongodb.collstats-colls=col1,col2,col3", | ||
"--mongodb.global-conn-pool", | ||
"--mongodb.indexstats-colls=col1,col2,col3", | ||
"--web.listen-address=1.2.3.4:{{ .listen_port }}", | ||
"--web.listen-address=0.0.0.0:{{ .listen_port }}", | ||
} | ||
actual, err := mongodbExporterConfig(node, mongodb, exporter, exposeSecrets, pmmAgentVersion) | ||
require.NoError(t, err) | ||
|
@@ -196,7 +196,7 @@ func TestMongodbExporterConfig226(t *testing.T) { | |
"--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=1.2.3.4:{{ .listen_port }}", | ||
"--web.listen-address=0.0.0.0:{{ .listen_port }}", | ||
} | ||
actual, err := mongodbExporterConfig(node, mongodb, exporter, exposeSecrets, pmmAgentVersion) | ||
require.NoError(t, err) | ||
|
@@ -223,7 +223,7 @@ func TestMongodbExporterConfig226(t *testing.T) { | |
"--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=1.2.3.4:{{ .listen_port }}", | ||
"--web.listen-address=0.0.0.0:{{ .listen_port }}", | ||
} | ||
actual, err := mongodbExporterConfig(node, mongodb, exporter, exposeSecrets, pmmAgentVersion) | ||
require.NoError(t, err) | ||
|
@@ -258,7 +258,7 @@ func TestMongodbExporterConfig(t *testing.T) { | |
"--collect.topmetrics", | ||
"--no-collect.connpoolstats", | ||
"--no-collect.indexusage", | ||
"--web.listen-address=1.2.3.4:{{ .listen_port }}", | ||
"--web.listen-address=0.0.0.0:{{ .listen_port }}", | ||
}, | ||
Env: []string{ | ||
"MONGODB_URI=mongodb://username:s3cur3%20p%[email protected]:27017/?connectTimeoutMS=1000&directConnection=true&serverSelectionTimeoutMS=1000", | ||
|
@@ -343,7 +343,7 @@ func TestMongodbExporterConfig(t *testing.T) { | |
"--collect.database", | ||
"--no-collect.connpoolstats", | ||
"--no-collect.indexusage", | ||
"--web.listen-address=1.2.3.4:{{ .listen_port }}", | ||
"--web.listen-address=0.0.0.0:{{ .listen_port }}", | ||
}, | ||
} | ||
require.NoError(t, err) | ||
|
@@ -376,7 +376,7 @@ func TestNewMongodbExporterConfig(t *testing.T) { | |
Args: []string{ | ||
"--compatible-mode", | ||
"--mongodb.global-conn-pool", | ||
"--web.listen-address=1.2.3.4:{{ .listen_port }}", | ||
"--web.listen-address=0.0.0.0:{{ .listen_port }}", | ||
}, | ||
Env: []string{ | ||
"MONGODB_URI=mongodb://username:s3cur3%20p%[email protected]:27017/?connectTimeoutMS=1000&directConnection=true&serverSelectionTimeoutMS=1000", | ||
|
@@ -430,7 +430,7 @@ func TestMongodbExporterConfig228_WebConfigAuth(t *testing.T) { | |
"--compatible-mode", | ||
"--discovering-mode", | ||
"--mongodb.global-conn-pool", | ||
"--web.listen-address=1.2.3.4:{{ .listen_port }}", | ||
"--web.listen-address=0.0.0.0:{{ .listen_port }}", | ||
"--web.config={{ .TextFiles.webConfigPlaceholder }}", | ||
} | ||
|
||
|
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 |
---|---|---|
|
@@ -66,7 +66,7 @@ func (s *PostgresExporterConfigTestSuite) SetupTest() { | |
"--collect.custom_query.lr.directory=" + pathsBase(s.pmmAgentVersion, "{{", "}}") + "/collectors/custom-queries/postgresql/low-resolution", | ||
"--collect.custom_query.mr", | ||
"--collect.custom_query.mr.directory=" + pathsBase(s.pmmAgentVersion, "{{", "}}") + "/collectors/custom-queries/postgresql/medium-resolution", | ||
"--web.listen-address=1.2.3.4:{{ .listen_port }}", | ||
"--web.listen-address=0.0.0.0:{{ .listen_port }}", | ||
}, | ||
Env: []string{ | ||
"DATA_SOURCE_NAME=postgres://username:s3cur3%20p%[email protected]:5432/postgres?connect_timeout=1&sslmode=disable", | ||
|
@@ -167,7 +167,7 @@ func (s *PostgresExporterConfigTestSuite) TestDisabledCollectors() { | |
"--collect.custom_query.lr.directory=" + pathsBase(s.pmmAgentVersion, "{{", "}}") + "/collectors/custom-queries/postgresql/low-resolution", | ||
"--collect.custom_query.mr", | ||
"--collect.custom_query.mr.directory=" + pathsBase(s.pmmAgentVersion, "{{", "}}") + "/collectors/custom-queries/postgresql/medium-resolution", | ||
"--web.listen-address=1.2.3.4:{{ .listen_port }}", | ||
"--web.listen-address=0.0.0.0:{{ .listen_port }}", | ||
}, | ||
} | ||
requireNoDuplicateFlags(s.T(), actual.Args) | ||
|
@@ -205,7 +205,7 @@ func TestAutoDiscovery(t *testing.T) { | |
"--collect.custom_query.lr.directory=" + pathsBase(pmmAgentVersion, "{{", "}}") + "/collectors/custom-queries/postgresql/low-resolution", | ||
"--collect.custom_query.mr", | ||
"--collect.custom_query.mr.directory=" + pathsBase(pmmAgentVersion, "{{", "}}") + "/collectors/custom-queries/postgresql/medium-resolution", | ||
"--web.listen-address=1.2.3.4:{{ .listen_port }}", | ||
"--web.listen-address=0.0.0.0:{{ .listen_port }}", | ||
}, | ||
Env: []string{ | ||
"DATA_SOURCE_NAME=postgres://username:s3cur3%20p%[email protected]:5432/postgres?connect_timeout=1&sslmode=disable", | ||
|
@@ -324,7 +324,7 @@ func (s *PostgresExporterConfigTestSuite) TestAzureTimeout() { | |
"--collect.custom_query.mr", | ||
"--collect.custom_query.mr.directory=" + pathsBase(s.pmmAgentVersion, "{{", "}}") + "/collectors/custom-queries/postgresql/medium-resolution", | ||
"--exclude-databases=template0,template1,postgres,cloudsqladmin,pmm-managed-dev,azure_maintenance,rdsadmin", | ||
"--web.listen-address=1.2.3.4:{{ .listen_port }}", | ||
"--web.listen-address=0.0.0.0:{{ .listen_port }}", | ||
}, | ||
Env: []string{ | ||
"DATA_SOURCE_NAME=postgres://username:s3cur3%20p%[email protected]:5432/postgres?connect_timeout=5&sslmode=disable", | ||
|
@@ -370,7 +370,7 @@ func (s *PostgresExporterConfigTestSuite) TestPrometheusWebConfig() { | |
"--collect.custom_query.mr", | ||
"--collect.custom_query.mr.directory=" + pathsBase(s.pmmAgentVersion, "{{", "}}") + "/collectors/custom-queries/postgresql/medium-resolution", | ||
"--exclude-databases=template0,template1,postgres,cloudsqladmin,pmm-managed-dev,azure_maintenance,rdsadmin", | ||
"--web.listen-address=1.2.3.4:{{ .listen_port }}", | ||
"--web.listen-address=0.0.0.0:{{ .listen_port }}", | ||
"--web.config={{ .TextFiles.webConfigPlaceholder }}", | ||
}, | ||
Env: []string{ | ||
|
@@ -419,7 +419,7 @@ func (s *PostgresExporterConfigTestSuite) TestSSLSni() { | |
"--collect.custom_query.mr", | ||
"--collect.custom_query.mr.directory=" + pathsBase(s.pmmAgentVersion, "{{", "}}") + "/collectors/custom-queries/postgresql/medium-resolution", | ||
"--exclude-databases=template0,template1,postgres,cloudsqladmin,pmm-managed-dev,azure_maintenance,rdsadmin", | ||
"--web.listen-address=1.2.3.4:{{ .listen_port }}", | ||
"--web.listen-address=0.0.0.0:{{ .listen_port }}", | ||
"--web.config={{ .TextFiles.webConfigPlaceholder }}", | ||
}, | ||
Env: []string{ | ||
|
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