Skip to content

Commit 01a47a8

Browse files
author
Samiur Arif
authored
addressing previour PR comments (#5051)
Signed-off-by: Samiur Arif <[email protected]>
1 parent 379398d commit 01a47a8

File tree

10 files changed

+93
-0
lines changed

10 files changed

+93
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
- (Splunk) `discovery`: Enable discovery mode for SQL Server receiver ([#5109](https://github.com/signalfx/splunk-otel-collector/pull/5109))
2020
- (Splunk) Update bundled OpenJDK to [11.0.24_8](https://github.com/adoptium/temurin11-binaries/releases/tag/jdk-11.0.24%2B8) ([#5113](https://github.com/signalfx/splunk-otel-collector/pull/5113))
21+
- (Splunk) Rabbitmq receiver was added into the discovery feature([#5113](https://github.com/signalfx/splunk-otel-collector/pull/5051))
2122

2223
## v0.104.0
2324

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#####################################################################################
2+
# This file is generated by the Splunk Distribution of the OpenTelemetry Collector. #
3+
# #
4+
# It reflects the default configuration bundled in the Collector executable for use #
5+
# in discovery mode (--discovery) and is provided for reference or customization. #
6+
# Please note that any changes made to this file will need to be reconciled during #
7+
# upgrades of the Collector. #
8+
#####################################################################################
9+
# rabbitmq:
10+
# enabled: true
11+
# rule:
12+
# docker_observer: type == "container" and any([name, image, command], {# matches "(?i)rabbitmq.*"}) and not (command matches "splunk.discovery")
13+
# host_observer: type == "hostport" and command matches "(?i)rabbitmq.*" and not (command matches "splunk.discovery")
14+
# k8s_observer: type == "port" and pod.name matches "(?i)rabbitmq.*"
15+
# config:
16+
# default:
17+
# endpoint: '`endpoint`'
18+
# username: splunk.discovery.default
19+
# password: splunk.discovery.default
20+
# collection_interval: 10s
21+
# status:
22+
# metrics:
23+
# - status: successful
24+
# strict: rabbitmq.consumer.count
25+
# message: RabbitMQ receiver is working!
26+
# statements:
27+
# - status: failed
28+
# regexp: 'connect: network is unreachable'
29+
# message: The endpoint is refusing RabbitMQ server connections.
30+
# - status: failed
31+
# regexp: 'connect: connection refused'
32+
# message: The container is refusing RabbitMQ server connections.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#####################################################################################
2+
# Do not edit manually! #
3+
# All changes must be made to associated .tmpl file before running 'make bundle.d'. #
4+
#####################################################################################
5+
rabbitmq:
6+
enabled: true
7+
rule:
8+
docker_observer: type == "container" and any([name, image, command], {# matches "(?i)rabbitmq.*"}) and not (command matches "splunk.discovery")
9+
host_observer: type == "hostport" and command matches "(?i)rabbitmq.*" and not (command matches "splunk.discovery")
10+
k8s_observer: type == "port" and pod.name matches "(?i)rabbitmq.*"
11+
config:
12+
default:
13+
endpoint: '`endpoint`'
14+
username: splunk.discovery.default
15+
password: splunk.discovery.default
16+
collection_interval: 10s
17+
status:
18+
metrics:
19+
- status: successful
20+
strict: rabbitmq.consumer.count
21+
message: RabbitMQ receiver is working!
22+
statements:
23+
- status: failed
24+
regexp: 'connect: network is unreachable'
25+
message: The endpoint is refusing RabbitMQ server connections.
26+
- status: failed
27+
regexp: 'connect: connection refused'
28+
message: The container is refusing RabbitMQ server connections.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{{ receiver "rabbitmq" }}:
2+
enabled: true
3+
rule:
4+
docker_observer: type == "container" and any([name, image, command], {# matches "(?i)rabbitmq.*"}) and not (command matches "splunk.discovery")
5+
host_observer: type == "hostport" and command matches "(?i)rabbitmq.*" and not (command matches "splunk.discovery")
6+
k8s_observer: type == "port" and pod.name matches "(?i)rabbitmq.*"
7+
config:
8+
default:
9+
endpoint: '`endpoint`'
10+
username: {{ defaultValue }}
11+
password: {{ defaultValue }}
12+
collection_interval: 10s
13+
status:
14+
metrics:
15+
- status: successful
16+
strict: rabbitmq.consumer.count
17+
message: RabbitMQ receiver is working!
18+
statements:
19+
- status: failed
20+
regexp: 'connect: network is unreachable'
21+
message: The endpoint is refusing RabbitMQ server connections.
22+
- status: failed
23+
regexp: 'connect: connection refused'
24+
message: The endpoint is refusing RabbitMQ server connections.

internal/confmapprovider/discovery/bundle/bundle_gen.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
//go:generate discoverybundler -r -c -d ../../../../cmd/otelcol/config/collector/config.d.linux/receivers -t bundle.d/receivers/oracledb.discovery.yaml.tmpl
3636
//go:generate discoverybundler -r -t bundle.d/receivers/postgresql.discovery.yaml.tmpl
3737
//go:generate discoverybundler -r -c -d ../../../../cmd/otelcol/config/collector/config.d.linux/receivers -t bundle.d/receivers/postgresql.discovery.yaml.tmpl
38+
//go:generate discoverybundler -r -t bundle.d/receivers/rabbitmq.discovery.yaml.tmpl
39+
//go:generate discoverybundler -r -c -d ../../../../cmd/otelcol/config/collector/config.d.linux/receivers -t bundle.d/receivers/rabbitmq.discovery.yaml.tmpl
3840
//go:generate discoverybundler -r -t bundle.d/receivers/redis.discovery.yaml.tmpl
3941
//go:generate discoverybundler -r -c -d ../../../../cmd/otelcol/config/collector/config.d.linux/receivers -t bundle.d/receivers/redis.discovery.yaml.tmpl
4042
//go:generate discoverybundler -r -t bundle.d/receivers/smartagent-collectd-mysql.discovery.yaml.tmpl

internal/confmapprovider/discovery/bundle/bundledfs_other_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ func TestBundleDir(t *testing.T) {
3333
"bundle.d/receivers/mysql.discovery.yaml",
3434
"bundle.d/receivers/oracledb.discovery.yaml",
3535
"bundle.d/receivers/postgresql.discovery.yaml",
36+
"bundle.d/receivers/rabbitmq.discovery.yaml",
3637
"bundle.d/receivers/redis.discovery.yaml",
3738
"bundle.d/receivers/smartagent-collectd-mysql.discovery.yaml",
3839
"bundle.d/receivers/smartagent-collectd-nginx.discovery.yaml",

internal/confmapprovider/discovery/bundle/bundledfs_others.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import (
3131
//go:embed bundle.d/receivers/mysql.discovery.yaml
3232
//go:embed bundle.d/receivers/oracledb.discovery.yaml
3333
//go:embed bundle.d/receivers/postgresql.discovery.yaml
34+
//go:embed bundle.d/receivers/rabbitmq.discovery.yaml
3435
//go:embed bundle.d/receivers/redis.discovery.yaml
3536
//go:embed bundle.d/receivers/smartagent-collectd-mysql.discovery.yaml
3637
//go:embed bundle.d/receivers/smartagent-collectd-nginx.discovery.yaml

internal/confmapprovider/discovery/bundle/bundledfs_windows.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import (
3131
//go:embed bundle.d/receivers/mysql.discovery.yaml
3232
//go:embed bundle.d/receivers/oracledb.discovery.yaml
3333
//go:embed bundle.d/receivers/postgresql.discovery.yaml
34+
//go:embed bundle.d/receivers/rabbitmq.discovery.yaml
3435
//go:embed bundle.d/receivers/redis.discovery.yaml
3536
//go:embed bundle.d/receivers/smartagent-postgresql.discovery.yaml
3637
//go:embed bundle.d/receivers/sqlserver.discovery.yaml

internal/confmapprovider/discovery/bundle/bundledfs_windows_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ func TestBundleDir(t *testing.T) {
3333
"bundle.d/receivers/mysql.discovery.yaml",
3434
"bundle.d/receivers/oracledb.discovery.yaml",
3535
"bundle.d/receivers/postgresql.discovery.yaml",
36+
"bundle.d/receivers/rabbitmq.discovery.yaml",
3637
"bundle.d/receivers/redis.discovery.yaml",
3738
"bundle.d/receivers/smartagent-postgresql.discovery.yaml",
3839
"bundle.d/receivers/sqlserver.discovery.yaml",

internal/confmapprovider/discovery/bundle/components.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ var (
3737
"mysql",
3838
"oracledb",
3939
"postgresql",
40+
"rabbitmq",
4041
"redis",
4142
"smartagent-collectd-mysql",
4243
"smartagent-collectd-nginx",
@@ -71,6 +72,7 @@ var (
7172
"mysql": {},
7273
"oracledb": {},
7374
"postgresql": {},
75+
"rabbitmq": {},
7476
"redis": {},
7577
"smartagent-postgresql": {},
7678
"sqlserver": {},

0 commit comments

Comments
 (0)