diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 68ababee5e2..2935cb15a65 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -67,6 +67,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d - Use ingress/egress instead of inbound/outbound for system/socket metricset. {pull}22992[22992] - Change types of numeric metrics from Kubelet summary api to double so as to cover big numbers. {pull}23335[23335] - Add container.image.name and containe.name ECS fields for state_container. {pull}23802[23802] +- Add support for the MemoryPressure, DiskPressure, OutOfDisk and PIDPressure status conditions in state_node. {pull}[23905] *Packetbeat* diff --git a/metricbeat/docs/fields.asciidoc b/metricbeat/docs/fields.asciidoc index 94ded20820f..f14aea75cda 100644 --- a/metricbeat/docs/fields.asciidoc +++ b/metricbeat/docs/fields.asciidoc @@ -29833,6 +29833,46 @@ type: keyword Node unschedulable status +type: boolean + +-- + +*`kubernetes.node.status.memory_pressure`*:: ++ +-- +Node MemoryPressure status + + +type: boolean + +-- + +*`kubernetes.node.status.disk_pressure`*:: ++ +-- +Node DiskPressure status + + +type: boolean + +-- + +*`kubernetes.node.status.out_of_disk`*:: ++ +-- +Node OutOfDisk status + + +type: boolean + +-- + +*`kubernetes.node.status.pid_pressure`*:: ++ +-- +Node PIDPressure status + + type: boolean -- diff --git a/metricbeat/helper/prometheus/metric.go b/metricbeat/helper/prometheus/metric.go index a040ed65dae..5f3f1199f31 100644 --- a/metricbeat/helper/prometheus/metric.go +++ b/metricbeat/helper/prometheus/metric.go @@ -79,10 +79,11 @@ type MetricOption interface { Process(field string, value interface{}, labels common.MapStr) (string, interface{}, common.MapStr) } -// OpFilter only processes metrics matching the given filter -func OpFilter(filter map[string]string) MetricOption { - return opFilter{ - labels: filter, +// OpFilterMap only processes metrics matching the given filter +func OpFilterMap(label string, filterMap map[string]string) MetricOption { + return opFilterMap{ + label: label, + filterMap: filterMap, } } @@ -331,18 +332,22 @@ func (m *infoMetric) GetField() string { return "" } -type opFilter struct { - labels map[string]string +type opFilterMap struct { + label string + filterMap map[string]string } -// Process will return nil if labels don't match the filter -func (o opFilter) Process(field string, value interface{}, labels common.MapStr) (string, interface{}, common.MapStr) { - for k, v := range o.labels { - if labels[k] != v { - return "", nil, nil +// Called by the Prometheus helper to apply extra options on retrieved metrics +// Check whether the value of the specified label is allowed and, if yes, return the metric via the specified mapped field +// Else, if the specified label does not match the filter, return nil +// This is useful in cases where multiple Metricbeat fields need to be defined per Prometheus metric, based on label values +func (o opFilterMap) Process(field string, value interface{}, labels common.MapStr) (string, interface{}, common.MapStr) { + for k, v := range o.filterMap { + if labels[o.label] == k { + return fmt.Sprintf("%v.%v", field, v), value, labels } } - return field, value, labels + return "", nil, nil } type opLowercaseValue struct{} diff --git a/metricbeat/helper/prometheus/prometheus_test.go b/metricbeat/helper/prometheus/prometheus_test.go index 974f51f1a10..f044c2f422f 100644 --- a/metricbeat/helper/prometheus/prometheus_test.go +++ b/metricbeat/helper/prometheus/prometheus_test.go @@ -397,9 +397,36 @@ func TestPrometheus(t *testing.T) { msg: "Label metrics, filter", mapping: &MetricsMapping{ Metrics: map[string]MetricMap{ - "first_metric": LabelMetric("first.metric", "label4", OpLowercaseValue(), OpFilter(map[string]string{ - "foo": "filtered", - })), + "first_metric": LabelMetric("first.metric", "label4", OpFilterMap( + "label1", + map[string]string{"value1": "foo"}, + )), + }, + Labels: map[string]LabelMap{ + "label1": Label("labels.label1"), + }, + }, + expected: []common.MapStr{ + common.MapStr{ + "first": common.MapStr{ + "metric": common.MapStr{ + "foo": "FOO", + }, + }, + "labels": common.MapStr{ + "label1": "value1", + }, + }, + }, + }, + { + msg: "Label metrics, filter", + mapping: &MetricsMapping{ + Metrics: map[string]MetricMap{ + "first_metric": LabelMetric("first.metric", "label4", OpLowercaseValue(), OpFilterMap( + "foo", + map[string]string{"Filtered": "filtered"}, + )), }, Labels: map[string]LabelMap{ "label1": Label("labels.label1"), diff --git a/metricbeat/module/kubernetes/fields.go b/metricbeat/module/kubernetes/fields.go index b634b273cd2..3cbe65ed2bd 100644 --- a/metricbeat/module/kubernetes/fields.go +++ b/metricbeat/module/kubernetes/fields.go @@ -32,5 +32,5 @@ func init() { // AssetKubernetes returns asset data. // This is the base64 encoded gzipped contents of module/kubernetes. func AssetKubernetes() string { - return "eJzsXU9z47aSv8+nQM1psuXosLW1hzlsVeK8t8+VzDyv7ckctrYUmGxJiEmAAUB79D79FsB/IAmAoAjJHls6pDK21f1DdwNodDcaP6IH2H9ED+U9cAoSxDuEJJEZfETvf21/+P4dQimIhJNCEkY/ov96hxBC3R+gHCQnifo2hwywgI9oi98hJEBKQrfiI/rf90Jk7y/Q+52Uxfv/U7/bMS7XCaMbsv2INjgT8A6hDYEsFR81gx8RxTkM4KmP3BeKA2dlUf/EAk99ruiG8RyrHyNMUyQklkRIkgjENqhgqUA5pngLKbrfG3xWNQUTjYkIF0QAfwTe/sYGygNsIL+frq9QRdAQZfPpi7T5DKGZ8Dj8VYKQqyQjQGXvTxqcD7B/Yjwd/M6DVn0uNT0E3yAplV4bRsKLgoNgJU8gHo6bijKkyEp7CECU98fE4CI/gpGwIj4ApMmiD0lWCgn8QjMVBU7gopXOD15cj8Dv48H6x93dNRqRHFkmSyOKQvMckRzzpBKoXCtG8dVQY9As0IjFEEvK92te0ngwvoLcAUdyBw0PVAoQKOV7NGQ0BPNA6JDbAiS/Epqq1bWmPqGSvGA07hrVkEQ7TNNMrVKGULxohmv3QiRqUdck0YY1mglYJh6BC8IimkZNsEUxHuYQgpZcb3NbCKGZJDbCQ+Y5yB2LaI96YlqIjgbNREQzbEc8pNqwLThLQAgrR5sh2vZ7k15SlCsByej3Dc2UlffZcN0bDeTy+gsSkDCaDpF1nHLIGd+rbZ2kQOXqft95ZmO+GaNbyy8rv+wjcn25h+pn9UeIUNTwrDFMQXwkXJY4OyXCmuUUwE0qVqwAukpYOVr9JqH1WH8u83vgasVVBNGGZND+AeNuNQqJuYQ0gtHcVgaDBKEJ6CWmNu6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TThGQKvIUjPiPUXdYMftroZIimHzeKWkzWryB7Ngd9LBWjdszKbfTe++ErtOeN99c0C3+a/4J7eK72lYoo4G32bp/3HOlfqXjsr67bBvHSXsW87r2BWVcx6NOiU8GEstRT2r1ExZNv+sdwf79UynIMwlhZOfjPJjHA/MQBQsDYmyfFRlP5rzWc/w8AAP//D2C6lA==" } diff --git a/metricbeat/module/kubernetes/state_node/_meta/fields.yml b/metricbeat/module/kubernetes/state_node/_meta/fields.yml index ea0f952089e..b7d5f2a1920 100644 --- a/metricbeat/module/kubernetes/state_node/_meta/fields.yml +++ b/metricbeat/module/kubernetes/state_node/_meta/fields.yml @@ -15,6 +15,22 @@ type: boolean description: > Node unschedulable status + - name: memory_pressure + type: boolean + description: > + Node MemoryPressure status + - name: disk_pressure + type: boolean + description: > + Node DiskPressure status + - name: out_of_disk + type: boolean + description: > + Node OutOfDisk status + - name: pid_pressure + type: boolean + description: > + Node PIDPressure status - name: cpu type: group fields: diff --git a/metricbeat/module/kubernetes/state_node/_meta/test/ksm.v1.3.0.expected b/metricbeat/module/kubernetes/state_node/_meta/test/ksm.v1.3.0.expected index c560b169d77..38a0cc0dae1 100644 --- a/metricbeat/module/kubernetes/state_node/_meta/test/ksm.v1.3.0.expected +++ b/metricbeat/module/kubernetes/state_node/_meta/test/ksm.v1.3.0.expected @@ -29,6 +29,9 @@ } }, "status": { + "disk_pressure": "false", + "memory_pressure": "false", + "out_of_disk": "false", "ready": "true", "unschedulable": false } diff --git a/metricbeat/module/kubernetes/state_node/_meta/test/ksm.v1.8.0.expected b/metricbeat/module/kubernetes/state_node/_meta/test/ksm.v1.8.0.expected index 7b0390a04a2..371c9ca294b 100644 --- a/metricbeat/module/kubernetes/state_node/_meta/test/ksm.v1.8.0.expected +++ b/metricbeat/module/kubernetes/state_node/_meta/test/ksm.v1.8.0.expected @@ -29,6 +29,9 @@ } }, "status": { + "disk_pressure": "false", + "memory_pressure": "false", + "pid_pressure": "false", "ready": "true", "unschedulable": false } diff --git a/metricbeat/module/kubernetes/state_node/state_node.go b/metricbeat/module/kubernetes/state_node/state_node.go index bd334915240..f2a1a6b965e 100644 --- a/metricbeat/module/kubernetes/state_node/state_node.go +++ b/metricbeat/module/kubernetes/state_node/state_node.go @@ -49,12 +49,16 @@ var ( "kube_node_status_allocatable_cpu_cores": p.Metric("cpu.allocatable.cores"), "kube_node_spec_unschedulable": p.BooleanMetric("status.unschedulable"), "kube_node_status_ready": p.LabelMetric("status.ready", "condition"), - "kube_node_status_condition": p.LabelMetric("status.ready", "status", - p.OpFilter(map[string]string{ - "condition": "Ready", - })), + "kube_node_status_condition": p.LabelMetric("status", "status", p.OpFilterMap( + "condition", map[string]string{ + "Ready": "ready", + "MemoryPressure": "memory_pressure", + "DiskPressure": "disk_pressure", + "OutOfDisk": "out_of_disk", + "PIDPressure": "pid_pressure", + }, + )), }, - Labels: map[string]p.LabelMap{ "node": p.KeyLabel("name"), },