-
Notifications
You must be signed in to change notification settings - Fork 524
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
Traceql instant query #3859
Traceql instant query #3859
Conversation
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.
Looks good to me.
…erator complete blocks
…tamp handling in metrics diff detection
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.
two questions
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.
LGTM
* 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)
* 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) Co-authored-by: Martin Disibio <martin.disibio@grafana.com>
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
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]