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

Make sure the active phase status is retrieved for kubernetes pods in state_pod #5980

Merged
merged 2 commits into from Jan 4, 2018

Conversation

Crazybus
Copy link
Contributor

@Crazybus Crazybus commented Jan 4, 2018

For kube_pod_status_phase there are multiple metrics for each status phase with identical metric names but different phase labels. The test data only contained a single status phase so it was working perfectly, however when there are multiple status phases the code was always picking unknown for all pods in state_pod.

kube_pod_status_phase{namespace="test-namespace",phase="Failed",pod="test-pod"} 0
kube_pod_status_phase{namespace="test-namespace",phase="Pending",pod="test-pod"} 0
kube_pod_status_phase{namespace="test-namespace",phase="Running",pod="test-pod"} 0
kube_pod_status_phase{namespace="test-namespace",phase="Succeeded",pod="test-pod"} 1
kube_pod_status_phase{namespace="test-namespace",phase="Unknown",pod="test-pod"} 0

Oddly enough container_pod isn't affected by this since it does have seperate metrics per status phase

kube_pod_container_status_ready{container="test-container",namespace="test-namespace",pod="test-pod"} 0
kube_pod_container_status_restarts{container="test-container",namespace="test-namespace",pod="test-pod"} 0
kube_pod_container_status_running{container="test-container",namespace="test-namespace",pod="test-pod"} 0
kube_pod_container_status_terminated{container="test-container",namespace="test-namespace",pod="test-pod"} 1
kube_pod_container_status_waiting{container="test-container",namespace="test-namespace",pod="test-pod"} 0

@ruflin
Copy link
Member

ruflin commented Jan 4, 2018

Could you add a CHANGELOG entry?

@Crazybus
Copy link
Contributor Author

Crazybus commented Jan 4, 2018

@ruflin Added! Does it make sense for me to to add a note about adding a CHANGELOG entry to the beats contributing guide?

@ruflin
Copy link
Member

ruflin commented Jan 4, 2018

@Crazybus Thanks. Yes that would be awesome.

Copy link
Contributor

@exekias exekias left a comment

Choose a reason for hiding this comment

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

Good catch! thanks for the fix 💯

@exekias exekias merged commit 45cb784 into elastic:master Jan 4, 2018
@monicasarbu monicasarbu changed the title [metricbeat] [kubernetes] Make sure the active phase status is retrieved for kubernetes pods in state_pod Make sure the active phase status is retrieved for kubernetes pods in state_pod Jan 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants