Skip to content

PromQL: Support instant queries#149379

Draft
sidosera wants to merge 6 commits into
elastic:mainfrom
sidosera:feature/promql-instant-query-support
Draft

PromQL: Support instant queries#149379
sidosera wants to merge 6 commits into
elastic:mainfrom
sidosera:feature/promql-instant-query-support

Conversation

@sidosera
Copy link
Copy Markdown
Contributor

@sidosera sidosera commented May 19, 2026

As title.

Test:

sidosera:~/dist/promcheck (main)$ uv run promcheck --workspace ~/dist/elasticsearch ~/dist/promcheck/data/results/grafana_dashboards_100_distinct_queries.csv

...

|-- SUMMARY
| col              | value |      % |
| ---------------- | ----- | ------ |
| input.total      |   401 | 100.0% |
| executed.total   |   401 | 100.0% |
| executed.success |   185 |  46.1% |
| executed.failure |    61 |  15.2% |
| executed.error   |   155 |  38.7% |
|-- Teardown


For INSTANT mode, rows arrive ascending by timestamp, so the
most-recent value is the last row for each series, not the first.
@sidosera
Copy link
Copy Markdown
Contributor Author

@coderabbitai review pls.

@coderabbitai

This comment was marked as outdated.

sidosera added 4 commits May 19, 2026 14:03
- Document the single-row Page(1) seed in createSelectorFreeInstantScalarPlan
- Clarify instant query last-sample invariant in response builder
- Add test: sourceFilterWindow floors short ranges to DEFAULT_LOOKBACK
  while resolveInstantQueryWindow respects the explicit window
…e range

TStep uses right-boundary labeling; Bucket uses left-boundary. Switching
all step-bucket creation to TStep shifted every bucket label forward by
one step for open-ended range queries (no explicit start/end), breaking
253 EsqlSpecIT tests. Restore the original Bucket path when hasTimeRange()
is false; use TStep only when start/end are present or for instant queries.
PROMQL step bucketing now always uses TStep (right-boundary
labeling) to match Prometheus evaluation semantics. For queries
without an explicit time range, epoch/MAX_MILLIS sentinels are
used so TStep produces the correct bucket boundaries without
requiring start/end.

Update csv-spec expected step timestamps to reflect TStep
right-boundary labeling: bucket covering (T-step, T] is
labeled T instead of the left boundary T-step.
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.

1 participant