diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 97bef0cfa9ea..4200ee98878d 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -424,6 +424,7 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff] - Only watch metadata for ReplicaSets in metricbeat k8s module {pull}41289[41289] - Add support for region/zone for Vertex AI service in GCP module {pull}41551[41551] - Add support for location label as an optional configuration parameter in GCP metrics metricset. {issue}41550[41550] {pull}41626[41626] +- Collect .NET CLR (IIS) Memory, Exceptions and LocksAndThreads metrics {pull}41929[41929] - Added `tier_preference`, `creation_date` and `version` fields to the `elasticsearch.index` metricset. {pull}41944[41944] - Add `use_performance_counters` to collect CPU metrics using performance counters on Windows for `system/cpu` and `system/core` {pull}41965[41965] diff --git a/metricbeat/docs/fields.asciidoc b/metricbeat/docs/fields.asciidoc index 103bdd718350..4675e0a59c7c 100644 --- a/metricbeat/docs/fields.asciidoc +++ b/metricbeat/docs/fields.asciidoc @@ -40944,6 +40944,160 @@ type: long Number of filters per sec. +type: float + +-- + +*`iis.application_pool.net_clr.exceptions_thrown_per_sec`*:: ++ +-- +Number of Exceptions Thrown / sec. + + +type: float + +-- + +[float] +=== memory + +Memory overview. + + + +*`iis.application_pool.net_clr.memory.bytes_in_all_heaps`*:: ++ +-- +Number of bytes in all heaps. + + +type: float + +-- + +*`iis.application_pool.net_clr.memory.gen_0_collections`*:: ++ +-- +Number of Gen 0 Collections. + + +type: float + +-- + +*`iis.application_pool.net_clr.memory.gen_1_collections`*:: ++ +-- +Number of Gen 1 Collections. + + +type: float + +-- + +*`iis.application_pool.net_clr.memory.gen_2_collections`*:: ++ +-- +Number of Gen 2 Collections. + + +type: float + +-- + +*`iis.application_pool.net_clr.memory.total_committed_bytes`*:: ++ +-- +Number of total committed bytes. + + +type: float + +-- + +*`iis.application_pool.net_clr.memory.allocated_bytes_per_sec`*:: ++ +-- +Allocated Bytes/sec. + + +type: float + +-- + +*`iis.application_pool.net_clr.memory.gen_0_heap_size`*:: ++ +-- +Gen 0 heap size. + + +type: float + +-- + +*`iis.application_pool.net_clr.memory.gen_1_heap_size`*:: ++ +-- +Gen 1 heap size. + + +type: float + +-- + +*`iis.application_pool.net_clr.memory.gen_2_heap_size`*:: ++ +-- +Gen 2 heap size. + + +type: float + +-- + +*`iis.application_pool.net_clr.memory.large_object_heap_size`*:: ++ +-- +Large Object Heap size. + + +type: float + +-- + +*`iis.application_pool.net_clr.memory.time_in_gc_perc`*:: ++ +-- +% Time in GC. + + +type: float + +-- + +[float] +=== locks_and_threads + +LocksAndThreads overview. + + + +*`iis.application_pool.net_clr.locks_and_threads.contention_rate_per_sec`*:: ++ +-- +Contention Rate / sec. + + +type: float + +-- + +*`iis.application_pool.net_clr.locks_and_threads.current_queue_length`*:: ++ +-- +Current Queue Length. + + type: float -- diff --git a/x-pack/metricbeat/module/iis/application_pool/_meta/data.json b/x-pack/metricbeat/module/iis/application_pool/_meta/data.json index fa737667caa9..81b37a7c2c22 100644 --- a/x-pack/metricbeat/module/iis/application_pool/_meta/data.json +++ b/x-pack/metricbeat/module/iis/application_pool/_meta/data.json @@ -9,7 +9,28 @@ "application_pool": { "name": "test.local", "net_clr": { - "total_exceptions_thrown": 0 + "total_exceptions_thrown": 0, + "finallys_per_sec": 0, + "exceptions_thrown_per_sec": 0, + "locks_and_threads": { + "current_queue_length": 0, + "contention_rate_per_sec": 0 + }, + "memory": { + "gen_2_heap_size": 0, + "large_object_heap_size": 0, + "gen_1_heap_size": 0, + "gen_1_collections": 0, + "gen_0_heap_size": 0, + "bytes_in_all_heaps": 0, + "total_committed_bytes": 0, + "gen_0_collections": 0, + "gen_2_collections": 0, + "allocated_bytes_per_sec": 0, + "time_in_gc_perc": 0 + }, + "filters_per_sec": 0, + "throw_to_catch_depth_per_sec": 0 }, "process": { "handle_count": 532, diff --git a/x-pack/metricbeat/module/iis/application_pool/_meta/fields.yml b/x-pack/metricbeat/module/iis/application_pool/_meta/fields.yml index abb62a47a432..94f020da8ccd 100644 --- a/x-pack/metricbeat/module/iis/application_pool/_meta/fields.yml +++ b/x-pack/metricbeat/module/iis/application_pool/_meta/fields.yml @@ -70,3 +70,69 @@ type: float description: > Number of filters per sec. + - name: exceptions_thrown_per_sec + type: float + description: > + Number of Exceptions Thrown / sec. + - name: memory + type: group + description: > + Memory overview. + fields: + - name: bytes_in_all_heaps + type: float + description: > + Number of bytes in all heaps. + - name: gen_0_collections + type: float + description: > + Number of Gen 0 Collections. + - name: gen_1_collections + type: float + description: > + Number of Gen 1 Collections. + - name: gen_2_collections + type: float + description: > + Number of Gen 2 Collections. + - name: total_committed_bytes + type: float + description: > + Number of total committed bytes. + - name: allocated_bytes_per_sec + type: float + description: > + Allocated Bytes/sec. + - name: gen_0_heap_size + type: float + description: > + Gen 0 heap size. + - name: gen_1_heap_size + type: float + description: > + Gen 1 heap size. + - name: gen_2_heap_size + type: float + description: > + Gen 2 heap size. + - name: large_object_heap_size + type: float + description: > + Large Object Heap size. + - name: time_in_gc_perc + type: float + description: > + % Time in GC. + - name: locks_and_threads + type: group + description: > + LocksAndThreads overview. + fields: + - name: contention_rate_per_sec + type: float + description: > + Contention Rate / sec. + - name: current_queue_length + type: float + description: > + Current Queue Length. diff --git a/x-pack/metricbeat/module/iis/application_pool/reader.go b/x-pack/metricbeat/module/iis/application_pool/reader.go index 77d377a75d6d..61522ba128f2 100644 --- a/x-pack/metricbeat/module/iis/application_pool/reader.go +++ b/x-pack/metricbeat/module/iis/application_pool/reader.go @@ -7,6 +7,7 @@ package application_pool import ( + "errors" "fmt" "strings" @@ -34,7 +35,6 @@ type Reader struct { type ApplicationPool struct { name string workerProcessIds []int - counters map[string]string } // WorkerProcess struct contains the worker process details @@ -44,21 +44,40 @@ type WorkerProcess struct { } var appPoolCounters = map[string]string{ - "process.pid": "\\Process(w3wp*)\\ID Process", - "process.cpu_usage_perc": "\\Process(w3wp*)\\% Processor Time", - "process.handle_count": "\\Process(w3wp*)\\Handle Count", - "process.thread_count": "\\Process(w3wp*)\\Thread Count", - "process.working_set": "\\Process(w3wp*)\\Working Set", - "process.private_bytes": "\\Process(w3wp*)\\Private Bytes", - "process.virtual_bytes": "\\Process(w3wp*)\\Virtual Bytes", - "process.page_faults_per_sec": "\\Process(w3wp*)\\Page Faults/sec", - "process.io_read_operations_per_sec": "\\Process(w3wp*)\\IO Read Operations/sec", - "process.io_write_operations_per_sec": "\\Process(w3wp*)\\IO Write Operations/sec", + "process.pid": "\\Process(w3wp*)\\ID Process", + "process.cpu_usage_perc": "\\Process(w3wp*)\\% Processor Time", + "process.handle_count": "\\Process(w3wp*)\\Handle Count", + "process.thread_count": "\\Process(w3wp*)\\Thread Count", + "process.working_set": "\\Process(w3wp*)\\Working Set", + "process.private_bytes": "\\Process(w3wp*)\\Private Bytes", + "process.virtual_bytes": "\\Process(w3wp*)\\Virtual Bytes", + "process.page_faults_per_sec": "\\Process(w3wp*)\\Page Faults/sec", + "process.io_read_operations_per_sec": "\\Process(w3wp*)\\IO Read Operations/sec", + "process.io_write_operations_per_sec": "\\Process(w3wp*)\\IO Write Operations/sec", + + // .NET CLR Memory + "net_clr.memory.bytes_in_all_heaps": "\\.NET CLR Memory(w3wp*)\\# Bytes in all Heaps", + "net_clr.memory.gen_0_collections": "\\.NET CLR Memory(w3wp*)\\# Gen 0 Collections", + "net_clr.memory.gen_1_collections": "\\.NET CLR Memory(w3wp*)\\# Gen 1 Collections", + "net_clr.memory.gen_2_collections": "\\.NET CLR Memory(w3wp*)\\# Gen 2 Collections", + "net_clr.memory.total_committed_bytes": "\\.NET CLR Memory(w3wp*)\\# Total committed Bytes", + "net_clr.memory.allocated_bytes_per_sec": "\\.NET CLR Memory(w3wp*)\\Allocated Bytes/sec", + "net_clr.memory.gen_0_heap_size": "\\.NET CLR Memory(w3wp*)\\Gen 0 heap size", + "net_clr.memory.gen_1_heap_size": "\\.NET CLR Memory(w3wp*)\\Gen 1 heap size", + "net_clr.memory.gen_2_heap_size": "\\.NET CLR Memory(w3wp*)\\Gen 2 heap size", + "net_clr.memory.large_object_heap_size": "\\.NET CLR Memory(w3wp*)\\Large Object Heap size", + "net_clr.memory.time_in_gc_perc": "\\.NET CLR Memory(w3wp*)\\% Time in GC", + + // .NET CLR Exceptions "net_clr.total_exceptions_thrown": "\\.NET CLR Exceptions(w3wp*)\\# of Exceps Thrown", "net_clr.exceptions_thrown_per_sec": "\\.NET CLR Exceptions(w3wp*)\\# of Exceps Thrown / sec", "net_clr.filters_per_sec": "\\.NET CLR Exceptions(w3wp*)\\# of Filters / sec", "net_clr.finallys_per_sec": "\\.NET CLR Exceptions(w3wp*)\\# of Finallys / sec", "net_clr.throw_to_catch_depth_per_sec": "\\.NET CLR Exceptions(w3wp*)\\Throw To Catch Depth / sec", + + // .NET CLR LocksAndThreads + "net_clr.locks_and_threads.contention_rate_per_sec": "\\.NET CLR LocksAndThreads(w3wp*)\\Contention Rate / sec", + "net_clr.locks_and_threads.current_queue_length": "\\.NET CLR LocksAndThreads(w3wp*)\\Current Queue Length", } // newReader creates a new instance of Reader. @@ -97,7 +116,7 @@ func (r *Reader) initAppPools() error { for key, value := range appPoolCounters { childQueries, err := r.query.GetCounterPaths(value) if err != nil { - if err == pdh.PDH_CSTATUS_NO_COUNTER || err == pdh.PDH_CSTATUS_NO_COUNTERNAME || err == pdh.PDH_CSTATUS_NO_INSTANCE || err == pdh.PDH_CSTATUS_NO_OBJECT { + if errors.Is(err, pdh.PDH_CSTATUS_NO_COUNTER) || errors.Is(err, pdh.PDH_CSTATUS_NO_COUNTERNAME) || errors.Is(err, pdh.PDH_CSTATUS_NO_INSTANCE) || errors.Is(err, pdh.PDH_CSTATUS_NO_OBJECT) { r.log.Infow("Ignoring non existent counter", "error", err, logp.Namespace("application pool"), "query", value) } else { @@ -177,7 +196,7 @@ func (r *Reader) mapEvents(values map[string][]pdh.CounterValue) map[string]mb.E // The counter has a negative value or the counter was successfully found, but the data returned is not valid. // This error can occur if the counter value is less than the previous value. (Because counter values always increment, the counter value rolls over to zero when it reaches its maximum value.) // This is not an error that stops the application from running successfully and a positive counter value should be retrieved in the later calls. - if val.Err.Error == pdh.PDH_CALC_NEGATIVE_VALUE || val.Err.Error == pdh.PDH_INVALID_DATA { + if errors.Is(val.Err.Error, pdh.PDH_CALC_NEGATIVE_VALUE) || errors.Is(val.Err.Error, pdh.PDH_INVALID_DATA) { r.log.Debugw("Counter value retrieval returned", "error", val.Err.Error, "cstatus", pdh.PdhErrno(val.Err.CStatus), logp.Namespace("application_pool"), "query", counterPath) continue diff --git a/x-pack/metricbeat/module/iis/fields.go b/x-pack/metricbeat/module/iis/fields.go index 22dc599320c7..f8b1b2729be3 100644 --- a/x-pack/metricbeat/module/iis/fields.go +++ b/x-pack/metricbeat/module/iis/fields.go @@ -19,5 +19,5 @@ func init() { // AssetIis returns asset data. // This is the base64 encoded zlib format compressed contents of module/iis. func AssetIis() string { - return "eJzsmk9v2zgTxu/+FIPemw+QwwsUfYNFgG5bNAl6JFhpbBORSJV/7Hg//YKUZFGyZMquyBqL6tBDzPL5ecgZPkPrPbzi4R4YUysAzXSB9/Du8fHp3QogR5VJVmkm+D38bwUAdhyUIjcFrgAkFkgV3sOGrlYAa4ZFru7duPfAaYntvPbRh8qOlMJUzV9Gpu9P4k9Eq6pgGbWDSSVEcRwwNrN9fLjur6Oa9fOhUwCrAJUUGSoFSlOt7ryxQ0af0/7b+6Dle8XDXsh88NkZHvvQIdPJ9K1uAzsqPQzNDOHvQr6iPIZA7FDuGO7vBgPHIuFTbSnPCySZMFyfDGrxCsE3Ix8GCO3zvEXgpvyBEsS6EVNDRm8zCiKR5kRUKF1MFalQEoXZJNu6EHSMfAbc4xewatCpQYUSFGZnCfeSaUyH6OQuYtwxqQ0tyI+DxuF+W4TqbyyFPLQ64HSmcbLKEKPoBm2gYkTJbrKPX1/AidjwZMg13eA0kt66bZZm1zsxfSZAeyFfGd8QhdMwv75ajQoo1NMolWQ7qjH61ml0QlunsrtmTU2ho2ZZC2W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