Skip to content

Commit

Permalink
Merge pull request #6673 from ruflin/apache-default
Browse files Browse the repository at this point in the history
Set `status` as default metricset in Apache module
  • Loading branch information
jsoriano authored Mar 28, 2018
2 parents 2b58e4a + cb7cb82 commit 150c3a4
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 17 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ https://github.com/elastic/beats/compare/v6.0.0-beta2...master[Check the HEAD di
- Set `collector` as default metricset in Prometheus module. {pull}6636[6636]
- Set `mntr` as default metricset in Zookeeper module. {pull}6674[6674]
- Set default metricsets in vSphere module. {pull}6676[6676]
- Set `status` as default metricset in Apache module. {pull}6673[6673]
- Set `namespace` as default metricset in Aerospike module. {pull}6669[6669]

*Packetbeat*
Expand Down
6 changes: 1 addition & 5 deletions metricbeat/docs/modules/apache.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This file is generated! See scripts/docs_collector.py
== Apache module

This module periodically fetches metrics from https://httpd.apache.org/[Apache
HTTPD] servers.
HTTPD] servers. The default metricset is `status`.

[float]
=== Compatibility
Expand All @@ -33,10 +33,6 @@ in <<configuration-metricbeat>>. Here is an example configuration:
----
metricbeat.modules:
- module: apache
metricsets: ["status"]
period: 10s
# Apache hosts
hosts: ["http://127.0.0.1"]
----

Expand Down
1 change: 1 addition & 0 deletions metricbeat/metricbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ metricbeat.modules:
- module: apache
metricsets: ["status"]
period: 10s
enabled: true

# Apache hosts
hosts: ["http://127.0.0.1"]
Expand Down
1 change: 1 addition & 0 deletions metricbeat/module/apache/_meta/config.reference.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
- module: apache
metricsets: ["status"]
period: 10s
enabled: true

# Apache hosts
hosts: ["http://127.0.0.1"]
Expand Down
4 changes: 0 additions & 4 deletions metricbeat/module/apache/_meta/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
- module: apache
metricsets: ["status"]
period: 10s

# Apache hosts
hosts: ["http://127.0.0.1"]
2 changes: 1 addition & 1 deletion metricbeat/module/apache/_meta/docs.asciidoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
This module periodically fetches metrics from https://httpd.apache.org/[Apache
HTTPD] servers.
HTTPD] servers. The default metricset is `status`.

[float]
=== Compatibility
Expand Down
7 changes: 4 additions & 3 deletions metricbeat/module/apache/status/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ var (
)

func init() {
if err := mb.Registry.AddMetricSet("apache", "status", New, hostParser); err != nil {
panic(err)
}
mb.Registry.MustAddMetricSet("apache", "status", New,
mb.WithHostParser(hostParser),
mb.DefaultMetricSet(),
)
}

// MetricSet for fetching Apache HTTPD server status.
Expand Down
4 changes: 0 additions & 4 deletions metricbeat/modules.d/apache.yml.disabled
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
- module: apache
metricsets: ["status"]
period: 10s

# Apache hosts
hosts: ["http://127.0.0.1"]

0 comments on commit 150c3a4

Please sign in to comment.