diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 86520d4795f1..98e254f70ea4 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -218,6 +218,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d - Add `key/value` mode for SQL module. {issue}15770[15770] {pull]15845[15845] - Add support for Unix socket in Memcached metricbeat module. {issue}13685[13685] {pull}15822[15822] - Make the `system/cpu` metricset collect normalized CPU metrics by default. {issue}15618[15618] {pull}15729[15729] +- Add kubernetes storage class support via kube-state-metrics. {pull}16145[16145] - Add `up` metric to prometheus metrics collected from host {pull}15948[15948] - Add citadel metricset for Istio Metricbeat module {pull}15990[15990] - Add support for processors in light modules. {issue}14740[14740] {pull}15923[15923] diff --git a/metricbeat/docs/fields.asciidoc b/metricbeat/docs/fields.asciidoc index 335a946a3fb4..683286737939 100644 --- a/metricbeat/docs/fields.asciidoc +++ b/metricbeat/docs/fields.asciidoc @@ -22495,6 +22495,58 @@ type: long -- +[float] +=== storageclass + +kubernetes storage class metrics + + + +*`kubernetes.storageclass.name`*:: ++ +-- +Storage class name. + +type: keyword + +-- + +*`kubernetes.storageclass.provisioner`*:: ++ +-- +Volume provisioner for the storage class. + +type: keyword + +-- + +*`kubernetes.storageclass.reclaim_policy`*:: ++ +-- +Reclaim policy for dynamically created volumes + +type: keyword + +-- + +*`kubernetes.storageclass.volume_binding_mode`*:: ++ +-- +Mode for default provisioning and binding + +type: keyword + +-- + +*`kubernetes.storageclass.created`*:: ++ +-- +Storage class creation date + +type: date + +-- + [float] === system diff --git a/metricbeat/docs/modules/kubernetes.asciidoc b/metricbeat/docs/modules/kubernetes.asciidoc index 5d322520b0cc..c15a096c3982 100644 --- a/metricbeat/docs/modules/kubernetes.asciidoc +++ b/metricbeat/docs/modules/kubernetes.asciidoc @@ -99,6 +99,7 @@ metricbeat.modules: - state_service - state_persistentvolume - state_persistentvolumeclaim + - state_storageclass period: 10s hosts: ["kube-state-metrics:8080"] @@ -196,6 +197,8 @@ The following metricsets are available: * <> +* <> + * <> * <> @@ -236,6 +239,8 @@ include::kubernetes/state_service.asciidoc[] include::kubernetes/state_statefulset.asciidoc[] +include::kubernetes/state_storageclass.asciidoc[] + include::kubernetes/system.asciidoc[] include::kubernetes/volume.asciidoc[] diff --git a/metricbeat/docs/modules/kubernetes/state_storageclass.asciidoc b/metricbeat/docs/modules/kubernetes/state_storageclass.asciidoc new file mode 100644 index 000000000000..02aec973cd97 --- /dev/null +++ b/metricbeat/docs/modules/kubernetes/state_storageclass.asciidoc @@ -0,0 +1,23 @@ +//// +This file is generated! See scripts/mage/docs_collector.go +//// + +[[metricbeat-metricset-kubernetes-state_storageclass]] +=== Kubernetes state_storageclass metricset + +experimental[] + +include::../../../module/kubernetes/state_storageclass/_meta/docs.asciidoc[] + + +==== Fields + +For a description of each field in the metricset, see the +<> section. + +Here is an example document generated by this metricset: + +[source,json] +---- +include::../../../module/kubernetes/state_storageclass/_meta/data.json[] +---- diff --git a/metricbeat/docs/modules_list.asciidoc b/metricbeat/docs/modules_list.asciidoc index 36d0102658a8..92dcd853b068 100644 --- a/metricbeat/docs/modules_list.asciidoc +++ b/metricbeat/docs/modules_list.asciidoc @@ -121,7 +121,7 @@ This file is generated! See scripts/mage/docs_collector.go .2+| .2+| |<> |<> |<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.20+| .20+| |<> +.21+| .21+| |<> |<> |<> beta[] |<> @@ -139,6 +139,7 @@ This file is generated! See scripts/mage/docs_collector.go |<> beta[] |<> experimental[] |<> +|<> experimental[] |<> |<> |<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | diff --git a/metricbeat/include/list_docker.go b/metricbeat/include/list_docker.go index b1cc337aa80b..f0015d31b3b6 100644 --- a/metricbeat/include/list_docker.go +++ b/metricbeat/include/list_docker.go @@ -51,6 +51,7 @@ import ( _ "github.com/elastic/beats/metricbeat/module/kubernetes/state_resourcequota" _ "github.com/elastic/beats/metricbeat/module/kubernetes/state_service" _ "github.com/elastic/beats/metricbeat/module/kubernetes/state_statefulset" + _ "github.com/elastic/beats/metricbeat/module/kubernetes/state_storageclass" _ "github.com/elastic/beats/metricbeat/module/kubernetes/system" _ "github.com/elastic/beats/metricbeat/module/kubernetes/volume" ) diff --git a/metricbeat/metricbeat.reference.yml b/metricbeat/metricbeat.reference.yml index 246a8d71bc31..390a5408e583 100644 --- a/metricbeat/metricbeat.reference.yml +++ b/metricbeat/metricbeat.reference.yml @@ -482,6 +482,7 @@ metricbeat.modules: - state_service - state_persistentvolume - state_persistentvolumeclaim + - state_storageclass period: 10s hosts: ["kube-state-metrics:8080"] diff --git a/metricbeat/module/kubernetes/_meta/config.reference.yml b/metricbeat/module/kubernetes/_meta/config.reference.yml index 6abf381e6dab..10de0447725d 100644 --- a/metricbeat/module/kubernetes/_meta/config.reference.yml +++ b/metricbeat/module/kubernetes/_meta/config.reference.yml @@ -39,6 +39,7 @@ - state_service - state_persistentvolume - state_persistentvolumeclaim + - state_storageclass period: 10s hosts: ["kube-state-metrics:8080"] diff --git a/metricbeat/module/kubernetes/_meta/config.yml b/metricbeat/module/kubernetes/_meta/config.yml index f242454913bd..0325d0891e13 100644 --- a/metricbeat/module/kubernetes/_meta/config.yml +++ b/metricbeat/module/kubernetes/_meta/config.yml @@ -38,6 +38,7 @@ # - state_service # - state_persistentvolume # - state_persistentvolumeclaim +# - state_storageclass # period: 10s # hosts: ["kube-state-metrics:8080"] # add_metadata: true diff --git a/metricbeat/module/kubernetes/fields.go b/metricbeat/module/kubernetes/fields.go index cd71a0d67052..c2f2f6e6b62b 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 ../metricbeat/module/kubernetes. func AssetKubernetes() string { - return "eJzsXU9z27iSv+dToHLKbHl02NraQw5bNeN5r54rmTyvncwctrY0ENmSMCYBDgDa0fv0rwD+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Rz6pWTZ8D8OwAA//8mifwG" } diff --git a/metricbeat/module/kubernetes/state_storageclass/README.md b/metricbeat/module/kubernetes/state_storageclass/README.md new file mode 100644 index 000000000000..8223563fefc5 --- /dev/null +++ b/metricbeat/module/kubernetes/state_storageclass/README.md @@ -0,0 +1,47 @@ +# Kube-state-metrics/StorageClass + +This metricset connects to kube-state-metrics endpoint to retrieve and report Storage Class metrics. + +Interestingly enough kube-state-metrics does not repport annotations, we are unable to inform which storage class is default. We can consider enriching adding that info, or contributing back to kube-state-metrics to add annotations. + +## Version history + +- February 2020, first release using kube-state-metrics `v1.8.0`. + +## Configuration + +See the metricset documentation for the configuration reference. + +## Manual testing + +Probably your kubernetes cluster already has a storage class. You can add extra SCs: + +Example: + +```bash +kubectl apply -f - << EOF +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: beats-test-sc1 + labels: + testl1: value1 + testl2: value2 +provisioner: kubernetes.io/non-existing1 +reclaimPolicy: Retain +volumeBindingMode: WaitForFirstConsumer +--- +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: beats-test-sc2 + labels: + testl3: value3 + testl4: value4 +provisioner: kubernetes.io/non-existing2 +reclaimPolicy: Delete +volumeBindingMode: Immediate +EOF +``` + +Then run metricbeat pointing to the kube-state-metrics endpoint. diff --git a/metricbeat/module/kubernetes/state_storageclass/_meta/data.json b/metricbeat/module/kubernetes/state_storageclass/_meta/data.json new file mode 100644 index 000000000000..f8dcdfb1bdb0 --- /dev/null +++ b/metricbeat/module/kubernetes/state_storageclass/_meta/data.json @@ -0,0 +1,47 @@ +{ + "@timestamp": "2020-02-07T17:10:12.124Z", + "@metadata": { + "beat": "metricbeat", + "type": "_doc", + "version": "8.0.0" + }, + "service": { + "address": "192.168.39.32:32042", + "type": "kubernetes" + }, + "kubernetes": { + "storageclass": { + "volume_binding_mode": "Immediate", + "name": "beats-test-sc2", + "created": "2020-02-07T10:14:28.000Z", + "provisioner": "kubernetes.io/non-existing2", + "reclaim_policy": "Delete" + }, + "labels": { + "testl3": "value3", + "testl4": "value4" + } + }, + "event": { + "duration": 13684387, + "dataset": "kubernetes.storageclass", + "module": "kubernetes" + }, + "ecs": { + "version": "1.4.0" + }, + "host": { + "name": "pl51" + }, + "agent": { + "version": "8.0.0", + "type": "metricbeat", + "ephemeral_id": "f4458304-dc2e-4831-be7a-45cd34126fd2", + "hostname": "tamag8", + "id": "e9952df4-592e-4102-84a6-ad0b333b3b98" + }, + "metricset": { + "name": "state_storageclass", + "period": 10000 + } +} diff --git a/metricbeat/module/kubernetes/state_storageclass/_meta/docs.asciidoc b/metricbeat/module/kubernetes/state_storageclass/_meta/docs.asciidoc new file mode 100644 index 000000000000..5ad3f81cfdb7 --- /dev/null +++ b/metricbeat/module/kubernetes/state_storageclass/_meta/docs.asciidoc @@ -0,0 +1,2 @@ +The `state_storageclass` metricset for kubernetes storage class related metrics from `kube-state-metrics`. + diff --git a/metricbeat/module/kubernetes/state_storageclass/_meta/fields.yml b/metricbeat/module/kubernetes/state_storageclass/_meta/fields.yml new file mode 100644 index 000000000000..2f3adac5747c --- /dev/null +++ b/metricbeat/module/kubernetes/state_storageclass/_meta/fields.yml @@ -0,0 +1,21 @@ +- name: storageclass + type: group + description: > + kubernetes storage class metrics + release: experimental + fields: + - name: name + type: keyword + description: Storage class name. + - name: provisioner + type: keyword + description: Volume provisioner for the storage class. + - name: reclaim_policy + type: keyword + description: Reclaim policy for dynamically created volumes + - name: volume_binding_mode + type: keyword + description: Mode for default provisioning and binding + - name: created + type: date + description: Storage class creation date diff --git a/metricbeat/module/kubernetes/state_storageclass/_meta/test/ksm.unit.v1.8.0 b/metricbeat/module/kubernetes/state_storageclass/_meta/test/ksm.unit.v1.8.0 new file mode 100644 index 000000000000..0a7712e74b7a --- /dev/null +++ b/metricbeat/module/kubernetes/state_storageclass/_meta/test/ksm.unit.v1.8.0 @@ -0,0 +1,11 @@ +# HELP kube_storageclass_info Information about storageclass. +# TYPE kube_storageclass_info gauge +kube_storageclass_info{storageclass="test_storageclass",provisioner="kubernetes.io/rbd",reclaimPolicy="Delete",volumeBindingMode="Immediate"} 1 +# HELP kube_storageclass_created Unix creation timestamp +# TYPE kube_storageclass_created gauge +kube_storageclass_created{storageclass="test_storageclass"} 1.501569018e+09 +# HELP kube_storageclass_labels Kubernetes labels converted to Prometheus labels. +# TYPE kube_storageclass_labels gauge +kube_storageclass_labels{storageclass="test_storageclass",label_foo="bar"} 1 + + diff --git a/metricbeat/module/kubernetes/state_storageclass/_meta/test/ksm.unit.v1.8.0.expected b/metricbeat/module/kubernetes/state_storageclass/_meta/test/ksm.unit.v1.8.0.expected new file mode 100644 index 000000000000..cd0595a14f4a --- /dev/null +++ b/metricbeat/module/kubernetes/state_storageclass/_meta/test/ksm.unit.v1.8.0.expected @@ -0,0 +1,27 @@ +[ + { + "RootFields": {}, + "ModuleFields": { + "labels": { + "foo": "bar" + } + }, + "MetricSetFields": { + "created": "2017-08-01T06:30:18.000Z", + "name": "test_storageclass", + "provisioner": "kubernetes.io/rbd", + "reclaim_policy": "Delete", + "volume_binding_mode": "Immediate" + }, + "Index": "", + "ID": "", + "Namespace": "kubernetes.storageclass", + "Timestamp": "0001-01-01T00:00:00Z", + "Error": null, + "Host": "", + "Service": "", + "Took": 0, + "Period": 0, + "DisableTimeSeries": false + } +] \ No newline at end of file diff --git a/metricbeat/module/kubernetes/state_storageclass/_meta/test/ksm.v1.8.0.expected b/metricbeat/module/kubernetes/state_storageclass/_meta/test/ksm.v1.8.0.expected new file mode 100644 index 000000000000..346cc2cf1045 --- /dev/null +++ b/metricbeat/module/kubernetes/state_storageclass/_meta/test/ksm.v1.8.0.expected @@ -0,0 +1,27 @@ +[ + { + "RootFields": {}, + "ModuleFields": { + "labels": { + "addonmanager_kubernetes_io_mode": "EnsureExists" + } + }, + "MetricSetFields": { + "created": "2020-01-07T16:11:11.000Z", + "name": "standard", + "provisioner": "k8s.io/minikube-hostpath", + "reclaim_policy": "Delete", + "volume_binding_mode": "Immediate" + }, + "Index": "", + "ID": "", + "Namespace": "kubernetes.storageclass", + "Timestamp": "0001-01-01T00:00:00Z", + "Error": null, + "Host": "", + "Service": "", + "Took": 0, + "Period": 0, + "DisableTimeSeries": false + } +] \ No newline at end of file diff --git a/metricbeat/module/kubernetes/state_storageclass/state_storageclass.go b/metricbeat/module/kubernetes/state_storageclass/state_storageclass.go new file mode 100644 index 000000000000..356485d49a1d --- /dev/null +++ b/metricbeat/module/kubernetes/state_storageclass/state_storageclass.go @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package state_storageclass + +import ( + p "github.com/elastic/beats/metricbeat/helper/prometheus" + "github.com/elastic/beats/metricbeat/mb" +) + +func init() { + mb.Registry.MustAddMetricSet("kubernetes", "state_storageclass", + NewStorageClassMetricSet, + mb.WithHostParser(p.HostParser)) +} + +// StorageClassMetricSet is a prometheus based MetricSet that fetches +// and reports kube-state-metrics storage class metrics +type StorageClassMetricSet struct { + mb.BaseMetricSet + prometheus p.Prometheus + mapping *p.MetricsMapping +} + +// NewStorageClassMetricSet returns a prometheus based metricset for Storage classes +func NewStorageClassMetricSet(base mb.BaseMetricSet) (mb.MetricSet, error) { + prometheus, err := p.NewPrometheusClient(base) + if err != nil { + return nil, err + } + + return &StorageClassMetricSet{ + BaseMetricSet: base, + prometheus: prometheus, + mapping: &p.MetricsMapping{ + Metrics: map[string]p.MetricMap{ + "kube_storageclass_info": p.InfoMetric(), + "kube_storageclass_labels": p.ExtendedInfoMetric( + p.Configuration{ + StoreNonMappedLabels: true, + NonMappedLabelsPlacement: mb.ModuleDataKey + ".labels", + MetricProcessingOptions: []p.MetricOption{p.OpLabelKeyPrefixRemover("label_")}, + }), + "kube_storageclass_created": p.Metric("created", p.OpUnixTimestampValue()), + }, + Labels: map[string]p.LabelMap{ + "storageclass": p.KeyLabel("name"), + "provisioner": p.Label("provisioner"), + "reclaimPolicy": p.Label("reclaim_policy"), + "volumeBindingMode": p.Label("volume_binding_mode"), + }, + }, + }, nil +} + +// Fetch prometheus metrics and treats those prefixed by mb.ModuleDataKey as +// module rooted fields at the event that gets reported +func (m *StorageClassMetricSet) Fetch(reporter mb.ReporterV2) { + events, err := m.prometheus.GetProcessedMetrics(m.mapping) + if err != nil { + m.Logger().Error(err) + reporter.Error(err) + return + } + + for _, event := range events { + event[mb.NamespaceKey] = "storageclass" + reported := reporter.Event(mb.TransformMapStrToEvent("kubernetes", event, nil)) + if !reported { + m.Logger().Debug("error trying to emit event") + return + } + } + return +} diff --git a/metricbeat/module/kubernetes/state_storageclass/state_storageclass_test.go b/metricbeat/module/kubernetes/state_storageclass/state_storageclass_test.go new file mode 100644 index 000000000000..524121ce6faa --- /dev/null +++ b/metricbeat/module/kubernetes/state_storageclass/state_storageclass_test.go @@ -0,0 +1,41 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// +build !integration + +package state_storageclass + +import ( + "testing" + + "github.com/elastic/beats/metricbeat/helper/prometheus/ptest" +) + +func TestEventMapping(t *testing.T) { + ptest.TestMetricSet(t, "kubernetes", "state_storageclass", + ptest.TestCases{ + { + MetricsFile: "../_meta/test/ksm.v1.8.0", + ExpectedFile: "./_meta/test/ksm.v1.8.0.expected", + }, + { + MetricsFile: "./_meta/test/ksm.unit.v1.8.0", + ExpectedFile: "./_meta/test/ksm.unit.v1.8.0.expected", + }, + }, + ) +} diff --git a/metricbeat/modules.d/kubernetes.yml.disabled b/metricbeat/modules.d/kubernetes.yml.disabled index adeb94736f79..c0a660e41485 100644 --- a/metricbeat/modules.d/kubernetes.yml.disabled +++ b/metricbeat/modules.d/kubernetes.yml.disabled @@ -41,6 +41,7 @@ # - state_service # - state_persistentvolume # - state_persistentvolumeclaim +# - state_storageclass # period: 10s # hosts: ["kube-state-metrics:8080"] # add_metadata: true diff --git a/x-pack/metricbeat/metricbeat.reference.yml b/x-pack/metricbeat/metricbeat.reference.yml index b010788aa1b3..d54b06a4f2ec 100644 --- a/x-pack/metricbeat/metricbeat.reference.yml +++ b/x-pack/metricbeat/metricbeat.reference.yml @@ -659,6 +659,7 @@ metricbeat.modules: - state_service - state_persistentvolume - state_persistentvolumeclaim + - state_storageclass period: 10s hosts: ["kube-state-metrics:8080"]