Skip to content

Commit

Permalink
Collect os.cgroup field, if present (#12929)
Browse files Browse the repository at this point in the history
  • Loading branch information
ycombinator authored Jul 17, 2019
1 parent eae3e45 commit d9ced76
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion metricbeat/module/logstash/node_stats/data_xpack.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,17 @@ type process struct {
CPU cpu `json:"cpu"`
}

type cgroup struct {
CPUAcct map[string]interface{} `json:"cpuacct"`
CPU struct {
Stat map[string]interface{} `json:"stat"`
ControlGroup string `json:"control_group"`
} `json:"cpu"`
}

type os struct {
CPU cpu `json:"cpu"`
CPU cpu `json:"cpu"`
CGroup cgroup `json:"cgroup,omitempty"`
}

type pipeline struct {
Expand Down Expand Up @@ -96,6 +105,7 @@ type NodeStats struct {
nodeInfo
commonStats
Process process `json:"process"`
OS os `json:"os"`
Pipelines map[string]PipelineStats `json:"pipelines"`
}

Expand Down Expand Up @@ -145,6 +155,7 @@ func eventMappingXPack(r mb.ReporterV2, m *MetricSet, content []byte) error {
cpu{
LoadAverage: nodeStats.Process.CPU.LoadAverage,
},
nodeStats.OS.CGroup,
}

var pipelines []PipelineStats
Expand Down

0 comments on commit d9ced76

Please sign in to comment.