Skip to content

Commit

Permalink
kafka discovery and configs
Browse files Browse the repository at this point in the history
  • Loading branch information
greatestusername committed Nov 8, 2023
1 parent cb8e08e commit 23c6ff9
Show file tree
Hide file tree
Showing 14 changed files with 562 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#####################################################################################
# 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. #
#####################################################################################
# smartagent/collectd/kafka_broker:
# enabled: true
# rule:
# docker_observer: type == "container" and any([name, image, command], {# matches "(?i)kafka-broker"}) and not (command matches "splunk.discovery")
# host_observer: type == "hostport" and command matches "(?i)kafka-broker"
# k8s_observer: type == "port" and pod.name matches "(?i)kafka-broker"
# config:
# default:
# type: collectd/kafka
# extraMetrics: ["*"]
# isolatedCollectd: true
# status:
# metrics:
# successful:
# - strict: counter.kafka-bytes-in
# first_only: true
# log_record:
# severity_text: info
# body: smartagent/collectd/kafka receiver is working!
# statements:
# failed:
# - regexp: "Creating MBean server connection failed"
# first_only: true
# log_record:
# severity_text: info
# append_pattern: true
# body: The container is unable to connnect to the MBean server to retrieve kafka metrics.
# - regexp: "java.rmi.UnknownHostException: Unknown host"
# first_only: true
# log_record:
# severity_text: info
# append_pattern: true
# body: Kafka host was discovered but is unresolvable.
# partial:
# - regexp: "clusterName is a required field"
# first_only: true
# log_record:
# severity_text: info
# append_pattern: true
# body: >-
# Make sure your Kafka clusterName is correctly specified using the
# `--set splunk.discovery.receivers.smartagent/collectd/kafka_broker.config.clusterName="<clusterName>"` command or the
# `SPLUNK_DISCOVERY_RECEIVERS_smartagent_x2f_collectd_x2f_kafka_x5f_broker_CONFIG_clusterName="<clusterName>"` environment variable.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#####################################################################################
# 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. #
#####################################################################################
# smartagent/collectd/kafka_consumer:
# enabled: true
# rule:
# docker_observer: type == "container" and any([name, image, command], {# matches "(?i)kafka-consumer"}) and not (command matches "splunk.discovery")
# host_observer: type == "hostport" and command matches "(?i)kafka-consumer"
# k8s_observer: type == "port" and pod.name matches "(?i)kafka-consumer"
# config:
# default:
# type: collectd/kafka_consumer
# extraMetrics: ["*"]
# isolatedCollectd: true
# status:
# metrics:
# successful:
# - strict: gauge.kafka.consumer.bytes-consumed-rate
# first_only: true
# log_record:
# severity_text: info
# body: smartagent/collectd/kafka_consumer receiver is working!
# statements:
# failed:
# - regexp: "Creating MBean server connection failed"
# first_only: true
# log_record:
# severity_text: info
# append_pattern: true
# body: The container is unable to connnect to the MBean server to retrieve kafka metrics.
# - regexp: "java.rmi.UnknownHostException: Unknown host"
# first_only: true
# log_record:
# severity_text: info
# append_pattern: true
# body: Kafka host was discovered but is unresolvable.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#####################################################################################
# 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. #
#####################################################################################
# smartagent/collectd/kafka_producer:
# enabled: true
# rule:
# docker_observer: type == "container" and any([name, image, command], {# matches "(?i)kafka-producer"}) and not (command matches "splunk.discovery")
# host_observer: type == "hostport" and command matches "(?i)kafka-producer"
# k8s_observer: type == "port" and pod.name matches "(?i)kafka-producer"
# config:
# default:
# type: collectd/kafka_producer
# extraMetrics: ["*"]
# isolatedCollectd: true
# status:
# metrics:
# successful:
# - strict: gauge.kafka.producer.byte-rate
# first_only: true
# log_record:
# severity_text: info
# body: smartagent/collectd/kafka_producer receiver is working!
# statements:
# failed:
# - regexp: "Creating MBean server connection failed"
# first_only: true
# log_record:
# severity_text: info
# append_pattern: true
# body: The container is unable to connnect to the MBean server to retrieve kafka metrics.
# - regexp: "java.rmi.UnknownHostException: Unknown host"
# first_only: true
# log_record:
# severity_text: info
# append_pattern: true
# body: Kafka host was discovered but is unresolvable.
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#####################################################################################
# Do not edit manually! #
# All changes must be made to associated .tmpl file before running 'make bundle.d'. #
#####################################################################################
smartagent/collectd/kafka_broker:
enabled: true
rule:
docker_observer: type == "container" and any([name, image, command], {# matches "(?i)kafka-broker"}) and not (command matches "splunk.discovery")
host_observer: type == "hostport" and command matches "(?i)kafka-broker"
k8s_observer: type == "port" and pod.name matches "(?i)kafka-broker"
config:
default:
type: collectd/kafka
extraMetrics: ["*"]
isolatedCollectd: true
status:
metrics:
successful:
- strict: counter.kafka-bytes-in
first_only: true
log_record:
severity_text: info
body: smartagent/collectd/kafka receiver is working!
statements:
failed:
- regexp: "Creating MBean server connection failed"
first_only: true
log_record:
severity_text: info
append_pattern: true
body: The container is unable to connnect to the MBean server to retrieve kafka metrics.
- regexp: "java.rmi.UnknownHostException: Unknown host"
first_only: true
log_record:
severity_text: info
append_pattern: true
body: Kafka host was discovered but is unresolvable.
partial:
- regexp: "clusterName is a required field"
first_only: true
log_record:
severity_text: info
append_pattern: true
body: >-
Make sure your Kafka clusterName is correctly specified using the
`--set splunk.discovery.receivers.smartagent/collectd/kafka_broker.config.clusterName="<clusterName>"` command or the
`SPLUNK_DISCOVERY_RECEIVERS_smartagent_x2f_collectd_x2f_kafka_x5f_broker_CONFIG_clusterName="<clusterName>"` environment variable.
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{{ receiver "smartagent/collectd/kafka_broker" }}:
enabled: true
rule:
docker_observer: type == "container" and any([name, image, command], {# matches "(?i)kafka-broker"}) and not (command matches "splunk.discovery")
host_observer: type == "hostport" and command matches "(?i)kafka-broker"
k8s_observer: type == "port" and pod.name matches "(?i)kafka-broker"
config:
default:
type: collectd/kafka
extraMetrics: ["*"]
isolatedCollectd: true
status:
metrics:
successful:
- strict: counter.kafka-bytes-in
first_only: true
log_record:
severity_text: info
body: smartagent/collectd/kafka receiver is working!
statements:
failed:
- regexp: "Creating MBean server connection failed"
first_only: true
log_record:
severity_text: info
append_pattern: true
body: The container is unable to connnect to the MBean server to retrieve kafka metrics.
- regexp: "java.rmi.UnknownHostException: Unknown host"
first_only: true
log_record:
severity_text: info
append_pattern: true
body: Kafka host was discovered but is unresolvable.
partial:
- regexp: "clusterName is a required field"
first_only: true
log_record:
severity_text: info
append_pattern: true
body: >-
Make sure your Kafka clusterName is correctly specified using the
`--set {{ configProperty "clusterName" "<clusterName>" }}` command or the
`{{ configPropertyEnvVar "clusterName" "<clusterName>" }}` environment variable.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#####################################################################################
# Do not edit manually! #
# All changes must be made to associated .tmpl file before running 'make bundle.d'. #
#####################################################################################
smartagent/collectd/kafka_consumer:
enabled: true
rule:
docker_observer: type == "container" and any([name, image, command], {# matches "(?i)kafka-consumer"}) and not (command matches "splunk.discovery")
host_observer: type == "hostport" and command matches "(?i)kafka-consumer"
k8s_observer: type == "port" and pod.name matches "(?i)kafka-consumer"
config:
default:
type: collectd/kafka_consumer
extraMetrics: ["*"]
isolatedCollectd: true
status:
metrics:
successful:
- strict: gauge.kafka.consumer.bytes-consumed-rate
first_only: true
log_record:
severity_text: info
body: smartagent/collectd/kafka_consumer receiver is working!
statements:
failed:
- regexp: "Creating MBean server connection failed"
first_only: true
log_record:
severity_text: info
append_pattern: true
body: The container is unable to connnect to the MBean server to retrieve kafka metrics.
- regexp: "java.rmi.UnknownHostException: Unknown host"
first_only: true
log_record:
severity_text: info
append_pattern: true
body: Kafka host was discovered but is unresolvable.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{{ receiver "smartagent/collectd/kafka_consumer" }}:
enabled: true
rule:
docker_observer: type == "container" and any([name, image, command], {# matches "(?i)kafka-consumer"}) and not (command matches "splunk.discovery")
host_observer: type == "hostport" and command matches "(?i)kafka-consumer"
k8s_observer: type == "port" and pod.name matches "(?i)kafka-consumer"
config:
default:
type: collectd/kafka_consumer
extraMetrics: ["*"]
isolatedCollectd: true
status:
metrics:
successful:
- strict: gauge.kafka.consumer.bytes-consumed-rate
first_only: true
log_record:
severity_text: info
body: smartagent/collectd/kafka_consumer receiver is working!
statements:
failed:
- regexp: "Creating MBean server connection failed"
first_only: true
log_record:
severity_text: info
append_pattern: true
body: The container is unable to connnect to the MBean server to retrieve kafka metrics.
- regexp: "java.rmi.UnknownHostException: Unknown host"
first_only: true
log_record:
severity_text: info
append_pattern: true
body: Kafka host was discovered but is unresolvable.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#####################################################################################
# Do not edit manually! #
# All changes must be made to associated .tmpl file before running 'make bundle.d'. #
#####################################################################################
smartagent/collectd/kafka_producer:
enabled: true
rule:
docker_observer: type == "container" and any([name, image, command], {# matches "(?i)kafka-producer"}) and not (command matches "splunk.discovery")
host_observer: type == "hostport" and command matches "(?i)kafka-producer"
k8s_observer: type == "port" and pod.name matches "(?i)kafka-producer"
config:
default:
type: collectd/kafka_producer
extraMetrics: ["*"]
isolatedCollectd: true
status:
metrics:
successful:
- strict: gauge.kafka.producer.byte-rate
first_only: true
log_record:
severity_text: info
body: smartagent/collectd/kafka_producer receiver is working!
statements:
failed:
- regexp: "Creating MBean server connection failed"
first_only: true
log_record:
severity_text: info
append_pattern: true
body: The container is unable to connnect to the MBean server to retrieve kafka metrics.
- regexp: "java.rmi.UnknownHostException: Unknown host"
first_only: true
log_record:
severity_text: info
append_pattern: true
body: Kafka host was discovered but is unresolvable.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{{ receiver "smartagent/collectd/kafka_producer" }}:
enabled: true
rule:
docker_observer: type == "container" and any([name, image, command], {# matches "(?i)kafka-producer"}) and not (command matches "splunk.discovery")
host_observer: type == "hostport" and command matches "(?i)kafka-producer"
k8s_observer: type == "port" and pod.name matches "(?i)kafka-producer"
config:
default:
type: collectd/kafka_producer
extraMetrics: ["*"]
isolatedCollectd: true
status:
metrics:
successful:
- strict: gauge.kafka.producer.byte-rate
first_only: true
log_record:
severity_text: info
body: smartagent/collectd/kafka_producer receiver is working!
statements:
failed:
- regexp: "Creating MBean server connection failed"
first_only: true
log_record:
severity_text: info
append_pattern: true
body: The container is unable to connnect to the MBean server to retrieve kafka metrics.
- regexp: "java.rmi.UnknownHostException: Unknown host"
first_only: true
log_record:
severity_text: info
append_pattern: true
body: Kafka host was discovered but is unresolvable.
6 changes: 6 additions & 0 deletions internal/confmapprovider/discovery/bundle/bundle_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
//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/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-kafka-broker.discovery.yaml.tmpl
//go:generate discoverybundler -r -c -d ../../../../cmd/otelcol/config/collector/config.d.linux/receivers -t bundle.d/receivers/smartagent-collectd-kafka-broker.discovery.yaml.tmpl
//go:generate discoverybundler -r -t bundle.d/receivers/smartagent-collectd-kafka-producer.discovery.yaml.tmpl
//go:generate discoverybundler -r -c -d ../../../../cmd/otelcol/config/collector/config.d.linux/receivers -t bundle.d/receivers/smartagent-collectd-kafka-producer.discovery.yaml.tmpl
//go:generate discoverybundler -r -t bundle.d/receivers/smartagent-collectd-kafka-consumer.discovery.yaml.tmpl
//go:generate discoverybundler -r -c -d ../../../../cmd/otelcol/config/collector/config.d.linux/receivers -t bundle.d/receivers/smartagent-collectd-kafka-consumer.discovery.yaml.tmpl

//go:generate discoverybundler -r -t bundle.d/extensions/docker-observer.discovery.yaml.tmpl
//go:generate discoverybundler -r -c -d ../../../../cmd/otelcol/config/collector/config.d.linux/extensions -t bundle.d/extensions/docker-observer.discovery.yaml.tmpl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ func TestBundleDir(t *testing.T) {
require.Equal(t, []string{
"bundle.d/receivers/oracledb.discovery.yaml",
"bundle.d/receivers/redis.discovery.yaml",
"bundle.d/receivers/smartagent-collectd-kafka-broker.discovery.yaml",
"bundle.d/receivers/smartagent-collectd-kafka-consumer.discovery.yaml",
"bundle.d/receivers/smartagent-collectd-kafka-producer.discovery.yaml",
"bundle.d/receivers/smartagent-collectd-mysql.discovery.yaml",
"bundle.d/receivers/smartagent-collectd-nginx.discovery.yaml",
"bundle.d/receivers/smartagent-postgresql.discovery.yaml",
Expand Down
Loading

0 comments on commit 23c6ff9

Please sign in to comment.