Skip to content

Commit

Permalink
Make all metricsets in Kafka module defaults. (#6759)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruflin authored and jsoriano committed Apr 4, 2018
1 parent b5dc679 commit f99660e
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 76 deletions.
24 changes: 1 addition & 23 deletions metricbeat/docs/modules/kafka.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ beta[]

This is the Kafka module.

The default metricsets are `consumergroup` and `partition`.


[float]
Expand All @@ -21,30 +22,7 @@ in <<configuration-metricbeat>>. Here is an example configuration:
----
metricbeat.modules:
- module: kafka
metricsets: ["partition"]
period: 10s
hosts: ["localhost:9092"]
#client_id: metricbeat
#retries: 3
#backoff: 250ms
# List of Topics to query metadata for. If empty, all topics will be queried.
#topics: []
# Optional SSL. By default is off.
# List of root certificates for HTTPS server verifications
#ssl.certificate_authorities: ["/etc/pki/root/ca.pem"]
# Certificate for SSL client authentication
#ssl.certificate: "/etc/pki/client/cert.pem"
# Client Certificate Key
#ssl.key: "/etc/pki/client/cert.key"
# SASL authentication
#username: ""
#password: ""
----

[float]
Expand Down
3 changes: 2 additions & 1 deletion metricbeat/metricbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,10 @@ metricbeat.modules:

#-------------------------------- Kafka Module -------------------------------
- module: kafka
metricsets: ["partition"]
metricsets: ["consumergroup", "partition"]
period: 10s
hosts: ["localhost:9092"]
enabled: true

#client_id: metricbeat
#retries: 3
Expand Down
26 changes: 26 additions & 0 deletions metricbeat/module/kafka/_meta/config.reference.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
- module: kafka
metricsets: ["consumergroup", "partition"]
period: 10s
hosts: ["localhost:9092"]
enabled: true

#client_id: metricbeat
#retries: 3
#backoff: 250ms

# List of Topics to query metadata for. If empty, all topics will be queried.
#topics: []

# Optional SSL. By default is off.
# List of root certificates for HTTPS server verifications
#ssl.certificate_authorities: ["/etc/pki/root/ca.pem"]

# Certificate for SSL client authentication
#ssl.certificate: "/etc/pki/client/cert.pem"

# Client Certificate Key
#ssl.key: "/etc/pki/client/cert.key"

# SASL authentication
#username: ""
#password: ""
23 changes: 0 additions & 23 deletions metricbeat/module/kafka/_meta/config.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,2 @@
- module: kafka
metricsets: ["partition"]
period: 10s
hosts: ["localhost:9092"]

#client_id: metricbeat
#retries: 3
#backoff: 250ms

# List of Topics to query metadata for. If empty, all topics will be queried.
#topics: []

# Optional SSL. By default is off.
# List of root certificates for HTTPS server verifications
#ssl.certificate_authorities: ["/etc/pki/root/ca.pem"]

# Certificate for SSL client authentication
#ssl.certificate: "/etc/pki/client/cert.pem"

# Client Certificate Key
#ssl.key: "/etc/pki/client/cert.key"

# SASL authentication
#username: ""
#password: ""
1 change: 1 addition & 0 deletions metricbeat/module/kafka/_meta/docs.asciidoc
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
This is the Kafka module.

The default metricsets are `consumergroup` and `partition`.
6 changes: 3 additions & 3 deletions metricbeat/module/kafka/consumergroup/consumergroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (

// init registers the MetricSet with the central registry.
func init() {
if err := mb.Registry.AddMetricSet("kafka", "consumergroup", New); err != nil {
panic(err)
}
mb.Registry.MustAddMetricSet("kafka", "consumergroup", New,
mb.DefaultMetricSet(),
)
}

// MetricSet type defines all fields of the MetricSet
Expand Down
7 changes: 4 additions & 3 deletions metricbeat/module/kafka/partition/partition.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ import (

// init registers the partition MetricSet with the central registry.
func init() {
if err := mb.Registry.AddMetricSet("kafka", "partition", New, parse.PassThruHostParser); err != nil {
panic(err)
}
mb.Registry.MustAddMetricSet("kafka", "partition", New,
mb.WithHostParser(parse.PassThruHostParser),
mb.DefaultMetricSet(),
)
}

// MetricSet type defines all fields of the partition MetricSet
Expand Down
23 changes: 0 additions & 23 deletions metricbeat/modules.d/kafka.yml.disabled
Original file line number Diff line number Diff line change
@@ -1,25 +1,2 @@
- module: kafka
metricsets: ["partition"]
period: 10s
hosts: ["localhost:9092"]

#client_id: metricbeat
#retries: 3
#backoff: 250ms

# List of Topics to query metadata for. If empty, all topics will be queried.
#topics: []

# Optional SSL. By default is off.
# List of root certificates for HTTPS server verifications
#ssl.certificate_authorities: ["/etc/pki/root/ca.pem"]

# Certificate for SSL client authentication
#ssl.certificate: "/etc/pki/client/cert.pem"

# Client Certificate Key
#ssl.key: "/etc/pki/client/cert.key"

# SASL authentication
#username: ""
#password: ""

0 comments on commit f99660e

Please sign in to comment.