Update queries.md (#31941)

* Update queries.md

Completing some examples to allow newbie people to understand relative time and time shift time

* Update docs/sources/panels/queries.md

Co-authored-by: Geshi <ohayo@geshii.moe>

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
Co-authored-by: Geshi <ohayo@geshii.moe>
This commit is contained in:
castillo92
2021-07-14 18:22:23 +02:00
committed by GitHub
parent c21b4eb602
commit e8d5b2431e

View File

@@ -101,6 +101,32 @@ Panel data source query options:
- **Cache timeout -** (This field is only visible if available in your data source.) If your time series store has a query cache, then this option can override the default cache timeout. Specified as a numeric value in seconds.
### Examples:
- **Relative time:**
| Example | Relative time field |
| ------------------- | --------------------|
| Last 5 minutes | `now-5m` |
| The day so far | `now/d` |
| Last 5 days | `now-5d/d` |
| This week so far | `now/w` |
| Last 2 years | `now-2y/y` |
- **Time shift:**
| Example | Time shift field |
| ------------------- | --------------------|
| Last entire week | `1w/w` |
| Two entire weeks ago | `2w/w` |
| Last entire month | `1M/M` |
| This entire year | `1d/y` |
| Last entire year | `1y/y` |
### Query inspector button
You can click **Query inspector** to open the Query tab of the panel inspector where you can see the query request sent by the panel and the response.
@@ -129,4 +155,4 @@ You can:
If your data source supports them, then Grafana displays the **Expression** button and shows any existing expressions in the query editor list.
For more information about expressions, refer to [Expressions]({{< relref "expressions.md" >}}).
For more information about expressions, refer to [Expressions]({{< relref "expressions.md" >}}).