Loki: Show query size approximation (#62109)
* feat: make api request to /loki/api/v1/index/stats * fix: add /index/stats to callResource valid urls * feat: make call to getQueryStats when the query changes * feat: render user tooltip displaying the estimated value for processed data * fix: add new props to component tests * test: add tests for query size estimation * fix: disable error message on request failure * refactor: add suggestions from code review * refactor: only pass required query string
This commit is contained in:
@@ -112,7 +112,8 @@ func callResource(ctx context.Context, req *backend.CallResourceRequest, sender
|
||||
}
|
||||
if (!strings.HasPrefix(url, "labels?")) &&
|
||||
(!strings.HasPrefix(url, "label/")) && // the `/label/$label_name/values` form
|
||||
(!strings.HasPrefix(url, "series?")) {
|
||||
(!strings.HasPrefix(url, "series?")) &&
|
||||
(!strings.HasPrefix(url, "index/stats?")) {
|
||||
return fmt.Errorf("invalid resource URL: %s", url)
|
||||
}
|
||||
lokiURL := fmt.Sprintf("/loki/api/v1/%s", url)
|
||||
|
||||
Reference in New Issue
Block a user