Skip to content

Commit

Permalink
Ensure Pod UID is always present in pod metricset
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 committed May 29, 2019
1 parent d1446d4 commit 0e1f402
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 @@ -229,6 +229,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]

*Packetbeat*

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 0e1f402

Please sign in to comment.