Skip to content

Commit 950ace0

Browse files
authored
Use direct_connection in mongodb discovery (#6042)
With disabled direct connection, the mongodb receiver tries to discover other endpoints by itself. Given that the discovery receiver covers all endpoints on every node, such configuration can end up in cross-nodes scraping, metric duplication and failures. The mongodb receiver 0.121.0 was also changed to actively look for secondary hosts which may result in collector stuck on startup when it cannot reach other endpoints.
1 parent ca54f14 commit 950ace0

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

cmd/otelcol/config/collector/config.d.linux/receivers/mongodb.discovery.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# default:
1717
# username: splunk.discovery.default
1818
# password: splunk.discovery.default
19+
# direct_connection: true
1920
# tls:
2021
# insecure_skip_verify: true
2122
# insecure: false

internal/confmapprovider/discovery/bundle/bundle.d/receivers/mongodb.discovery.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ mongodb:
1212
default:
1313
username: splunk.discovery.default
1414
password: splunk.discovery.default
15+
direct_connection: true
1516
tls:
1617
insecure_skip_verify: true
1718
insecure: false

internal/confmapprovider/discovery/bundle/bundle.d/receivers/mongodb.discovery.yaml.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
default:
99
username: {{ defaultValue }}
1010
password: {{ defaultValue }}
11+
direct_connection: true
1112
tls:
1213
insecure_skip_verify: true
1314
insecure: false

0 commit comments

Comments
 (0)