Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added rabbitmq to the auto discovery mechanism #5051

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

- (Splunk) `discovery`: Enable discovery mode for SQL Server receiver ([#5109](https://github.com/signalfx/splunk-otel-collector/pull/5109))
- (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))
- (Splunk) Rabbitmq receiver was added into the discovery feature([#5113](https://github.com/signalfx/splunk-otel-collector/pull/5051))

## v0.104.0

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#####################################################################################
# This file is generated by the Splunk Distribution of the OpenTelemetry Collector. #
# #
# It reflects the default configuration bundled in the Collector executable for use #
# in discovery mode (--discovery) and is provided for reference or customization. #
# Please note that any changes made to this file will need to be reconciled during #
# upgrades of the Collector. #
#####################################################################################
# rabbitmq:
# enabled: true
# rule:
# docker_observer: type == "container" and any([name, image, command], {# matches "(?i)rabbitmq.*"}) and not (command matches "splunk.discovery")
# host_observer: type == "hostport" and command matches "(?i)rabbitmq.*" and not (command matches "splunk.discovery")
# k8s_observer: type == "port" and pod.name matches "(?i)rabbitmq.*"
# config:
# default:
# endpoint: '`endpoint`'
# username: splunk.discovery.default
# password: splunk.discovery.default
# collection_interval: 10s
# status:
# metrics:
# - status: successful
# strict: rabbitmq.consumer.count
# message: RabbitMQ receiver is working!
# statements:
# - status: failed
# regexp: 'connect: network is unreachable'
# message: The endpoint is refusing RabbitMQ server connections.
# - status: failed
# regexp: 'connect: connection refused'
# message: The container is refusing RabbitMQ server connections.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#####################################################################################
# Do not edit manually! #
# All changes must be made to associated .tmpl file before running 'make bundle.d'. #
#####################################################################################
rabbitmq:
enabled: true
rule:
docker_observer: type == "container" and any([name, image, command], {# matches "(?i)rabbitmq.*"}) and not (command matches "splunk.discovery")
host_observer: type == "hostport" and command matches "(?i)rabbitmq.*" and not (command matches "splunk.discovery")
k8s_observer: type == "port" and pod.name matches "(?i)rabbitmq.*"
config:
default:
endpoint: '`endpoint`'
username: splunk.discovery.default
password: splunk.discovery.default
collection_interval: 10s
status:
metrics:
- status: successful
strict: rabbitmq.consumer.count
message: RabbitMQ receiver is working!
statements:
- status: failed
regexp: 'connect: network is unreachable'
message: The endpoint is refusing RabbitMQ server connections.
- status: failed
regexp: 'connect: connection refused'
message: The container is refusing RabbitMQ server connections.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{ receiver "rabbitmq" }}:
enabled: true
rule:
docker_observer: type == "container" and any([name, image, command], {# matches "(?i)rabbitmq.*"}) and not (command matches "splunk.discovery")
samiura marked this conversation as resolved.
Show resolved Hide resolved
host_observer: type == "hostport" and command matches "(?i)rabbitmq.*" and not (command matches "splunk.discovery")
k8s_observer: type == "port" and pod.name matches "(?i)rabbitmq.*"
config:
default:
endpoint: '`endpoint`'
username: {{ defaultValue }}
password: {{ defaultValue }}
collection_interval: 10s
status:
metrics:
- status: successful
strict: rabbitmq.consumer.count
message: RabbitMQ receiver is working!
statements:
- status: failed
regexp: 'connect: network is unreachable'
message: The endpoint is refusing RabbitMQ server connections.
- status: failed
regexp: 'connect: connection refused'
message: The endpoint is refusing RabbitMQ server connections.
2 changes: 2 additions & 0 deletions internal/confmapprovider/discovery/bundle/bundle_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
//go:generate discoverybundler -r -c -d ../../../../cmd/otelcol/config/collector/config.d.linux/receivers -t bundle.d/receivers/oracledb.discovery.yaml.tmpl
//go:generate discoverybundler -r -t bundle.d/receivers/postgresql.discovery.yaml.tmpl
//go:generate discoverybundler -r -c -d ../../../../cmd/otelcol/config/collector/config.d.linux/receivers -t bundle.d/receivers/postgresql.discovery.yaml.tmpl
//go:generate discoverybundler -r -t bundle.d/receivers/rabbitmq.discovery.yaml.tmpl
//go:generate discoverybundler -r -c -d ../../../../cmd/otelcol/config/collector/config.d.linux/receivers -t bundle.d/receivers/rabbitmq.discovery.yaml.tmpl
//go:generate discoverybundler -r -t bundle.d/receivers/redis.discovery.yaml.tmpl
//go:generate discoverybundler -r -c -d ../../../../cmd/otelcol/config/collector/config.d.linux/receivers -t bundle.d/receivers/redis.discovery.yaml.tmpl
//go:generate discoverybundler -r -t bundle.d/receivers/smartagent-collectd-mysql.discovery.yaml.tmpl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ func TestBundleDir(t *testing.T) {
"bundle.d/receivers/mysql.discovery.yaml",
"bundle.d/receivers/oracledb.discovery.yaml",
"bundle.d/receivers/postgresql.discovery.yaml",
"bundle.d/receivers/rabbitmq.discovery.yaml",
"bundle.d/receivers/redis.discovery.yaml",
"bundle.d/receivers/smartagent-collectd-mysql.discovery.yaml",
"bundle.d/receivers/smartagent-collectd-nginx.discovery.yaml",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
//go:embed bundle.d/receivers/mysql.discovery.yaml
//go:embed bundle.d/receivers/oracledb.discovery.yaml
//go:embed bundle.d/receivers/postgresql.discovery.yaml
//go:embed bundle.d/receivers/rabbitmq.discovery.yaml
//go:embed bundle.d/receivers/redis.discovery.yaml
//go:embed bundle.d/receivers/smartagent-collectd-mysql.discovery.yaml
//go:embed bundle.d/receivers/smartagent-collectd-nginx.discovery.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
//go:embed bundle.d/receivers/mysql.discovery.yaml
//go:embed bundle.d/receivers/oracledb.discovery.yaml
//go:embed bundle.d/receivers/postgresql.discovery.yaml
//go:embed bundle.d/receivers/rabbitmq.discovery.yaml
//go:embed bundle.d/receivers/redis.discovery.yaml
//go:embed bundle.d/receivers/smartagent-postgresql.discovery.yaml
//go:embed bundle.d/receivers/sqlserver.discovery.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ func TestBundleDir(t *testing.T) {
"bundle.d/receivers/mysql.discovery.yaml",
"bundle.d/receivers/oracledb.discovery.yaml",
"bundle.d/receivers/postgresql.discovery.yaml",
"bundle.d/receivers/rabbitmq.discovery.yaml",
"bundle.d/receivers/redis.discovery.yaml",
"bundle.d/receivers/smartagent-postgresql.discovery.yaml",
"bundle.d/receivers/sqlserver.discovery.yaml",
Expand Down
2 changes: 2 additions & 0 deletions internal/confmapprovider/discovery/bundle/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ var (
"mysql",
"oracledb",
"postgresql",
"rabbitmq",
"redis",
"smartagent-collectd-mysql",
"smartagent-collectd-nginx",
Expand Down Expand Up @@ -71,6 +72,7 @@ var (
"mysql": {},
"oracledb": {},
"postgresql": {},
"rabbitmq": {},
"redis": {},
"smartagent-postgresql": {},
"sqlserver": {},
Expand Down
Loading