Skip to content

Commit

Permalink
Set default metricsets for system module (#6689)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsoriano authored and ruflin committed Apr 4, 2018
1 parent cf4d911 commit d2ff4bf
Show file tree
Hide file tree
Showing 19 changed files with 96 additions and 75 deletions.
27 changes: 15 additions & 12 deletions metricbeat/docs/modules/system.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ This file is generated! See scripts/docs_collector.py
The System module allows you to monitor your servers. Because the System module
always applies to the local server, the `hosts` config option is not needed.

The default metricsets are `cpu`, `load`, `memory`, `network`, `process` and
`process_summary`.

[float]
=== Dashboard

Expand All @@ -26,22 +29,16 @@ in <<configuration-metricbeat>>. Here is an example configuration:
----
metricbeat.modules:
- module: system
period: 10s
metricsets:
- cpu
- load
- memory
- network
- process
- process_summary
#- core
#- diskio
#- socket
processes: ['.*']
process.include_top_n:
by_cpu: 5 # include top 5 processes by CPU
by_memory: 5 # include top 5 processes by memory
#- module: system
# metricsets:
# - core
# - diskio
# - socket
- module: system
period: 1m
metricsets:
Expand All @@ -55,6 +52,12 @@ metricbeat.modules:
period: 15m
metricsets:
- uptime
#- module: system
# period: 5m
# metricsets:
# - raid
# raid.mount_point: '/'
----

[float]
Expand Down
4 changes: 4 additions & 0 deletions metricbeat/metricbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ metricbeat.modules:
- uptime # System Uptime
#- core # Per CPU core usage
#- diskio # Disk IO
#- raid # Raid
#- socket # Sockets and connection info (linux only)
enabled: true
period: 10s
Expand Down Expand Up @@ -106,6 +107,9 @@ metricbeat.modules:
# to false.
#process.include_cpu_ticks: false

# Raid mount point to monitor
#raid.mount_point: '/'

# Configure reverse DNS lookup on remote IP addresses in the socket metricset.
#socket.reverse_lookup.enabled: false
#socket.reverse_lookup.success_ttl: 60s
Expand Down
4 changes: 4 additions & 0 deletions metricbeat/module/system/_meta/config.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- uptime # System Uptime
#- core # Per CPU core usage
#- diskio # Disk IO
#- raid # Raid
#- socket # Sockets and connection info (linux only)
enabled: true
period: 10s
Expand Down Expand Up @@ -56,6 +57,9 @@
# to false.
#process.include_cpu_ticks: false

# Raid mount point to monitor
#raid.mount_point: '/'

# Configure reverse DNS lookup on remote IP addresses in the socket metricset.
#socket.reverse_lookup.enabled: false
#socket.reverse_lookup.success_ttl: 60s
Expand Down
24 changes: 12 additions & 12 deletions metricbeat/module/system/_meta/config.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
- module: system
period: 10s
metricsets:
- cpu
- load
- memory
- network
- process
- process_summary
#- core
#- diskio
#- socket
processes: ['.*']
process.include_top_n:
by_cpu: 5 # include top 5 processes by CPU
by_memory: 5 # include top 5 processes by memory

#- module: system
# metricsets:
# - core
# - diskio
# - socket

- module: system
period: 1m
metricsets:
Expand All @@ -28,3 +22,9 @@
period: 15m
metricsets:
- uptime

#- module: system
# period: 5m
# metricsets:
# - raid
# raid.mount_point: '/'
3 changes: 3 additions & 0 deletions metricbeat/module/system/_meta/docs.asciidoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
The System module allows you to monitor your servers. Because the System module
always applies to the local server, the `hosts` config option is not needed.

The default metricsets are `cpu`, `load`, `memory`, `network`, `process` and
`process_summary`.

[float]
=== Dashboard

Expand Down
6 changes: 3 additions & 3 deletions metricbeat/module/system/core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
)

func init() {
if err := mb.Registry.AddMetricSet("system", "core", New, parse.EmptyHostParser); err != nil {
panic(err)
}
mb.Registry.MustAddMetricSet("system", "core", New,
mb.WithHostParser(parse.EmptyHostParser),
)
}

// MetricSet for fetching system core metrics.
Expand Down
7 changes: 4 additions & 3 deletions metricbeat/module/system/cpu/cpu.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ import (
)

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

// MetricSet for fetching system CPU metrics.
Expand Down
6 changes: 3 additions & 3 deletions metricbeat/module/system/diskio/diskio.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
)

