Skip to content

Commit

Permalink
Set all metricsets as default in Elasticsearch module
Browse files Browse the repository at this point in the history
  • Loading branch information
ruflin committed Apr 4, 2018
1 parent 37f9209 commit a7d327e
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 12 deletions.
4 changes: 2 additions & 2 deletions metricbeat/docs/modules/elasticsearch.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ beta[]

The Elasticsearch module contains a minimal set of metrics to enable monitoring of Elasticsearch across multiple versions. To monitor more Elasticsearch metrics, use our {monitoringdoc}/xpack-monitoring.html[X-Pack monitoring] which is available under a free basic license.

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


[float]
=== Example configuration
Expand All @@ -20,8 +22,6 @@ in <<configuration-metricbeat>>. Here is an example configuration:
----
metricbeat.modules:
- module: elasticsearch
metricsets: ["node", "node_stats"]
period: 10s
hosts: ["localhost:9200"]
----

Expand Down
4 changes: 4 additions & 0 deletions metricbeat/module/elasticsearch/_meta/config.reference.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- module: elasticsearch
metricsets: ["node", "node_stats"]
period: 10s
hosts: ["localhost:9200"]
2 changes: 0 additions & 2 deletions metricbeat/module/elasticsearch/_meta/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
- module: elasticsearch
metricsets: ["node", "node_stats"]
period: 10s
hosts: ["localhost:9200"]
2 changes: 2 additions & 0 deletions metricbeat/module/elasticsearch/_meta/docs.asciidoc
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
The Elasticsearch module contains a minimal set of metrics to enable monitoring of Elasticsearch across multiple versions. To monitor more Elasticsearch metrics, use our {monitoringdoc}/xpack-monitoring.html[X-Pack monitoring] which is available under a free basic license.

The default metricsets are `node` and `node_stats`.
7 changes: 4 additions & 3 deletions metricbeat/module/elasticsearch/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("elasticsearch", "node", New, hostParser); err != nil {
panic(err)
}
mb.Registry.MustAddMetricSet("elasticsearch", "node", New,
mb.WithHostParser(hostParser),
mb.DefaultMetricSet(),
)
}

var (
Expand Down
7 changes: 4 additions & 3 deletions metricbeat/module/elasticsearch/node_stats/node_stats.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("elasticsearch", "node_stats", New, hostParser); err != nil {
panic(err)
}
mb.Registry.MustAddMetricSet("elasticsearch", "node_stats", New,
mb.WithHostParser(hostParser),
mb.DefaultMetricSet(),
)
}

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

0 comments on commit a7d327e

Please sign in to comment.