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

Fix Pod UID automatic enriching #10081

Merged
merged 3 commits into from
Jan 15, 2019
Merged

Fix Pod UID automatic enriching #10081

merged 3 commits into from
Jan 15, 2019

Conversation

exekias
Copy link
Contributor

@exekias exekias commented Jan 15, 2019

Before this change, Kubernetes Pod events where not being enriched correctly and Pod UID was missing, what caused wrong visualizations in Infrastructure UI.

Metadata was being added at the module level, which is correct
for all metricsets, except pod and state_pod. For these metricsets
metadata must be added at the root level because we are already under
kubernetes.pod. Added metadata was being ignored.

This change takes this special case into account and updates events in
the right place, ensuring the events get the metadata correctly.

Before this change, missing UID caused this:

image

After this change visualizations are correct:

image

Kubernetes Pod events where not being enriched correctly. Before this
change, metadata was being added at the module level, which is correct
for all metricsets, except `pod` and `state_pod`. For these metricsets
metadata must be added at the root level because we are already under
`kubernetes.pod`. Existing metadata was being ignored.

This change takes this special case into account and updates events in
the right place, ensuring the events get the metadata correctly.
@exekias exekias requested a review from a team as a code owner January 15, 2019 15:04
Copy link
Contributor

@sayden sayden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@exekias exekias added bug review blocker needs_backport PR is waiting to be backported to other branches. v6.6.0 Team:Integrations Label for the Integrations team v6.5.5 labels Jan 15, 2019
Copy link
Member

@jsoriano jsoriano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It LGTM, I have added some comments but they don't need to be addressed now.

@@ -59,6 +59,7 @@ type enricher struct {
watcher kubernetes.Watcher
watcherStarted bool
watcherStartedLock sync.Mutex
isPod bool
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of having conditional logic we could maybe have an specialized enricher for pods.

@exekias
Copy link
Contributor Author

exekias commented Jan 15, 2019

jenkins, test this please

@exekias
Copy link
Contributor Author

exekias commented Jan 15, 2019

failures look unrelated, merging as this PR has some urgency

@exekias exekias merged commit c60282a into elastic:master Jan 15, 2019
exekias added a commit to exekias/beats that referenced this pull request Jan 15, 2019
* Fix Pod UID automatic enriching

Kubernetes Pod events where not being enriched correctly. Before this
change, metadata was being added at the module level, which is correct
for all metricsets, except `pod` and `state_pod`. For these metricsets
metadata must be added at the root level because we are already under
`kubernetes.pod`. Existing metadata was being ignored.

This change takes this special case into account and updates events in
the right place, ensuring the events get the metadata correctly.

(cherry picked from commit c60282a)
@exekias exekias removed the needs_backport PR is waiting to be backported to other branches. label Jan 15, 2019
exekias added a commit to exekias/beats that referenced this pull request Jan 15, 2019
* Fix Pod UID automatic enriching

Kubernetes Pod events where not being enriched correctly. Before this
change, metadata was being added at the module level, which is correct
for all metricsets, except `pod` and `state_pod`. For these metricsets
metadata must be added at the root level because we are already under
`kubernetes.pod`. Existing metadata was being ignored.

This change takes this special case into account and updates events in
the right place, ensuring the events get the metadata correctly.

(cherry picked from commit c60282a)
@exekias exekias added the v6.7.0 label Jan 15, 2019
exekias added a commit that referenced this pull request Jan 15, 2019
* Fix Pod UID automatic enriching

Kubernetes Pod events where not being enriched correctly. Before this
change, metadata was being added at the module level, which is correct
for all metricsets, except `pod` and `state_pod`. For these metricsets
metadata must be added at the root level because we are already under
`kubernetes.pod`. Existing metadata was being ignored.

This change takes this special case into account and updates events in
the right place, ensuring the events get the metadata correctly.

(cherry picked from commit c60282a)
exekias added a commit to exekias/beats that referenced this pull request Jan 16, 2019
* Fix Pod UID automatic enriching

Kubernetes Pod events where not being enriched correctly. Before this
change, metadata was being added at the module level, which is correct
for all metricsets, except `pod` and `state_pod`. For these metricsets
metadata must be added at the root level because we are already under
`kubernetes.pod`. Existing metadata was being ignored.

This change takes this special case into account and updates events in
the right place, ensuring the events get the metadata correctly.

(cherry picked from commit c60282a)
exekias added a commit that referenced this pull request Jan 18, 2019
* Fix Pod UID automatic enriching

Kubernetes Pod events where not being enriched correctly. Before this
change, metadata was being added at the module level, which is correct
for all metricsets, except `pod` and `state_pod`. For these metricsets
metadata must be added at the root level because we are already under
`kubernetes.pod`. Existing metadata was being ignored.

This change takes this special case into account and updates events in
the right place, ensuring the events get the metadata correctly.

(cherry picked from commit c60282a)
exekias added a commit that referenced this pull request Jan 22, 2019
* Fix Pod UID automatic enriching

Kubernetes Pod events where not being enriched correctly. Before this
change, metadata was being added at the module level, which is correct
for all metricsets, except `pod` and `state_pod`. For these metricsets
metadata must be added at the root level because we are already under
`kubernetes.pod`. Existing metadata was being ignored.

This change takes this special case into account and updates events in
the right place, ensuring the events get the metadata correctly.

(cherry picked from commit c60282a)
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
* Fix Pod UID automatic enriching

Kubernetes Pod events where not being enriched correctly. Before this
change, metadata was being added at the module level, which is correct
for all metricsets, except `pod` and `state_pod`. For these metricsets
metadata must be added at the root level because we are already under
`kubernetes.pod`. Existing metadata was being ignored.

This change takes this special case into account and updates events in
the right place, ensuring the events get the metadata correctly.

(cherry picked from commit 0ede7e7)
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
* Fix Pod UID automatic enriching

Kubernetes Pod events where not being enriched correctly. Before this
change, metadata was being added at the module level, which is correct
for all metricsets, except `pod` and `state_pod`. For these metricsets
metadata must be added at the root level because we are already under
`kubernetes.pod`. Existing metadata was being ignored.

This change takes this special case into account and updates events in
the right place, ensuring the events get the metadata correctly.

(cherry picked from commit 0ede7e7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants