From 44aea189e7aa2bc033e25cf0afe75838eaf591ac Mon Sep 17 00:00:00 2001 From: Anderson Queiroz Date: Tue, 26 Sep 2023 07:55:10 +0200 Subject: [PATCH] document `process.num_threads` field --- CHANGELOG.next.asciidoc | 4 ++-- libbeat/generator/fields/module_fields_collector.go | 5 +++-- metricbeat/docs/fields.asciidoc | 12 ++++++++++++ metricbeat/module/system/_meta/fields.yml | 5 +++++ 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 13e404d7d6c9..1a8a0b63dc95 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -21,8 +21,8 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff] *Metricbeat* - - System module now collects the total thread count per process. -The elastic-agent-system-metrics was updated to v0.5.0 as the total thread count + - System module now collects the number of threads per process. +The elastic-agent-system-metrics was updated to v0.5.0 as the number of threads is collected by it. *Osquerybeat* diff --git a/libbeat/generator/fields/module_fields_collector.go b/libbeat/generator/fields/module_fields_collector.go index 5c55dea58296..85f917cacf60 100644 --- a/libbeat/generator/fields/module_fields_collector.go +++ b/libbeat/generator/fields/module_fields_collector.go @@ -19,6 +19,7 @@ package fields import ( "io/ioutil" + "os" "path/filepath" ) @@ -30,9 +31,9 @@ var indentByModule = map[string]int{ "protos": 8, } -// GetModules returns a the list of modules for the given modules directory +// GetModules returns a list of modules for the given modules directory func GetModules(modulesDir string) ([]string, error) { - moduleInfos, err := ioutil.ReadDir(modulesDir) + moduleInfos, err := os.ReadDir(modulesDir) if err != nil { return nil, err } diff --git a/metricbeat/docs/fields.asciidoc b/metricbeat/docs/fields.asciidoc index eeb15afa5ac4..4194ccf3af8d 100644 --- a/metricbeat/docs/fields.asciidoc +++ b/metricbeat/docs/fields.asciidoc @@ -60655,6 +60655,18 @@ format: percent -- +*`process.num_threads`*:: ++ +-- +The number of threads in the process. + + +type: integer + +format: number + +-- + [float] === system diff --git a/metricbeat/module/system/_meta/fields.yml b/metricbeat/module/system/_meta/fields.yml index 64a867077bdd..a721e2a67b03 100644 --- a/metricbeat/module/system/_meta/fields.yml +++ b/metricbeat/module/system/_meta/fields.yml @@ -30,6 +30,11 @@ format: percent description: > The percentage of memory the process occupied in main memory (RAM). + - name: num_threads + type: integer + format: number + description: > + The number of threads in the process. - name: system type: group description: >