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: >