Skip to content

Commit

Permalink
Set stats as default metricset for memcached module (#6765)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruflin authored and jsoriano committed Apr 4, 2018
1 parent f3a5982 commit f8b9ec7
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 9 deletions.
3 changes: 1 addition & 2 deletions metricbeat/docs/modules/memcached.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ beta[]

This is the Memcached module. These metricsets were tested with Memcached version 1.4.35.

The default metricset is `stats`.


[float]
Expand All @@ -21,8 +22,6 @@ in <<configuration-metricbeat>>. Here is an example configuration:
----
metricbeat.modules:
- module: memcached
metricsets: ["stats"]
period: 10s
hosts: ["localhost:11211"]
----

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

#------------------------------- MongoDB Module ------------------------------
- module: mongodb
Expand Down
5 changes: 5 additions & 0 deletions metricbeat/module/memcached/_meta/config.reference.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- module: memcached
metricsets: ["stats"]
period: 10s
hosts: ["localhost:11211"]
enabled: true
2 changes: 0 additions & 2 deletions metricbeat/module/memcached/_meta/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
- module: memcached
metricsets: ["stats"]
period: 10s
hosts: ["localhost:11211"]
1 change: 1 addition & 0 deletions metricbeat/module/memcached/_meta/docs.asciidoc
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
This is the Memcached module. These metricsets were tested with Memcached version 1.4.35.

The default metricset is `stats`.
6 changes: 3 additions & 3 deletions metricbeat/module/memcached/stats/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
)

func init() {
if err := mb.Registry.AddMetricSet("memcached", "stats", New); err != nil {
panic(err)
}
mb.Registry.MustAddMetricSet("memcached", "stats", New,
mb.DefaultMetricSet(),
)
}

type MetricSet struct {
Expand Down
2 changes: 0 additions & 2 deletions metricbeat/modules.d/memcached.yml.disabled
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
- module: memcached
metricsets: ["stats"]
period: 10s
hosts: ["localhost:11211"]

0 comments on commit f8b9ec7

Please sign in to comment.