Skip to content

Commit

Permalink
Set default metricsets for redis module (#6742)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsoriano authored and ruflin committed Apr 3, 2018
1 parent deb99d3 commit 37f9209
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 87 deletions.
29 changes: 2 additions & 27 deletions metricbeat/docs/modules/redis.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 http://redis.io/[Redis] servers.

The defaut metricsets are `info` and `keyspace`.

[float]
=== Module-specific configuration notes

Expand Down Expand Up @@ -41,34 +43,7 @@ in <<configuration-metricbeat>>. Here is an example configuration:
----
metricbeat.modules:
- module: redis
metricsets: ["info", "keyspace"]
period: 10s
# Redis hosts
hosts: ["127.0.0.1:6379"]
# Timeout after which time a metricset should return an error
# Timeout is by default defined as period, as a fetch of a metricset
# should never take longer then period, as otherwise calls can pile up.
#timeout: 1s
# Optional fields to be added to each event
#fields:
# datacenter: west
# Network type to be used for redis connection. Default: tcp
#network: tcp
# Max number of concurrent connections. Default: 10
#maxconn: 10
# Filters can be used to reduce the number of fields sent.
#processors:
# - include_fields:
# fields: ["beat", "metricset", "redis.info.stats"]
# Redis AUTH password. Empty by default.
#password: foobared
----

[float]
Expand Down
1 change: 1 addition & 0 deletions metricbeat/metricbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ metricbeat.modules:
#-------------------------------- Redis Module -------------------------------
- module: redis
metricsets: ["info", "keyspace"]
enabled: true
period: 10s

# Redis hosts
Expand Down
30 changes: 30 additions & 0 deletions metricbeat/module/redis/_meta/config.reference.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
- module: redis
metricsets: ["info", "keyspace"]
enabled: true
period: 10s

# Redis hosts
hosts: ["127.0.0.1:6379"]

# Timeout after which time a metricset should return an error
# Timeout is by default defined as period, as a fetch of a metricset
# should never take longer then period, as otherwise calls can pile up.
#timeout: 1s

# Optional fields to be added to each event
#fields:
# datacenter: west

# Network type to be used for redis connection. Default: tcp
#network: tcp

# Max number of concurrent connections. Default: 10
#maxconn: 10

# Filters can be used to reduce the number of fields sent.
#processors:
# - include_fields:
# fields: ["beat", "metricset", "redis.info.stats"]

# Redis AUTH password. Empty by default.
#password: foobared
27 changes: 0 additions & 27 deletions metricbeat/module/redis/_meta/config.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,2 @@
- module: redis
metricsets: ["info", "keyspace"]
period: 10s

# Redis hosts
hosts: ["127.0.0.1:6379"]

# Timeout after which time a metricset should return an error
# Timeout is by default defined as period, as a fetch of a metricset
# should never take longer then period, as otherwise calls can pile up.
#timeout: 1s

# Optional fields to be added to each event
#fields:
# datacenter: west

# Network type to be used for redis connection. Default: tcp
#network: tcp

# Max number of concurrent connections. Default: 10
#maxconn: 10

# Filters can be used to reduce the number of fields sent.
#processors:
# - include_fields:
# fields: ["beat", "metricset", "redis.info.stats"]

# Redis AUTH password. Empty by default.
#password: foobared
2 changes: 2 additions & 0 deletions metricbeat/module/redis/_meta/docs.asciidoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
This module periodically fetches metrics from http://redis.io/[Redis] servers.

The defaut metricsets are `info` and `keyspace`.

[float]
=== Module-specific configuration notes

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

func init() {
if err := mb.Registry.AddMetricSet("redis", "info", New, parse.PassThruHostParser); err != nil {
panic(err)
}
mb.Registry.MustAddMetricSet("redis", "info", New,
mb.WithHostParser(parse.PassThruHostParser),
mb.DefaultMetricSet(),
)
}

// MetricSet for fetching Redis server information and statistics.
Expand Down
7 changes: 4 additions & 3 deletions metricbeat/module/redis/keyspace/keyspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ var (
)

func init() {
if err := mb.Registry.AddMetricSet("redis", "keyspace", New, parse.PassThruHostParser); err != nil {
panic(err)
}
mb.Registry.MustAddMetricSet("redis", "keyspace", New,
mb.WithHostParser(parse.PassThruHostParser),
mb.DefaultMetricSet(),
)
}

// MetricSet for fetching Redis server information and statistics.
Expand Down
27 changes: 0 additions & 27 deletions metricbeat/modules.d/redis.yml.disabled
Original file line number Diff line number Diff line change
@@ -1,29 +1,2 @@
- module: redis
metricsets: ["info", "keyspace"]
period: 10s

# Redis hosts
hosts: ["127.0.0.1:6379"]

# Timeout after which time a metricset should return an error
# Timeout is by default defined as period, as a fetch of a metricset
# should never take longer then period, as otherwise calls can pile up.
#timeout: 1s

# Optional fields to be added to each event
#fields:
# datacenter: west

# Network type to be used for redis connection. Default: tcp
#network: tcp

# Max number of concurrent connections. Default: 10
#maxconn: 10

# Filters can be used to reduce the number of fields sent.
#processors:
# - include_fields:
# fields: ["beat", "metricset", "redis.info.stats"]

# Redis AUTH password. Empty by default.
#password: foobared

0 comments on commit 37f9209

Please sign in to comment.