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

add ephemeral_storage_container_volume_usage metrics #87

Merged
merged 2 commits into from
Apr 26, 2024

Conversation

jicki
Copy link
Contributor

@jicki jicki commented Apr 25, 2024

add ephemeral_storage_container_volume_usage

the sample output

ephemeral_storage_container_volume_usage{cluster="development-k8s-cluster",container="k8s-ephemeral-storage",endpoint="metrics",exported_container="postgresql",instance="172.18.23.200:9100",job="prometheus-ephemeral-storage-exporter",mount_path="/dev/shm",namespace="monitor-system",node_name="10-9-9-46.vm",pod="prometheus-ephemeral-storage-exporter-86dcfd97d9-wd79f",pod_name="postgresql-0",pod_namespace="demo-postgresql",prometheus="monitor-system/victoria-metrics-cluster",service="prometheus-ephemeral-storage-exporter",volume_name="dshm"} 210,870,272

Copy link
Owner

@jmcgrath207 jmcgrath207 left a comment

Choose a reason for hiding this comment

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

Overall looks great. Once you get this CI test passing, I can handle the helm and e2e test for it.

pkg/pod/k8s.go Outdated
@@ -108,23 +108,23 @@ func (cr Collector) getContainerData(c v1.Container, p v1.Pod) container {
setContainer.name = c.Name
matchKey := v1.ResourceName("ephemeral-storage")

if cr.containerVolumeLimitsPercentage && p.Spec.Volumes != nil {
if cr.containerVolumeUsage && cr.containerVolumeLimitsPercentage && p.Spec.Volumes != nil {
Copy link
Owner

Choose a reason for hiding this comment

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

Lets do a or here. ex. ( cr.containerVolumeUsage || cr.containerVolumeLimitsPercentage)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Update

@jmcgrath207 jmcgrath207 merged commit a1215e8 into jmcgrath207:master Apr 26, 2024
1 check passed
@jmcgrath207
Copy link
Owner

Thank you for your contribution @jicki, you change is now live in 1.9.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants