-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
feat: aggregated metric volume queries #14412
Conversation
b24af03
to
c78c5fa
Compare
It may be interesting to change the underlying instant query to a shardable topk query to enforce the requested limit once #14243 is merged |
"foo", | ||
) | ||
require.NoError(t, err) | ||
fruitMatcher, err := labels.NewMatcher(labels.MatchNotEqual, "fruit", "apple") |
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.
Check out labels.MustNewMatcher()
, it'll help make these tests less verbose
pkg/querier/queryrange/volume.go
Outdated
filters := []string{} | ||
serviceNamePresent := false | ||
|
||
for i, matcher := range a.matchers { |
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.
Is len(matchers) ever 0? If not, it might be good to pull the if i == 0
clause out for clarity
Limit uint32 | ||
TargetLabels []string | ||
AggregateBy string | ||
AggregatedMetrics bool |
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.
nit: I tripped over the naming here. It might be better to use a name like UseAggregatedMetrics
or FromAggregatedMetrics
// idxVolumeHandler gets volume from metadata in the index | ||
idxVolumeHandler := indexTw.Wrap(next) | ||
if !r.AggregatedMetrics || !cfg.AggregatedMetrics { | ||
return idxVolumeHandler.Do(ctx, req) |
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.
is it intended to silently not use aggregated metrics when the user explicitly sets "aggregatedMetrics=true" in the request, but does not have patterns enabled?
or should we throw a bad request instead?
…14413) This change allows to observe the distribution of how many tasks are dequeued at once over time. Signed-off-by: Christian Haudum <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
At the moment, errors are silently ignored when asynchronous blocks downloading fails. Signed-off-by: Christian Haudum <[email protected]>
**Statefulsets for ingester and index-gateway** The change here is to make the `spec.updateStrategy.type` configurable, and to default to `RollingUpdate`. **Enterprise tokengen** For this change, if `enterprise` and `tokengen` are enabled, and `rbac.namespaced` is true, the chart will render a `Role` and `RoleBinding`. If `rbac.namespaced` is false, it will render a `ClusterRole` and `ClusterRoleBinding`.
) This new field reports how many blocks have been processed in total in the multiplexed request. Signed-off-by: Christian Haudum <[email protected]>
Co-authored-by: Jack Baldry <[email protected]>
Signed-off-by: Vladyslav Diachenko <[email protected]> Co-authored-by: Trevor Whitney <[email protected]>
Co-authored-by: J Stickler <[email protected]>
Kubernetes Manifest Diff SummaryScenario: default-single-binary-values (Added: 0, Modified: 0, Removed: 0)
Summary:
Added FilesNo added files Modified FilesNo modified files Removed FilesNo removed files Scenario: default-values (Added: 0, Modified: 0, Removed: 0)
Summary:
Added FilesNo added files Modified FilesNo modified files Removed FilesNo removed files Scenario: ingress-values (Added: 0, Modified: 0, Removed: 0)
Summary:
Added FilesNo added files Modified FilesNo modified files Removed FilesNo removed files Scenario: legacy-monitoring-values (Added: 0, Modified: 0, Removed: 0)
Summary:
Added FilesNo added files Modified FilesNo modified files Removed FilesNo removed files Scenario: simple-scalable-aws-kube-irsa-values (Added: 0, Modified: 0, Removed: 0)
Summary:
Added FilesNo added files Modified FilesNo modified files Removed FilesNo removed files |
at this time, I don't think this is worth merging. over large time ranges (like |
What this PR does / why we need it:
This PR introduces the
?aggregatedMetrics=true
query parameter to the/volume
endpoint which allows one to get stream volume from aggregated metrics rather than the index.Explore Logs uses the
/volume
endpoint to find the top services by volume for the services landing page. This is slow for big services. With the latest release of Explore Logs, we introduced the ability to get this volume using aggregated metric streams, which is much faster. In that first release, however, the app is getting volumes for the aggregated metric streams rather than the actual service. This PR adds aggregated metric support directly in the the Loki/volume
endpoint. This allows the frontend to send the same stream selector whether it is using aggregated metrics or not (and therefore not need to know about the__aggregated_metric__
label).Which issue(s) this PR fixes:
Fixes #14349
Special notes for your reviewer:
Checklist
CONTRIBUTING.md
guide (required)feat
PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.docs/sources/setup/upgrade/_index.md
deprecated-config.yaml
anddeleted-config.yaml
files respectively in thetools/deprecated-config-checker
directory. Example PR