-
Notifications
You must be signed in to change notification settings - Fork 55
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
Update Container Metric Queries #1359
base: mvp_demo
Are you sure you want to change the base?
Update Container Metric Queries #1359
Conversation
@@ -23,17 +23,17 @@ slo: | |||
|
|||
aggregation_functions: | |||
- function: avg | |||
query: 'avg by(container, namespace) (kube_pod_container_resource_requests{container!="", container!="POD", pod!="", resource="cpu", unit="core", namespace="$NAMESPACE$", container="$CONTAINER_NAME$"})' | |||
query: 'avg by(container, pod, namespace) ((kube_pod_container_resource_requests{container!="", container!="POD", pod!="", resource="cpu", unit="core", namespace="$NAMESPACE$", container="$CONTAINER_NAME$"}) * on(pod, namespace) group_left max by (container, pod, namespace) (kube_pod_status_phase{phase="Running"}))' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Irrespective of pod_status_phase - we need to gather all the data. We can remove the grouping * on(pod, namespace) group_left max by (container, pod, namespace) (kube_pod_status_phase{phase="Running"}))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the queries to remove grouping based on the pod status.
|
||
# Show sum of cpu requests in bytes for a container in a deployment | ||
- function: sum | ||
query: 'sum by(container, namespace) (kube_pod_container_resource_requests{container!="", container!="POD", pod!="", resource="cpu", unit="core", namespace="$NAMESPACE$", container="$CONTAINER_NAME$"})' | ||
query: 'sum by(container, pod, namespace) ((kube_pod_container_resource_requests{container!="", container!="POD", pod!="", resource="cpu", unit="core", namespace="$NAMESPACE$", container="$CONTAINER_NAME$"}) * on(pod, namespace) group_left max by (container, pod, namespace) (kube_pod_status_phase{phase="Running"}))' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removing the pod_status_phase grouping applies to all the queries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated the queries.
Description
This PR has the following changes:
imageOwners
andimageWorkloads
to fetch pod owner and workload detailsFixes # (issue)
Type of change
How has this been tested?
Please describe the tests that were run to verify your changes and steps to reproduce. Please specify any test configuration required.
Test Configuration
Checklist 🎯
Additional information
.