Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Libbeat add_kubernetes_metadata processor: Missing fields replicaset.name, etc. in fields.yml #11134

Merged
merged 11 commits into from
Mar 15, 2019
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Reconnections of Kubernetes watchers are now logged at debug level when they are harmless. {pull}10988[10988]
- Include ip and boolean type when generating index pattern. {pull}10995[10995]
- Cancelling enrollment of a beat will not enroll the beat. {issue}10150[10150]
- Add missing fields and test cases for libbeat add_kubernetes_metadata processor. {issue}11133[11133], {pull}11134[11134]

*Auditbeat*

Expand Down
30 changes: 30 additions & 0 deletions auditbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6336,6 +6336,36 @@ type: object
Kubernetes annotations map


--

*`kubernetes.replicaset.name`*::
+
--
type: keyword

Kubernetes replicaset name


--

*`kubernetes.deployment.name`*::
+
--
type: keyword

Kubernetes deployment name


--

*`kubernetes.statefulset.name`*::
+
--
type: keyword

Kubernetes statefulset name


--

*`kubernetes.container.name`*::
Expand Down
2 changes: 1 addition & 1 deletion auditbeat/include/fields.go

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions filebeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6654,6 +6654,36 @@ type: object
Kubernetes annotations map


--

*`kubernetes.replicaset.name`*::
+
--
type: keyword

Kubernetes replicaset name


--

*`kubernetes.deployment.name`*::
+
--
type: keyword

Kubernetes deployment name


--

*`kubernetes.statefulset.name`*::
+
--
type: keyword

Kubernetes statefulset name


--

*`kubernetes.container.name`*::
Expand Down
2 changes: 1 addition & 1 deletion filebeat/include/fields.go

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions heartbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3775,6 +3775,36 @@ type: object
Kubernetes annotations map


--

*`kubernetes.replicaset.name`*::
+
--
type: keyword

Kubernetes replicaset name


--

*`kubernetes.deployment.name`*::
+
--
type: keyword

Kubernetes deployment name


--

*`kubernetes.statefulset.name`*::
+
--
type: keyword

Kubernetes statefulset name


--

*`kubernetes.container.name`*::
Expand Down
2 changes: 1 addition & 1 deletion heartbeat/include/fields.go

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions journalbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -4179,6 +4179,36 @@ type: object
Kubernetes annotations map


--

*`kubernetes.replicaset.name`*::
+
--
type: keyword

Kubernetes replicaset name


--

*`kubernetes.deployment.name`*::
+
--
type: keyword

Kubernetes deployment name


--

*`kubernetes.statefulset.name`*::
+
--
type: keyword

Kubernetes statefulset name


--

*`kubernetes.container.name`*::
Expand Down
2 changes: 1 addition & 1 deletion journalbeat/include/fields.go

Large diffs are not rendered by default.

78 changes: 78 additions & 0 deletions libbeat/common/kubernetes/metadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func TestPodMetadata(t *testing.T) {
Deployment := "Deployment"
test := "test"
ReplicaSet := "ReplicaSet"
StatefulSet := "StatefulSet"
True := true
False := false
tests := []struct {
Expand Down Expand Up @@ -91,6 +92,44 @@ func TestPodMetadata(t *testing.T) {
"deployment": common.MapStr{"name": "test"},
},
},
{
pod: &Pod{
Metadata: &metav1.ObjectMeta{
Labels: map[string]string{"a.key": "foo", "a": "bar"},
Uid: &UID,
OwnerReferences: []*metav1.OwnerReference{
{
Kind: &Deployment,
Name: &test,
Controller: &False,
},
{
Kind: &ReplicaSet,
Name: &ReplicaSet,
Controller: &True,
},
{
Kind: &StatefulSet,
Name: &StatefulSet,
Controller: &True,
},
},
},
Spec: &v1.PodSpec{
NodeName: &test,
},
},
meta: common.MapStr{
"pod": common.MapStr{
"name": "",
"uid": "005f3b90-4b9d-12f8-acf0-31020a840133",
},
"node": common.MapStr{"name": "test"},
"labels": common.MapStr{"a": common.MapStr{"value": "bar", "key": "foo"}},
"replicaset": common.MapStr{"name": "ReplicaSet"},
"statefulset": common.MapStr{"name": "StatefulSet"},
},
},
}