func init() {
if err := mb.Registry.AddMetricSet("system", "diskio", New, parse.EmptyHostParser); err != nil {
panic(err)
}
mb.Registry.MustAddMetricSet("system", "diskio", New,
mb.WithHostParser(parse.EmptyHostParser),
)
}

// MetricSet for fetching system disk IO metrics.
Expand Down
6 changes: 3 additions & 3 deletions metricbeat/module/system/filesystem/filesystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
var debugf = logp.MakeDebug("system.filesystem")

func init() {
if err := mb.Registry.AddMetricSet("system", "filesystem", New, parse.EmptyHostParser); err != nil {
panic(err)
}
mb.Registry.MustAddMetricSet("system", "filesystem", New,
mb.WithHostParser(parse.EmptyHostParser),
)
}

// MetricSet for fetching filesystem metrics.
Expand Down
6 changes: 3 additions & 3 deletions metricbeat/module/system/fsstat/fsstat.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import (
var debugf = logp.MakeDebug("system-fsstat")

func init() {
if err := mb.Registry.AddMetricSet("system", "fsstat", New, parse.EmptyHostParser); err != nil {
panic(err)
}
mb.Registry.MustAddMetricSet("system", "fsstat", New,
mb.WithHostParser(parse.EmptyHostParser),
)
}

// MetricSet for fetching a summary of filesystem stats.
Expand Down
7 changes: 4 additions & 3 deletions metricbeat/module/system/load/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ import (
)

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

// MetricSet for fetching system CPU load metrics.
Expand Down
7 changes: 4 additions & 3 deletions metricbeat/module/system/memory/memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ import (
)

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

// MetricSet for fetching system memory metrics.
Expand Down
7 changes: 4 additions & 3 deletions metricbeat/module/system/network/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ import (
var debugf = logp.MakeDebug("system-network")

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

// MetricSet for fetching system network IO metrics.
Expand Down
7 changes: 4 additions & 3 deletions metricbeat/module/system/process/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ import (
var debugf = logp.MakeDebug("system.process")

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

// MetricSet that fetches process metrics.
Expand Down
7 changes: 4 additions & 3 deletions metricbeat/module/system/process_summary/process_summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ import (
// init registers the MetricSet with the central registry.
// The New method will be called after the setup of the module and before starting to fetch data
func init() {
if err := mb.Registry.AddMetricSet("system", "process_summary", New, parse.EmptyHostParser); err != nil {
panic(err)
}
mb.Registry.MustAddMetricSet("system", "process_summary", New,
mb.WithHostParser(parse.EmptyHostParser),
mb.DefaultMetricSet(),
)
}

// MetricSet type defines all fields of the MetricSet
Expand Down
6 changes: 3 additions & 3 deletions metricbeat/module/system/raid/raid.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
)

func init() {
if err := mb.Registry.AddMetricSet("system", "raid", New, parse.EmptyHostParser); err != nil {
panic(err)
}
mb.Registry.MustAddMetricSet("system", "raid", New,
mb.WithHostParser(parse.EmptyHostParser),
)
}

// MetricSet contains proc fs data.
Expand Down
6 changes: 3 additions & 3 deletions metricbeat/module/system/socket/socket.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ var (
)

func init() {
if err := mb.Registry.AddMetricSet("system", "socket", New, parse.EmptyHostParser); err != nil {
panic(err)
}
mb.Registry.MustAddMetricSet("system", "socket", New,
mb.WithHostParser(parse.EmptyHostParser),
)
}

type MetricSet struct {
Expand Down
7 changes: 4 additions & 3 deletions metricbeat/module/system/uptime/metricset.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ import (
)

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

// MetricSet for fetching an OS uptime metric.
Expand Down
24 changes: 12 additions & 12 deletions metricbeat/modules.d/system.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
- module: system
period: 10s
metricsets:
- cpu
- load
- memory
- network
- process
- process_summary
#- core
#- diskio
#- socket
processes: ['.*']
process.include_top_n:
by_cpu: 5 # include top 5 processes by CPU
by_memory: 5 # include top 5 processes by memory

#- module: system
# metricsets:
# - core
# - diskio
# - socket

- module: system
period: 1m
metricsets:
Expand All @@ -28,3 +22,9 @@
period: 15m
metricsets:
- uptime

#- module: system
# period: 5m
# metricsets:
# - raid
# raid.mount_point: '/'

0 comments on commit d2ff4bf

Please sign in to comment.