Skip to content

Commit f8b9fa6

Browse files
author
Samiur Arif
committed
making default discovery for SSL enabled.
1 parent 660c89e commit f8b9fa6

File tree

3 files changed

+48
-9
lines changed

3 files changed

+48
-9
lines changed

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

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
# default:
1717
# username: splunk.discovery.default
1818
# password: splunk.discovery.default
19-
# tls:
20-
# insecure: true
21-
# insecure_skip_verify: true
2219
# status:
2320
# metrics:
2421
# - status: successful
@@ -47,9 +44,25 @@
4744
# `SPLUNK_DISCOVERY_RECEIVERS_mongodb_CONFIG_username="<username>"` and
4845
# `SPLUNK_DISCOVERY_RECEIVERS_mongodb_CONFIG_password="<password>"` environment variables.
4946
# - status: partial
47+
# regexp: 'SSL handshake received but server is started without SSL support'
48+
# log_record:
49+
# append_pattern: true
50+
# body: >-
51+
# Make sure the target database has SSL enabled or set insecure using the
52+
# `--set splunk.discovery.receivers.mongodb.config.tls::insecure="<boolean>"` command or the
53+
# `SPLUNK_DISCOVERY_RECEIVERS_mongodb_CONFIG_tls_x3a__x3a_insecure="<boolean>"` environment variable.
54+
# - status: partial
5055
# regexp: '.* failed to fetch index stats metrics: (Unauthorized) not authorized on admin to execute command .*'
5156
# log_record:
5257
# append_pattern: true
5358
# body: >-
5459
# Make sure the account used to access Mongodb has been given a clusterMonitor role in order to collect metrics.
5560
# `db.grantRolesToUser('someUser', [{ role: 'clusterMonitor', db: 'admin' }])`
61+
# - status: partial
62+
# regexp: '.* tls: failed to verify certificate: .*'
63+
# log_record:
64+
# append_pattern: true
65+
# body: >-
66+
# Make sure the target database's TLS cert and key files are set appropriately.
67+
# `--set splunk.discovery.receivers.mongodb.config.tls::key_file="<string>"` command
68+
# `--set splunk.discovery.receivers.mongodb.config.tls::cert_file="<string>"` command

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

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ mongodb:
1212
default:
1313
username: splunk.discovery.default
1414
password: splunk.discovery.default
15-
tls:
16-
insecure: true
17-
insecure_skip_verify: true
1815
status:
1916
metrics:
2017
- status: successful
@@ -42,10 +39,26 @@ mongodb:
4239
`--set splunk.discovery.receivers.mongodb.config.password="<password>"` or
4340
`SPLUNK_DISCOVERY_RECEIVERS_mongodb_CONFIG_username="<username>"` and
4441
`SPLUNK_DISCOVERY_RECEIVERS_mongodb_CONFIG_password="<password>"` environment variables.
42+
- status: partial
43+
regexp: 'SSL handshake received but server is started without SSL support'
44+
log_record:
45+
append_pattern: true
46+
body: >-
47+
Make sure the target database has SSL enabled or set insecure using the
48+
`--set splunk.discovery.receivers.mongodb.config.tls::insecure="<boolean>"` command or the
49+
`SPLUNK_DISCOVERY_RECEIVERS_mongodb_CONFIG_tls_x3a__x3a_insecure="<boolean>"` environment variable.
4550
- status: partial
4651
regexp: '.* failed to fetch index stats metrics: (Unauthorized) not authorized on admin to execute command .*'
4752
log_record:
4853
append_pattern: true
4954
body: >-
5055
Make sure the account used to access Mongodb has been given a clusterMonitor role in order to collect metrics.
5156
`db.grantRolesToUser('someUser', [{ role: 'clusterMonitor', db: 'admin' }])`
57+
- status: partial
58+
regexp: '.* tls: failed to verify certificate: .*'
59+
log_record:
60+
append_pattern: true
61+
body: >-
62+
Make sure the target database's TLS cert and key files are set appropriately.
63+
`--set splunk.discovery.receivers.mongodb.config.tls::key_file="<string>"` command
64+
`--set splunk.discovery.receivers.mongodb.config.tls::cert_file="<string>"` command

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

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
default:
99
username: {{ defaultValue }}
1010
password: {{ defaultValue }}
11-
tls:
12-
insecure: true
13-
insecure_skip_verify: true
1411
status:
1512
metrics:
1613
- status: successful
@@ -38,10 +35,26 @@
3835
`--set {{ configProperty "password" "<password>" }}` or
3936
`{{ configPropertyEnvVar "username" "<username>" }}` and
4037
`{{ configPropertyEnvVar "password" "<password>" }}` environment variables.
38+
- status: partial
39+
regexp: 'SSL handshake received but server is started without SSL support'
40+
log_record:
41+
append_pattern: true
42+
body: >-
43+
Make sure the target database has SSL enabled or set insecure using the
44+
`--set {{ configProperty "tls::insecure" "<boolean>" }}` command or the
45+
`{{ configPropertyEnvVar "tls::insecure" "<boolean>" }}` environment variable.
4146
- status: partial
4247
regexp: '.* failed to fetch index stats metrics: (Unauthorized) not authorized on admin to execute command .*'
4348
log_record:
4449
append_pattern: true
4550
body: >-
4651
Make sure the account used to access Mongodb has been given a clusterMonitor role in order to collect metrics.
4752
`db.grantRolesToUser('someUser', [{ role: 'clusterMonitor', db: 'admin' }])`
53+
- status: partial
54+
regexp: '.* tls: failed to verify certificate: .*'
55+
log_record:
56+
append_pattern: true
57+
body: >-
58+
Make sure the target database's TLS cert and key files are set appropriately.
59+
`--set {{ configProperty "tls::key_file" "<string>" }}` command
60+
`--set {{ configProperty "tls::cert_file" "<string>" }}` command

0 commit comments

Comments
 (0)