Skip to content

Commit aa1864e

Browse files
authored
[receiver/discovery] Replace log_record field to message (#4916)
`log_record` field isn't relevant anymore since we don't send discovery events as log records. The provided value is set to `discovery.message` entity attribute and sent to the backend on a regular basis. The additional `log_record.attributes` field is not being used. If needed in future, it can be added as another field in the statement section itself.
1 parent 225ec93 commit aa1864e

File tree

46 files changed

+400
-647
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+400
-647
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44

5+
### 🛑 Breaking changes 🛑
6+
7+
- (Splunk) `receiver/discovery`: Replace `log_record` field with `message` in evaluation statements ([#4583](https://github.com/signalfx/splunk-otel-collector/pull/4583))
8+
59
### 🚩 Deprecations 🚩
610

711
- (Splunk) The following docker images/manifests are deprecated and may not be published in a future release:

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,11 @@
2323
# metrics:
2424
# - status: successful
2525
# strict: kafka.brokers
26-
# log_record:
27-
# body: kafkametrics receiver is working!
26+
# message: kafkametrics receiver is working!
2827
# statements:
2928
# - status: failed
3029
# regexp: 'connect: network is unreachable'
31-
# log_record:
32-
# body: The container cannot be reached by the Collector. Make sure they're in the same network.
30+
# message: The container cannot be reached by the Collector. Make sure they're in the same network.
3331
# - status: failed
3432
# regexp: 'connect: connection refused'
35-
# log_record:
36-
# body: The container is refusing kafka server connections.
33+
# message: The container is refusing kafka server connections.

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

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,27 +27,22 @@
2727
# metrics:
2828
# - status: successful
2929
# strict: mongodb.database.count
30-
# log_record:
31-
# body: mongodb receiver is working!
30+
# message: mongodb receiver is working!
3231
# statements:
3332
# - status: failed
3433
# regexp: 'connect: network is unreachable'
35-
# log_record:
36-
# body: The container cannot be reached by the Collector. Make sure they're in the same network.
34+
# message: The container cannot be reached by the Collector. Make sure they're in the same network.
3735
# - status: failed
3836
# regexp: 'connect: connection refused'
39-
# log_record:
40-
# body: The container is refusing mongodb connections.
37+
# message: The container is refusing mongodb connections.
4138
# - status: partial
4239
# regexp: '.* unable to authenticate using mechanism .*'
43-
# log_record:
44-
# body: >-
45-
# Please ensure your user credentials are correctly specified with
46-
# `SPLUNK_DISCOVERY_RECEIVERS_mongodb_CONFIG_username="<username>"` and
47-
# `SPLUNK_DISCOVERY_RECEIVERS_mongodb_CONFIG_password="<password>"` environment variables.
40+
# message: >-
41+
# Please ensure your user credentials are correctly specified with
42+
# `SPLUNK_DISCOVERY_RECEIVERS_mongodb_CONFIG_username="<username>"` and
43+
# `SPLUNK_DISCOVERY_RECEIVERS_mongodb_CONFIG_password="<password>"` environment variables.
4844
# - status: partial
4945
# regexp: '.* failed to fetch index stats metrics: (Unauthorized) not authorized on admin to execute command .*'
50-
# log_record:
51-
# body: >-
52-
# Make sure the account used to access Mongodb has been given a clusterMonitor role in order to collect metrics.
53-
# `db.grantRolesToUser('someUser', [{ role: 'clusterMonitor', db: 'admin' }])`
46+
# message: >-
47+
# Make sure the account used to access Mongodb has been given a clusterMonitor role in order to collect metrics.
48+
# `db.grantRolesToUser('someUser', [{ role: 'clusterMonitor', db: 'admin' }])`

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

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,14 @@
2020
# metrics:
2121
# - status: successful
2222
# strict: mysql.locks
23-
# log_record:
24-
# body: Mysql receiver is working!
23+
# message: Mysql receiver is working!
2524
# statements:
2625
# - status: failed
2726
# regexp: "Can't connect to MySQL server on .* [(]111[)]"
28-
# log_record:
29-
# body: The container cannot be reached by the Collector. The container is refusing MySQL connections.
27+
# message: The container cannot be reached by the Collector. The container is refusing MySQL connections.
3028
# - status: partial
3129
# regexp: 'Access denied for user'
32-
# log_record:
33-
# body: >-
34-
# Make sure your user credentials are correctly specified using the
35-
# `SPLUNK_DISCOVERY_RECEIVERS_mysql_CONFIG_username="<username>"` and
36-
# `SPLUNK_DISCOVERY_RECEIVERS_mysql_CONFIG_password="<password>"` environment variables.
30+
# message: >-
31+
# Make sure your user credentials are correctly specified using the
32+
# `SPLUNK_DISCOVERY_RECEIVERS_mysql_CONFIG_username="<username>"` and
33+
# `SPLUNK_DISCOVERY_RECEIVERS_mysql_CONFIG_password="<password>"` environment variables.

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

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,35 +21,28 @@
2121
# metrics:
2222
# - status: successful
2323
# strict: oracledb.cpu_time
24-
# log_record:
25-
# body: oracledb receiver is working!
24+
# message: oracledb receiver is working!
2625
# statements:
2726
# - status: failed
2827
# regexp: "connection refused"
29-
# log_record:
30-
# body: The container is not serving http connections.
28+
# message: The container is not serving http connections.
3129
# - status: failed
3230
# regexp: "received goaway and there are no active streams"
33-
# log_record:
34-
# body: Unable to connect and scrape metrics.
31+
# message: Unable to connect and scrape metrics.
3532
# - status: failed
3633
# regexp: "dial tcp: lookup"
37-
# log_record:
38-
# body: Unable to resolve oracledb tcp endpoint
34+
# message: Unable to resolve oracledb tcp endpoint
3935
# - status: failed
4036
# regexp: 'error executing select .*: EOF'
41-
# log_record:
42-
# body: Unable to execute select from oracledb. Verify endpoint and user permissions.
37+
# message: Unable to execute select from oracledb. Verify endpoint and user permissions.
4338
# - status: partial
4439
# regexp: "listener does not currently know of service requested"
45-
# log_record:
46-
# body: >-
47-
# Make sure your oracledb service is correctly specified using the
48-
# `SPLUNK_DISCOVERY_RECEIVERS_oracledb_CONFIG_service="<service>"` environment variable.
40+
# message: >-
41+
# Make sure your oracledb service is correctly specified using the
42+
# `SPLUNK_DISCOVERY_RECEIVERS_oracledb_CONFIG_service="<service>"` environment variable.
4943
# - status: partial
5044
# regexp: 'invalid username/password'
51-
# log_record:
52-
# body: >-
53-
# Make sure your user credentials are correctly specified using the
54-
# `SPLUNK_DISCOVERY_RECEIVERS_oracledb_CONFIG_username="<username>"` and
55-
# `SPLUNK_DISCOVERY_RECEIVERS_oracledb_CONFIG_password="<password>"` environment variables.
45+
# message: >-
46+
# Make sure your user credentials are correctly specified using the
47+
# `SPLUNK_DISCOVERY_RECEIVERS_oracledb_CONFIG_username="<username>"` and
48+
# `SPLUNK_DISCOVERY_RECEIVERS_oracledb_CONFIG_password="<password>"` environment variables.

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

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -20,44 +20,37 @@
2020
# metrics:
2121
# - status: successful
2222
# strict: postgresql.commits
23-
# log_record:
24-
# body: PostgreSQL receiver is working!
23+
# message: PostgreSQL receiver is working!
2524
# statements:
2625
# - status: failed
2726
# regexp: 'connect: network is unreachable'
28-
# log_record:
29-
# body: The container cannot be reached by the Collector. Make sure they're in the same network.
27+
# message: The container cannot be reached by the Collector. Make sure they're in the same network.
3028
# - status: failed
3129
# regexp: 'connect: connection refused'
32-
# log_record:
33-
# body: The container is refusing PostgreSQL connections.
30+
# message: The container is refusing PostgreSQL connections.
3431
# - status: partial
3532
# regexp: 'pq: password authentication failed for user'
36-
# log_record:
37-
# body: >-
38-
# Please ensure your user credentials are correctly specified with
39-
# `SPLUNK_DISCOVERY_RECEIVERS_postgresql_CONFIG_username="<username>"` and
40-
# `SPLUNK_DISCOVERY_RECEIVERS_postgresql_CONFIG_password="<password>"` environment variables.
33+
# message: >-
34+
# Please ensure your user credentials are correctly specified with
35+
# `SPLUNK_DISCOVERY_RECEIVERS_postgresql_CONFIG_username="<username>"` and
36+
# `SPLUNK_DISCOVERY_RECEIVERS_postgresql_CONFIG_password="<password>"` environment variables.
4137
# - status: partial
4238
# regexp: 'pq: database .* does not exist'
43-
# log_record:
44-
# body: >-
45-
# Make sure the target database is correctly specified using the
46-
# `SPLUNK_DISCOVERY_RECEIVERS_postgresql_CONFIG_databases="[<db>]"` environment variable.
39+
# message: >-
40+
# Make sure the target database is correctly specified using the
41+
# `SPLUNK_DISCOVERY_RECEIVERS_postgresql_CONFIG_databases="[<db>]"` environment variable.
4742
# - status: partial
4843
# regexp: 'pq: SSL is not enabled on the server'
49-
# log_record:
50-
# body: >-
51-
# Make sure the target database has SSL enabled or set insecure using the
52-
# `SPLUNK_DISCOVERY_RECEIVERS_postgresql_CONFIG_tls_x3a__x3a_insecure="<boolean>"` environment variable.
44+
# message: >-
45+
# Make sure the target database has SSL enabled or set insecure using the
46+
# `SPLUNK_DISCOVERY_RECEIVERS_postgresql_CONFIG_tls_x3a__x3a_insecure="<boolean>"` environment variable.
5347
# - status: partial
5448
# regexp: 'pq: pg_stat_statements must be loaded via shared_preload_libraries'
55-
# log_record:
56-
# body: >-
57-
# Make sure your PostgreSQL database has
58-
# `shared_preload_libraries = 'pg_stat_statements'`
59-
# in the postgresql.conf file and that
60-
# `CREATE EXTENSION IF NOT EXISTS pg_stat_statements;`
61-
# has been run for each database you would like to monitor.
62-
# For example:
63-
# `psql --dbname "<db-name>" -c "CREATE EXTENSION pg_stat_statements;"`
49+
# message: >-
50+
# Make sure your PostgreSQL database has
51+
# `shared_preload_libraries = 'pg_stat_statements'`
52+
# in the postgresql.conf file and that
53+
# `CREATE EXTENSION IF NOT EXISTS pg_stat_statements;`
54+
# has been run for each database you would like to monitor.
55+
# For example:
56+
# `psql --dbname "<db-name>" -c "CREATE EXTENSION pg_stat_statements;"`

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

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,36 +18,29 @@
1818
# metrics:
1919
# - status: successful
2020
# strict: redis.uptime
21-
# log_record:
22-
# body: redis receiver is working!
21+
# message: redis receiver is working!
2322
# statements:
2423
# - status: failed
2524
# regexp: "connection refused"
26-
# log_record:
27-
# body: The container is not serving http connections.
25+
# message: The container is not serving http connections.
2826
# - status: failed
2927
# regexp: "received goaway and there are no active streams"
30-
# log_record:
31-
# body: Unable to connect and scrape metrics.
28+
# message: Unable to connect and scrape metrics.
3229
# - status: failed
3330
# regexp: "dial tcp: lookup"
34-
# log_record:
35-
# body: Unable to resolve redis tcp endpoint
31+
# message: Unable to resolve redis tcp endpoint
3632
# - status: partial
3733
# regexp: 'NOAUTH Authentication required.'
38-
# log_record:
39-
# body: >-
40-
# Make sure your user credentials are correctly specified using the
41-
# `SPLUNK_DISCOVERY_RECEIVERS_redis_CONFIG_password="<password>"` environment variable.
34+
# message: >-
35+
# Make sure your user credentials are correctly specified using the
36+
# `SPLUNK_DISCOVERY_RECEIVERS_redis_CONFIG_password="<password>"` environment variable.
4237
# - status: partial
4338
# regexp: 'called without any password configured for the default user'
44-
# log_record:
45-
# body: >-
46-
# Make sure your user credentials are correctly specified using the
47-
# `SPLUNK_DISCOVERY_RECEIVERS_redis_CONFIG_password="<password>"` environment variable.
39+
# message: >-
40+
# Make sure your user credentials are correctly specified using the
41+
# `SPLUNK_DISCOVERY_RECEIVERS_redis_CONFIG_password="<password>"` environment variable.
4842
# - status: partial
4943
# regexp: 'WRONGPASS invalid username-password pair or user is disabled'
50-
# log_record:
51-
# body: >-
52-
# Make sure your user credentials are correctly specified using the
53-
# `SPLUNK_DISCOVERY_RECEIVERS_redis_CONFIG_password="<password>"` environment variable.
44+
# message: >-
45+
# Make sure your user credentials are correctly specified using the
46+
# `SPLUNK_DISCOVERY_RECEIVERS_redis_CONFIG_password="<password>"` environment variable.

cmd/otelcol/config/collector/config.d.linux/receivers/smartagent-collectd-mysql.discovery.yaml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,29 +24,24 @@
2424
# metrics:
2525
# - status: successful
2626
# strict: mysql_octets.rx
27-
# log_record:
28-
# body: smartagent/collectd/mysql receiver is working!
27+
# message: smartagent/collectd/mysql receiver is working!
2928
# statements:
3029
# - status: failed
3130
# regexp: "mysql plugin: Failed to connect to database .* at server .* Can't connect to MySQL server on .* [(]111[)]"
32-
# log_record:
33-
# body: The container is refusing MySQL connections.
31+
# message: The container is refusing MySQL connections.
3432
# - status: partial
3533
# regexp: 'mysql plugin: Failed to connect to database .* at server .* Access denied for user .* [(]using password: .*[)]'
36-
# log_record:
37-
# body: >-
38-
# Make sure your user credentials are correctly specified using the
39-
# `SPLUNK_DISCOVERY_RECEIVERS_smartagent_x2f_collectd_x2f_mysql_CONFIG_username="<username>"` and
40-
# `SPLUNK_DISCOVERY_RECEIVERS_smartagent_x2f_collectd_x2f_mysql_CONFIG_password="<password>"` environment variables.
34+
# message: >-
35+
# Make sure your user credentials are correctly specified using the
36+
# `SPLUNK_DISCOVERY_RECEIVERS_smartagent_x2f_collectd_x2f_mysql_CONFIG_username="<username>"` and
37+
# `SPLUNK_DISCOVERY_RECEIVERS_smartagent_x2f_collectd_x2f_mysql_CONFIG_password="<password>"` environment variables.
4138
# - status: partial
4239
# regexp: 'mysql plugin: Failed to connect to database .* at server .* Unknown database'
43-
# log_record:
44-
# body: >-
45-
# Make sure your MySQL databases are correctly specified using the
46-
# `SPLUNK_DISCOVERY_RECEIVERS_smartagent_x2f_collectd_x2f_mysql_CONFIG_databases="[{name: '<db-name-0>'}, {name: '<db-name-1>', username: '<username>', password: '<password>'}]"` environment variable.
40+
# message: >-
41+
# Make sure your MySQL databases are correctly specified using the
42+
# `SPLUNK_DISCOVERY_RECEIVERS_smartagent_x2f_collectd_x2f_mysql_CONFIG_databases="[{name: '<db-name-0>'}, {name: '<db-name-1>', username: '<username>', password: '<password>'}]"` environment variable.
4743
# - status: partial
4844
# regexp: 'mysql plugin: Failed to connect to database .* at server .* Access denied for user .* to database'
49-
# log_record:
50-
# body: >-
51-
# Make sure your MySQL databases and auth information are correctly specified using the
52-
# `SPLUNK_DISCOVERY_RECEIVERS_smartagent_x2f_collectd_x2f_mysql_CONFIG_databases="[{name: '<db-name-0>'}, {name: '<db-name-1>', username: '<username>', password: '<password>'}]"` environment variable.
45+
# message: >-
46+
# Make sure your MySQL databases and auth information are correctly specified using the
47+
# `SPLUNK_DISCOVERY_RECEIVERS_smartagent_x2f_collectd_x2f_mysql_CONFIG_databases="[{name: '<db-name-0>'}, {name: '<db-name-1>', username: '<username>', password: '<password>'}]"` environment variable.

cmd/otelcol/config/collector/config.d.linux/receivers/smartagent-collectd-nginx.discovery.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,11 @@
2222
# metrics:
2323
# - status: successful
2424
# strict: connections.accepted
25-
# log_record:
26-
# body: smartagent/collectd/nginx receiver is working!
25+
# message: smartagent/collectd/nginx receiver is working!
2726
# statements:
2827
# - status: failed
2928
# regexp: "nginx plugin: curl_easy_perform failed: Operation timed out after"
30-
# log_record:
31-
# body: The container is not serving http connections.
29+
# message: The container is not serving http connections.
3230
# - status: failed
3331
# regexp: "read-function of plugin .* failed"
34-
# log_record:
35-
# body: The integration is unable to read metrics from this endpoint.
32+
# message: The integration is unable to read metrics from this endpoint.

0 commit comments

Comments
 (0)