for _, test := range tests {
Expand All @@ -113,6 +152,7 @@ func TestPodMetadataDeDot(t *testing.T) {
Deployment := "Deployment"
test := "test"
ReplicaSet := "ReplicaSet"
StatefulSet := "StatefulSet"
True := true
False := false
tests := []struct {
Expand Down Expand Up @@ -174,6 +214,44 @@ func TestPodMetadataDeDot(t *testing.T) {
"deployment": common.MapStr{"name": "test"},
},
},
{
pod: &Pod{
Metadata: &metav1.ObjectMeta{
Labels: map[string]string{"a.key": "foo", "a": "bar"},
Uid: &UID,
OwnerReferences: []*metav1.OwnerReference{
{
Kind: &Deployment,
Name: &test,
Controller: &False,
},
{
Kind: &ReplicaSet,
Name: &ReplicaSet,
Controller: &True,
},
{
Kind: &StatefulSet,
Name: &StatefulSet,
Controller: &True,
},
},
},
Spec: &v1.PodSpec{
NodeName: &test,
},
},
meta: common.MapStr{
"pod": common.MapStr{
"name": "",
"uid": "005f3b90-4b9d-12f8-acf0-31020a840133",
},
"node": common.MapStr{"name": "test"},
"labels": common.MapStr{"a": "bar", "a_key": "foo"},
"replicaset": common.MapStr{"name": "ReplicaSet"},
"statefulset": common.MapStr{"name": "StatefulSet"},
},
},
}

for _, test := range tests {
Expand Down
15 changes: 15 additions & 0 deletions libbeat/processors/add_kubernetes_metadata/_meta/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,21 @@
description: >
Kubernetes annotations map

- name: replicaset.name
type: keyword
description: >
Kubernetes replicaset name

- name: deployment.name
type: keyword
description: >
Kubernetes deployment name

- name: statefulset.name
type: keyword
description: >
Kubernetes statefulset name

- name: container.name
type: keyword
description: >
Expand Down
60 changes: 30 additions & 30 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -12123,6 +12123,36 @@ type: object
Kubernetes annotations map


--

*`kubernetes.replicaset.name`*::
+
--
type: keyword

Kubernetes replicaset name


--

*`kubernetes.deployment.name`*::
+
--
type: keyword

Kubernetes deployment name


--

*`kubernetes.statefulset.name`*::
+
--
type: keyword

Kubernetes statefulset name


--

*`kubernetes.container.name`*::
Expand Down Expand Up @@ -13361,16 +13391,6 @@ kubernetes deployment metrics



*`kubernetes.deployment.name`*::
+
--
type: keyword

Kubernetes deployment name


--

*`kubernetes.deployment.paused`*::
+
--
Expand Down Expand Up @@ -13594,16 +13614,6 @@ kubernetes replica set metrics



*`kubernetes.replicaset.name`*::
+
--
type: keyword

Kubernetes replica set name


--

[float]
== replicas fields

Expand Down Expand Up @@ -13668,16 +13678,6 @@ kubernetes stateful set metrics



*`kubernetes.statefulset.name`*::
+
--
type: keyword

Kubernetes stateful set name


--

*`kubernetes.statefulset.created`*::
+
--
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/include/fields/fields.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion metricbeat/module/kubernetes/fields.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
kubernetes deployment metrics
release: ga
fields:
- name: name
type: keyword
description: >
Kubernetes deployment name
- name: paused
type: boolean
description: >
Expand Down
Loading