Skip to content

Commit

Permalink
Set all metricsets as default for Logstash module
Browse files Browse the repository at this point in the history
  • Loading branch information
ruflin committed Apr 4, 2018
1 parent b5dc679 commit fd17ae5
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 17 deletions.
5 changes: 1 addition & 4 deletions metricbeat/docs/modules/logstash.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ beta[]

This is the Logstash module.

The default metricsets are `node` and `node_stats`.


[float]
Expand All @@ -21,11 +22,7 @@ in <<configuration-metricbeat>>. Here is an example configuration:
----
metricbeat.modules:
- module: logstash
metricsets: ["node", "node_stats"]
enabled: false
period: 10s
hosts: ["localhost:9600"]
----

This module supports TLS connection when using `ssl` config field, as described in <<configuration-ssl>>.
Expand Down
3 changes: 1 addition & 2 deletions metricbeat/metricbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -351,11 +351,10 @@ metricbeat.modules:
#------------------------------ Logstash Module ------------------------------
- module: logstash
metricsets: ["node", "node_stats"]
enabled: false
enabled: true
period: 10s
hosts: ["localhost:9600"]


#------------------------------ Memcached Module -----------------------------
- module: memcached
metricsets: ["stats"]
Expand Down
5 changes: 5 additions & 0 deletions metricbeat/module/logstash/_meta/config.reference.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- module: logstash
metricsets: ["node", "node_stats"]
enabled: true
period: 10s
hosts: ["localhost:9600"]
4 changes: 0 additions & 4 deletions metricbeat/module/logstash/_meta/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
- module: logstash
metricsets: ["node", "node_stats"]
enabled: false
period: 10s
hosts: ["localhost:9600"]

1 change: 1 addition & 0 deletions metricbeat/module/logstash/_meta/docs.asciidoc
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
This is the Logstash module.

The default metricsets are `node` and `node_stats`.
7 changes: 4 additions & 3 deletions metricbeat/module/logstash/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ import (
// init registers the MetricSet with the central registry.
// The New method will be called after the setup of the module and before starting to fetch data
func init() {
if err := mb.Registry.AddMetricSet("logstash", "node", New, hostParser); err != nil {
panic(err)
}
mb.Registry.MustAddMetricSet("logstash", "node", New,
mb.WithHostParser(hostParser),
mb.DefaultMetricSet(),
)
}

var (
Expand Down
1 change: 1 addition & 0 deletions metricbeat/module/logstash/node_stats/node_stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ func init() {
mb.Registry.MustAddMetricSet(moduleName, metricsetName, New,
mb.WithHostParser(hostParser),
mb.WithNamespace(namespace),
mb.DefaultMetricSet(),
)
}

Expand Down
4 changes: 0 additions & 4 deletions metricbeat/modules.d/logstash.yml.disabled
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
- module: logstash
metricsets: ["node", "node_stats"]
enabled: false
period: 10s
hosts: ["localhost:9600"]

0 comments on commit fd17ae5

Please sign in to comment.