docs: Vega ES|QL data sources respect the dashboard time range (#7620) - #7678
Open
florent-leborgne wants to merge 10 commits into
Open
docs: Vega ES|QL data sources respect the dashboard time range (#7620)#7678florent-leborgne wants to merge 10 commits into
florent-leborgne wants to merge 10 commits into
Conversation
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Elastic Docs AI PR menuCheck the box to run an AI review for this pull request.
Powered by GitHub Agentic Workflows and docs-actions. For more information, reach out to the docs team. |
Contributor
🔍 Preview links for changed docs |
Contributor
✅ Elastic Docs Style Checker (Vale)No issues found on modified lines! The Vale linter checks documentation changes against the Elastic Docs style guide. To use Vale locally or report issues, refer to Elastic style guide for Vale. |
…@timestamp Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…annotated samples
florent-leborgne
commented
Aug 3, 2026
… note, align tutorial callout
Contributor
Docs review summaryFocus areas
Notes
|
mdbirnstiehl
approved these changes
Aug 3, 2026
mdbirnstiehl
left a comment
Member
There was a problem hiding this comment.
A couple of suggestions for your consideration, otherwise LGTM
| ::::{applies-item} { stack: ga 9.5+, serverless: ga } | ||
| {{kib}} applies the dashboard time range automatically, the same way it does in Lens and Discover. By default, it looks for a field named `@timestamp` in your data and filters on it, so no configuration is needed when your time field has that name. | ||
|
|
||
| To filter on a different date field, specify it in one of the following ways: |
Member
There was a problem hiding this comment.
Suggested change
| To filter on a different date field, specify it in one of the following ways: | |
| To filter on a different time field, specify it in one of the following ways: |
just for consistency with the paragraph preceding this line.
| :::::{applies-switch} | ||
|
|
||
| ::::{applies-item} { stack: ga 9.5+, serverless: ga } | ||
| {{kib}} applies the dashboard time range automatically, the same way it does in Lens and Discover. By default, it looks for a field named `@timestamp` in your data and filters on it, so no configuration is needed when your time field has that name. |
Member
There was a problem hiding this comment.
Suggested change
| {{kib}} applies the dashboard time range automatically, the same way it does in Lens and Discover. By default, it looks for a field named `@timestamp` in your data and filters on it, so no configuration is needed when your time field has that name. | |
| {{kib}} applies the dashboard time range automatically, the same way it does in Lens and Discover. By default, it looks for and filters on the `@timestamp` field, so no configuration is needed when your time field is named `@timestamp`. |
| * Set `"%timefield%"` to the field. No `WHERE` clause is required in the query. | ||
| * Compare the field against `?_tstart` and `?_tend` in the query, for example in a `WHERE` clause. | ||
|
|
||
| If your data has no `@timestamp` field and you don't specify one, the query isn't filtered by time. |
Member
There was a problem hiding this comment.
Suggested change
| If your data has no `@timestamp` field and you don't specify one, the query isn't filtered by time. | |
| If your data has no `@timestamp` field and you don't specify a different time field, the query isn't filtered by time. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Hey @mbondyra - I thought this change deserved a bit of explanations in the docs, especially to clarify the 9.4 vs. 9.5 behavior. I tested what I wrote (and simplified some bits like the value to put in %timefield% for 9.4 which could actually be anything IIUC) but let me know if there's something more nuanced or not as accurate as I'd hoped :D Thank you 🙏
From 9.5 (and in serverless), the dashboard time range applies to Vega and Vega-Lite {{esql}} data sources automatically, like Lens and Discover (kibana#280070). The Vega reference previously stated that
%timefield%only enables the?_tstart/?_tendparameters, which no longer describes the behavior. This PR updates that reference and adds a dedicated section explaining how the time range is applied per version.All changes are in
explore-analyze/visualize/custom-visualizations-with-vega.md:%timefield%parameter table row: replaced "When set, enables the?_tstartand?_tendnamed parameters..." with "The timestamp field to use for the dashboard time range", plus a link to the new section.stack: ga 9.4,serverless: ga): anapplies-switchwith one tab per behavior, each with an annotated example:stack: ga 9.5+/serverless: ga: the range applies automatically. The time field defaults to@timestamp; set%timefield%or reference the field with?_tstart/?_tendto use another. Notes that the parameters are still substituted when present, and that time filtering is separate from%context%.stack: ga =9.4: the range applies only through?_tstart/?_tend, which%timefield%turns on; both are required.%context%/%timefield%/the parameters).%timefield%annotation from "Enables the?_tstartand?_tendnamed parameters..." to "Sets@timestampas the time field for the dashboard time range", so the tutorial matches the new reference section.Behavior, verified against source
When
%timefield%isn't set, the time field resolves to the field the query compares against?_tstart/?_tend(parseTimeFieldFromESQLQuery), otherwise a field literally named@timestamp(get_timefield.ts:ES_TIMESTAMP_FIELD_NAME+fieldCaps), otherwise none. Indices whose time field has another name (for exampletimestampin the flights sample data) are not auto-filtered unless%timefield%is set, which the new section calls out. The DSL range filter and the?_tstart/?_tendsubstitution are independent mechanisms and can both apply.Verified against
esql_query_parser.ts,get_time_field.ts,get_timefield.ts, andquery_parsing_helpers.tsat HEAD (kibana#280070 and its 9.5 backport #280113). Built locally withdocs-builder --strict(0 errors, 0 warnings).Resolves
Closes #7620