Skip to content

Commit

Permalink
Add memory/cgroup fields to metricbeat Kibana module (#37232)
Browse files Browse the repository at this point in the history
* Add memory/cgroup fields to metricbeat Kibana module

* update changelog
  • Loading branch information
pgayvallet authored Nov 30, 2023
1 parent d9139c9 commit 20ee67c
Show file tree
Hide file tree
Showing 6 changed files with 250 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ Setting environmental variable ELASTIC_NETINFO:false in Elastic Agent pod will d
- Align on the algorithm used to transform Prometheus histograms into Elasticsearch histograms {pull}36647[36647]
- Enhance GCP billing with detailed tables identification, additional fields, and optimized data handling. {pull}36902[36902]
- Add a `/inputs/` route to the HTTP monitoring endpoint that exposes metrics for each metricset instance. {pull}36971[36971]

- Add new memory/cgroup metrics to Kibana module {pull}37232[37232]

*Osquerybeat*

Expand Down
44 changes: 44 additions & 0 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -42743,6 +42743,36 @@ type: long
--


*`kibana.stats.os.cpuacct.control_group`*::
+
--
type: keyword

--

*`kibana.stats.os.cpuacct.usage_nanos`*::
+
--
type: long

--


*`kibana.stats.os.cgroup_memory.current_in_bytes`*::
+
--
type: long

--

*`kibana.stats.os.cgroup_memory.swap_current_in_bytes`*::
+
--
type: long

--


*`kibana.stats.os.load.1m`*::
+
--
Expand Down Expand Up @@ -42788,6 +42818,20 @@ type: long

--

*`kibana.stats.process.memory.array_buffers.bytes`*::
+
--
type: long

--

*`kibana.stats.process.memory.external.bytes`*::
+
--
type: long

--

*`kibana.stats.process.uptime.ms`*::
+
--
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/module/kibana/fields.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions metricbeat/module/kibana/stats/_meta/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,20 @@
type: long
- name: used_in_bytes
type: long
- name: cpuacct
type: group
fields:
- name: control_group
type: keyword
- name: usage_nanos
type: long
- name: cgroup_memory
type: group
fields:
- name: current_in_bytes
type: long
- name: swap_current_in_bytes
type: long
- name: load
type: group
fields:
Expand All @@ -92,6 +106,10 @@
fields:
- name: memory.resident_set_size.bytes
type: long
- name: memory.array_buffers.bytes
type: long
- name: memory.external.bytes
type: long
- name: uptime.ms
type: long
- name: event_loop_delay.ms
Expand Down
172 changes: 172 additions & 0 deletions metricbeat/module/kibana/stats/_meta/test/stats.8120.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
{
"kibana":{
"uuid":"5b2de169-2785-441b-ae8c-186a1936b17d",
"name":"Shaunaks-MBP-2",
"index":".kibana",
"host":"localhost",
"transport_address":"localhost:5601",
"version":"7.0.0-alpha1",
"snapshot":false,
"status":"green"
},
"last_updated":"2018-07-18T00:32:00.948Z",
"collection_interval_ms":5000,
"process":{
"memory":{
"heap":{
"total_bytes":223391744,
"used_bytes":198413592,
"size_limit":1501560832
},
"resident_set_size_bytes":347242496,
"array_buffers_bytes": 6472439291,
"external_bytes": 953799759
},
"event_loop_delay":0.25226891040802,
"event_loop_utilization": {
"active": 629.1224170000005,
"idle": 359.23554199999995,
"utilization": 0.6365329598160299
},
"pid":46426,
"uptime_ms":1753889
},
"os":{
"load":{
"1m":3.50634765625,
"5m":3.76904296875,
"15m":3.54833984375
},
"memory":{
"total_bytes":17179869184,
"free_bytes":31711232,
"used_bytes":17148157952
},
"uptime_ms":2187246000,
"cpuacct": {
"control_group": "cgroup",
"usage_nanos": 56789873
},
"cgroup_memory": {
"current_bytes": 97647654,
"swap_current_bytes": 40765796
}
},
"elasticsearch_client": {
"protocol": "http",
"connected_nodes": 2,
"nodes_with_active_sockets": 2,
"nodes_with_idle_sockets": 1,
"total_active_sockets": 14,
"total_idle_sockets": 42,
"total_queued_requests": 0,
"most_active_node_sockets": 10,
"average_active_sockets_per_node": 7,
"most_idle_node_sockets": 42,
"average_idle_sockets_per_node": 21
},
"response_times":{
"max_ms":0
},
"requests":{
"total":0,
"disconnects":0,
"status_codes":{

}
},
"concurrent_connections":3,
"usage":{
"kibana":{
"index":".kibana",
"dashboard":{
"total":0
},
"visualization":{
"total":0
},
"search":{
"total":0
},
"index_pattern":{
"total":0
},
"graph_workspace":{
"total":0
},
"timelion_sheet":{
"total":0
}
},
"reporting":{
"available":true,
"enabled":true,
"browser_type":"phantom",
"all":0,
"csv":{
"available":true,
"total":0
},
"printable_pdf":{
"available":true,
"total":0,
"app":{
"visualization":0,
"dashboard":0
},
"layout":{
"print":0,
"preserve_layout":0
}
},
"status":{

},
"last_day":{
"all":0,
"csv":{
"available":true,
"total":0
},
"printable_pdf":{
"available":true,
"total":0,
"app":{
"visualization":0,
"dashboard":0
},
"layout":{
"print":0,
"preserve_layout":0
}
},
"status":{

}
},
"last_7_days":{
"all":0,
"csv":{
"available":true,
"total":0
},
"printable_pdf":{
"available":true,
"total":0,
"app":{
"visualization":0,
"dashboard":0
},
"layout":{
"print":0,
"preserve_layout":0
}
},
"status":{

}
}
}
},
"cluster_uuid":"NkfU5AinRnyFnqBD36zhEw"
}
14 changes: 14 additions & 0 deletions metricbeat/module/kibana/stats/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ var (
"distroRelease": c.Str("distro_release", s.Optional),
"platform": c.Str("platform", s.Optional),
"platformRelease": c.Str("platform_release", s.Optional),
"cpuacct": c.Dict("cpuacct", s.Schema{
"control_group": c.Str("control_group"),
"usage_nanos": c.Int("usage_nanos"),
}, c.DictOptional),
"cgroup_memory": c.Dict("cgroup_memory", s.Schema{
"current_in_bytes": c.Int("current_bytes"),
"swap_current_in_bytes": c.Int("swap_current_bytes"),
}, c.DictOptional),
}),
"kibana": c.Ifc("kibana"),
"elasticsearch_client": c.Dict("elasticsearch_client", s.Schema{
Expand Down Expand Up @@ -77,6 +85,12 @@ var (
"resident_set_size": s.Object{
"bytes": c.Int("resident_set_size_bytes"),
},
"array_buffers": s.Object{
"bytes": c.Int("array_buffers_bytes", s.Optional),
},
"external": s.Object{
"bytes": c.Int("external_bytes", s.Optional),
},
"heap": c.Dict("heap", s.Schema{
"total": s.Object{
"bytes": c.Int("total_bytes"),
Expand Down

0 comments on commit 20ee67c

Please sign in to comment.