Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set default metricsets for redis module #6742

Merged
merged 1 commit into from
Apr 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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