Skip to content

Commit

Permalink
Set all metricsets as default for HAProxy module (#6758)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruflin authored and jsoriano committed Apr 4, 2018
1 parent 604e0ba commit e48e4ef
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 12 deletions.
4 changes: 2 additions & 2 deletions metricbeat/docs/modules/haproxy.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ required authentication add this to the haproxy config:
stats auth admin:admin
----

The default metricsets are `info`and `stat`.

[float]
=== Compatibility

Expand All @@ -54,8 +56,6 @@ in <<configuration-metricbeat>>. Here is an example configuration:
----
metricbeat.modules:
- module: haproxy
metricsets: ["info", "stat"]
period: 10s
hosts: ["tcp://127.0.0.1:14567"]
----

Expand Down
1 change: 1 addition & 0 deletions metricbeat/metricbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ metricbeat.modules:
metricsets: ["info", "stat"]
period: 10s
hosts: ["tcp://127.0.0.1:14567"]
enabled: true

#-------------------------------- HTTP Module --------------------------------
- module: http
Expand Down
5 changes: 5 additions & 0 deletions metricbeat/module/haproxy/_meta/config.reference.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- module: haproxy
metricsets: ["info", "stat"]
period: 10s
hosts: ["tcp://127.0.0.1:14567"]
enabled: true
2 changes: 0 additions & 2 deletions metricbeat/module/haproxy/_meta/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
- module: haproxy
metricsets: ["info", "stat"]
period: 10s
hosts: ["tcp://127.0.0.1:14567"]
2 changes: 2 additions & 0 deletions metricbeat/module/haproxy/_meta/docs.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ required authentication add this to the haproxy config:
stats auth admin:admin
----

The default metricsets are `info`and `stat`.

[float]
=== Compatibility

Expand Down
7 changes: 4 additions & 3 deletions metricbeat/module/haproxy/info/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ var (

// init registers the haproxy info MetricSet.
func init() {
if err := mb.Registry.AddMetricSet("haproxy", "info", New, haproxy.HostParser); err != nil {
panic(err)
}
mb.Registry.MustAddMetricSet("haproxy", "info", New,
mb.WithHostParser(haproxy.HostParser),
mb.DefaultMetricSet(),
)
}

// MetricSet for haproxy info.
Expand Down
7 changes: 4 additions & 3 deletions metricbeat/module/haproxy/stat/stat.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ var (

// init registers the haproxy stat MetricSet.
func init() {
if err := mb.Registry.AddMetricSet("haproxy", statsMethod, New, haproxy.HostParser); err != nil {
panic(err)
}
mb.Registry.MustAddMetricSet("haproxy", statsMethod, New,
mb.WithHostParser(haproxy.HostParser),
mb.DefaultMetricSet(),
)
}

// MetricSet for haproxy stats.
Expand Down
2 changes: 0 additions & 2 deletions metricbeat/modules.d/haproxy.yml.disabled
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
- module: haproxy
metricsets: ["info", "stat"]
period: 10s
hosts: ["tcp://127.0.0.1:14567"]

0 comments on commit e48e4ef

Please sign in to comment.