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

[r157] Traceql instant query #3884

Merged
merged 1 commit into from
Jul 19, 2024
Merged

[r157] Traceql instant query #3884

merged 1 commit into from
Jul 19, 2024

Conversation

github-actions[bot]
Copy link
Contributor

Backport 7f788b3 from #3859


What this PR does:
Adds a new api /api/metrics/query which performs an instant query instead of a range query. Includes both http and grpc streaming versions. The parameters are (1) query, (2) start, and (3) end. Wanted to match the Prometheus instant api, but for now we can't. TraceQL is missing the custom interval tidbits like [1h], so it needs the full time range (start and end). I think this is fine.

This new api is actually the same, conceptually and implementation-wise, as doing a range query with 1 step. It reuses the existing query_range sharder, pipeline, combiner, etc, and does a transformation of the response at the end.

Extends the tempo-cli command tempo-cli query metrics to take an --instant parameter to call the new apis. Works with both http and --use-grpc streaming version.

Also tried to cleanup/solidify the time range handling.

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

* first working draft

* Cleanup request time manipulation code

* comment

* Update after merge, oops restore accidentally deleted query metrics

* Fix request clone for logging

* tweak method signature

* changelog

* Make TrimToOverlap aware of instant query, fix alignment issue on generator complete blocks

* Fix test

* Add streaming version of metrics query instant, add to cli, fix timestamp handling in metrics diff detection

* Fix typo in QueryInstantResponse name

* lint

* docs

* lint, rename

(cherry picked from commit 7f788b3)
@github-actions github-actions bot added backport type/bug Something isn't working labels Jul 19, 2024
@joe-elliott joe-elliott merged commit df4f83f into r157 Jul 19, 2024
2 checks passed
@joe-elliott joe-elliott deleted the backport-3859-to-r157 branch July 19, 2024 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport type/bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants