Skip to content

Commit

Permalink
add process filters system.process metricset (#1665)
Browse files Browse the repository at this point in the history
  • Loading branch information
Steffen Siering authored and tsg committed May 19, 2016
1 parent 234c177 commit 2de160c
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions metricbeat/docs/modules/system.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ metricbeat.modules:
metricsets: ["cpu", "cores", "filesystem", "fsstats", "memory", "process"]
enabled: true
period: 2s
processes: ['.*']
----

=== MetricSets
Expand Down
1 change: 1 addition & 0 deletions metricbeat/etc/beat.short.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,6 @@ metricbeat.modules:
metricsets: ["cpu", "cores", "filesystem", "fsstats", "memory", "process"]
enabled: true
period: 2s
processes: ['.*']


1 change: 1 addition & 0 deletions metricbeat/etc/beat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ metricbeat.modules:
metricsets: ["cpu", "cores", "filesystem", "fsstats", "memory", "process"]
enabled: true
period: 2s
processes: ['.*']

#-------------------------- Zookeeper Status Module --------------------------
- module: zookeeper
Expand Down
1 change: 1 addition & 0 deletions metricbeat/metricbeat.short.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ metricbeat.modules:
metricsets: ["cpu", "cores", "filesystem", "fsstats", "memory", "process"]
enabled: true
period: 2s
processes: ['.*']



Expand Down
1 change: 1 addition & 0 deletions metricbeat/metricbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ metricbeat.modules:
metricsets: ["cpu", "cores", "filesystem", "fsstats", "memory", "process"]
enabled: true
period: 2s
processes: ['.*']

#-------------------------- Zookeeper Status Module --------------------------
- module: zookeeper
Expand Down
1 change: 1 addition & 0 deletions metricbeat/module/system/_beat/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
metricsets: ["cpu", "cores", "filesystem", "fsstats", "memory", "process"]
enabled: true
period: 2s
processes: ['.*']
12 changes: 11 additions & 1 deletion metricbeat/module/system/process/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,21 @@ type MetricSet struct {

// New creates and returns a new MetricSet.
func New(base mb.BaseMetricSet) (mb.MetricSet, error) {
config := struct {
Procs []string `config:"processes"` // collect all processes by default
}{
Procs: []string{".*"},
}

if err := base.Module().UnpackConfig(&config); err != nil {
return nil, err
}

m := &MetricSet{
BaseMetricSet: base,
stats: &system.ProcStats{
ProcStats: true,
Procs: []string{".*"}, // Collect all processes.
Procs: config.Procs,
},
}
err := m.stats.InitProcStats()
Expand Down

0 comments on commit 2de160c

Please sign in to comment.