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

list all active namespaces #1398

Open
msvinaykumar opened this issue Nov 27, 2024 · 0 comments
Open

list all active namespaces #1398

msvinaykumar opened this issue Nov 27, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@msvinaykumar
Copy link
Contributor

Describe the bug

sum by (namespace) ( avg_over_time(kube_namespace_status_phase{namespace!="" }[15d]

NAMESPACE_QUERY("sum by (namespace) ( avg_over_time(kube_namespace_status_phase{namespace!=\"\" ADDITIONAL_LABEL}[15d]))"),

We are not generating recommendations using the above query; instead, we are requesting a list of all active namespaces. And 15d should not be considered

we gather container details based on the namespaces retrieved from the query. However, for a scenario where a user generates recommendations for a 15-day-old job via the UI, it makes sense to account for namespaces that might no longer be active.
In such cases, the query should ensure it fetches data from historical metrics as well, so that namespaces tied to past jobs are considered, even if they aren't currently active.
but as of bulk considers only active containers and namespaces recommendations only .

How to reproduce it
Create a namespace older than 15 days and call /bulk api and it fails

Expected behavior
Create a namespace older than 15 days and call /bulk api and it should gerneates recommendations

Relevant logs

kubectl exec -it po/kruize-58447bddff-58dbn -n openshift-tuning -- curl "http://thanos-query-frontend.thanos-bench.svc.cluster.local:9090/api/v1/query?query=sum+by+%28namespace%29+%28+avg_over_time%28kube_namespace_status_phase%7Bnamespace%21%3D%22%22+%7D%5B15d%5D%29%29"
Defaulted container "kruize" out of: kruize, wait-for-kruize-db (init)
{"status":"success","data":{"resultType":"vector","result":[]}}
[vinakuma@vinakuma-thinkpadp1gen3 kruize-demos]$ kubectl exec -it po/kruize-58447bddff-58dbn -n openshift-tuning -- curl "http://thanos-query-frontend.thanos-bench.svc.cluster.local:9090/api/v1/query?query=sum+by+%28namespace%29+%28+avg_over_time%28kube_namespace_status_phase%7Bnamespace%21%3D%22%22+%7D%5B25d%5D%29%29"
Defaulted container "kruize" out of: kruize, wait-for-kruize-db (init)
{"status":"success","data":{"resultType":"vector","result":[{"metric":{"namespace":"msc-0"},"value":[1732703222.824,"7"]}]}}E1127 15:57:02.978593 2243313 v3.go:79] EOF
[vinakuma@vinakuma-thinkpadp1gen3 kruize-demos]$ 

Environment:

Additional context
slack conversation log

@msvinaykumar msvinaykumar added the bug Something isn't working label Nov 27, 2024
@msvinaykumar msvinaykumar added this to the Kruize 0.3 Release milestone Nov 27, 2024
@dinogun dinogun moved this to Todo in Monitoring Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Todo
Development

No branches or pull requests

2 participants