Skip to content

Commit

Permalink
Ensure Pod UID is always present in pod metricset (elastic#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.
  • Loading branch information
Carlos Pérez-Aradros Herce authored and andrewvc committed Jun 12, 2019
1 parent 4e5f001 commit 05b42a6
Show file tree
Hide file tree
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
Expand Up @@ -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]

Expand Down
1 change: 1 addition & 0 deletions metricbeat/module/kubernetes/pod/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
1 change: 1 addition & 0 deletions metricbeat/module/kubernetes/pod/pod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 05b42a6

Please sign in to comment.