Skip to content

Commit

Permalink
Set stubstatus as default metricset for nginx module (#6770)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsoriano authored and ruflin committed Apr 5, 2018
1 parent 1fb759c commit 15a6462
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 36 deletions.
9 changes: 2 additions & 7 deletions metricbeat/docs/modules/nginx.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ This file is generated! See scripts/docs_collector.py

This module periodically fetches metrics from https://nginx.org/[Nginx] servers.

The default metricset is `stubstatus`.


[float]
=== Compatibility
Expand All @@ -32,14 +34,7 @@ in <<configuration-metricbeat>>. Here is an example configuration:
----
metricbeat.modules:
- module: nginx
metricsets: ["stubstatus"]
period: 10s
# Nginx hosts
hosts: ["http://127.0.0.1"]
# Path to server status. Default server-status
#server_status_path: "server-status"
----

This module supports TLS connection when using `ssl` config field, as described in <<configuration-ssl>>.
Expand Down
12 changes: 6 additions & 6 deletions metricbeat/metricbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -412,16 +412,16 @@ metricbeat.modules:
#raw: false

#-------------------------------- Nginx Module -------------------------------
#- module: nginx
#metricsets: ["stubstatus"]
#enabled: true
#period: 10s
- module: nginx
metricsets: ["stubstatus"]
enabled: true
period: 10s

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

# Path to server status. Default server-status
#server_status_path: "server-status"
server_status_path: "server-status"

#------------------------------- PHP_FPM Module ------------------------------
- module: php_fpm
Expand Down
12 changes: 6 additions & 6 deletions metricbeat/module/nginx/_meta/config.reference.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#- module: nginx
#metricsets: ["stubstatus"]
#enabled: true
#period: 10s
- module: nginx
metricsets: ["stubstatus"]
enabled: true
period: 10s

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

# Path to server status. Default server-status
#server_status_path: "server-status"
server_status_path: "server-status"
7 changes: 0 additions & 7 deletions metricbeat/module/nginx/_meta/config.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,2 @@
- module: nginx
metricsets: ["stubstatus"]
period: 10s

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

# Path to server status. Default server-status
#server_status_path: "server-status"
2 changes: 2 additions & 0 deletions metricbeat/module/nginx/_meta/docs.asciidoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
This module periodically fetches metrics from https://nginx.org/[Nginx] servers.

The default metricset is `stubstatus`.


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

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

// MetricSet for fetching Nginx stub status.
Expand Down
7 changes: 0 additions & 7 deletions metricbeat/modules.d/nginx.yml.disabled
Original file line number Diff line number Diff line change
@@ -1,9 +1,2 @@
- module: nginx
metricsets: ["stubstatus"]
period: 10s

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

# Path to server status. Default server-status
#server_status_path: "server-status"

0 comments on commit 15a6462

Please sign in to comment.