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

chore: treat datasample queries the same as limited queries #13700

Merged
merged 1 commit into from
Jul 30, 2024

Conversation

slim-bean
Copy link
Collaborator

@slim-bean slim-bean commented Jul 29, 2024

What this PR does / why we need it:

datasample queries are use by Grafana for query auto complete as well as "logs sample" on metric queries.

they are generally only helpful if they can return quickly

similar logic here to how we handle "limited" queries (log queries with no label filter)

We shouldn't process these so aggressively in parallel (only do one split by time, at a time) because it's both wasteful and doesn't return a faster result when we only need 10 log lines.

Comparison periods (left with test image, right same time period previous 4 weeks)
image
image
image
image

Will need to see this run for a few more weeks to really confirm if this impact is consistent (maybe it was less querying during the test week), but generally this looks to be a big benefit

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • Title matches the required conventional commits format, see here
    • Note that Promtail is considered to be feature complete, and future development for logs collection will be in Grafana Alloy. As such, feat PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • For Helm chart changes bump the Helm chart version in production/helm/loki/Chart.yaml and update production/helm/loki/CHANGELOG.md and production/helm/loki/README.md. Example PR
  • If the change is deprecating or removing a configuration option, update the deprecated-config.yaml and deleted-config.yaml files respectively in the tools/deprecated-config-checker directory. Example PR

@slim-bean slim-bean requested a review from a team as a code owner July 29, 2024 20:39
@slim-bean slim-bean changed the title core: treat datasample queries the same as limited queries chore: treat datasample queries the same as limited queries Jul 29, 2024
@slim-bean slim-bean merged commit 0bf8df1 into main Jul 30, 2024
62 checks passed
@slim-bean slim-bean deleted the special-case-datasample branch July 30, 2024 02:18
grafanabot pushed a commit that referenced this pull request Jul 30, 2024
benclive pushed a commit to cyriltovena/loki that referenced this pull request Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants