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

Datasource Metadata queries do not use the specified bulk time range #1454

Open
chandrams opened this issue Jan 9, 2025 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@chandrams
Copy link
Contributor

Describe the bug
Datasource Metadata queries have measurement duration of 15 days and do not consider the specified bulk time range
Test failed with 503 http code and kruize pod was restarted with parallel requests.

How to reproduce it
Invoke the bulk API with a time range difference of 1 hour in start & end time with prometheus datasource, metadata queries fetch 15 days instead of using the bulk time range

curl -X POST http://kruize-openshift-tuning.apps.<server>/bulk -H 'Content-Type: application/json' -d '{"filter": {"exclude": {"namespace": [], "workload": [], "containers": [], "labels": {}}, "include": {"namespace": [], "workload": [], "containers": [], "labels": {}}}, "datasource": "prometheus-1", "time_range": {"start": "2025-01-08T12:30:00.000Z", "end": "2025-01-08T13:30:00.000Z"}}'

Expected behavior
Metadata queries should consider the bulk time range.

Relevant logs

2025-01-0904:02:20.375 INFO [pool-9-thread-1][DataSourceMetadataOperator.java(215)]-namespaceQuery: sum by (namespace) ( avg_over_time(kube_namespace_status_phase{namespace!='' }[15d]))
2025-01-0904:02:20.375 INFO [pool-9-thread-3][DataSourceMetadataOperator.java(301)]-filterBuilder: workload!=''
2025-01-0904:02:20.375 INFO [pool-9-thread-4][DataSourceMetadataOperator.java(215)]-namespaceQuery: sum by (namespace) ( avg_over_time(kube_namespace_status_phase{namespace!='' }[15d]))
2025-01-0904:02:20.375 INFO [pool-9-thread-3][DataSourceMetadataOperator.java(301)]-filterBuilder: container!=''
2025-01-0904:02:20.375 INFO [pool-9-thread-4][DataSourceMetadataOperator.java(216)]-workloadQuery: sum by (namespace, workload, workload_type) ( avg_over_time(namespace_workload_pod:kube_pod_owner:relabel{workload!='' }[15d]))  
2025-01-0904:02:20.375 INFO [pool-9-thread-3][DataSourceMetadataOperator.java(215)]-namespaceQuery: sum by (namespace) ( avg_over_time(kube_namespace_status_phase{namespace!='' }[15d]))

Environment:

  • Kubernetes Cluster : openshift
@chandrams chandrams added the bug Something isn't working label Jan 9, 2025
@chandrams chandrams added this to the Kruize 0.4 Release milestone Jan 9, 2025
@dinogun dinogun moved this to Todo in Monitoring Jan 9, 2025
@shreyabiradar07 shreyabiradar07 moved this from Todo to In Progress in Monitoring Feb 6, 2025
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: In Progress
Development

No branches or pull requests

3 participants