Skip to content

Commit

Permalink
Ensure Pod UID is always present in pod metricset (#12345)
Browse files Browse the repository at this point in the history
Pod UID field is currently retrieved as part of the metadata enrichment
present for  all Kubernetes module metricsets. In case of errors or
missconfiguration, pod UID won't be present in resulting documents.

Since this field is available in the `pod` metricset, this change adds
it to Pod events, avoiding issues when enrichment fails.
Carlos Pérez-Aradros Herce authored Jun 4, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 9169c51 commit db51085
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
@@ -239,6 +239,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Keep `etcd` followers members from reporting `leader` metricset events {pull}12004[12004]
- Add overview dashboard to Consul module {pull}10665[10665]
- New fields were added in the mysql/status metricset. {pull}12227[12227]
- Always report Pod UID in the `pod` metricset. {pull}12345[12345]
- Add Vsphere Virtual Machine operating system to `os` field in Vsphere virtualmachine module. {pull}12391[12391]
- Add validation for elasticsearch and kibana modules' metricsets when xpack.enabled is set to true. {pull}12386[12386]

1 change: 1 addition & 0 deletions metricbeat/module/kubernetes/pod/data.go
Original file line number Diff line number Diff line change
@@ -65,6 +65,7 @@ func eventMapping(content []byte, perfMetrics *util.PerfMetricsCache) ([]common.
},
},
"name": pod.PodRef.Name,
"uid": pod.PodRef.UID,

"cpu": common.MapStr{
"usage": common.MapStr{
1 change: 1 addition & 0 deletions metricbeat/module/kubernetes/pod/pod_test.go
Original file line number Diff line number Diff line change
@@ -51,6 +51,7 @@ func TestEventMapping(t *testing.T) {

testCases := map[string]interface{}{
"name": "nginx-deployment-2303442956-pcqfc",
"uid": "beabc196-2456-11e7-a3ad-42010a840235",

"network.rx.bytes": 107056,
"network.rx.errors": 0,

0 comments on commit db51085

Please sign in to comment.