Commit 7c78b64a by Sven Klemm Committed by Torkel Ödegaard

Document required order for time series queries (#13204)

parent 7a117a6b
...@@ -174,6 +174,8 @@ The resulting table panel: ...@@ -174,6 +174,8 @@ The resulting table panel:
If you set `Format as` to `Time series`, for use in Graph panel for example, then the query must must have a column named `time` that returns either a sql datetime or any numeric datatype representing unix epoch in seconds. You may return a column named `metric` that is used as metric name for the value column. Any column except `time` and `metric` is treated as a value column. If you omit the `metric` column, the name of the value column will be the metric name. You may select multiple value columns, each will have its name as metric. If you set `Format as` to `Time series`, for use in Graph panel for example, then the query must must have a column named `time` that returns either a sql datetime or any numeric datatype representing unix epoch in seconds. You may return a column named `metric` that is used as metric name for the value column. Any column except `time` and `metric` is treated as a value column. If you omit the `metric` column, the name of the value column will be the metric name. You may select multiple value columns, each will have its name as metric.
If you return multiple value columns and a column named `metric` then this column is used as prefix for the series name (only available in Grafana 5.3+). If you return multiple value columns and a column named `metric` then this column is used as prefix for the series name (only available in Grafana 5.3+).
Resultsets of time series queries need to be sorted by time.
**Example database table:** **Example database table:**
```sql ```sql
......
...@@ -129,6 +129,8 @@ Any column except `time` and `metric` is treated as a value column. ...@@ -129,6 +129,8 @@ Any column except `time` and `metric` is treated as a value column.
You may return a column named `metric` that is used as metric name for the value column. You may return a column named `metric` that is used as metric name for the value column.
If you return multiple value columns and a column named `metric` then this column is used as prefix for the series name (only available in Grafana 5.3+). If you return multiple value columns and a column named `metric` then this column is used as prefix for the series name (only available in Grafana 5.3+).
Resultsets of time series queries need to be sorted by time.
**Example with `metric` column:** **Example with `metric` column:**
```sql ```sql
......
...@@ -129,6 +129,8 @@ Any column except `time` and `metric` is treated as a value column. ...@@ -129,6 +129,8 @@ Any column except `time` and `metric` is treated as a value column.
You may return a column named `metric` that is used as metric name for the value column. You may return a column named `metric` that is used as metric name for the value column.
If you return multiple value columns and a column named `metric` then this column is used as prefix for the series name (only available in Grafana 5.3+). If you return multiple value columns and a column named `metric` then this column is used as prefix for the series name (only available in Grafana 5.3+).
Resultsets of time series queries need to be sorted by time.
**Example with `metric` column:** **Example with `metric` column:**
```sql ```sql
......
...@@ -45,6 +45,8 @@ Optional: ...@@ -45,6 +45,8 @@ Optional:
- If multiple value columns are returned the metric column is used as prefix. - If multiple value columns are returned the metric column is used as prefix.
- If no column named metric is found the column name of the value column is used as series name - If no column named metric is found the column name of the value column is used as series name
Resultsets of time series queries need to be sorted by time.
Table: Table:
- return any set of columns - return any set of columns
......
...@@ -45,6 +45,8 @@ Optional: ...@@ -45,6 +45,8 @@ Optional:
- If multiple value columns are returned the metric column is used as prefix. - If multiple value columns are returned the metric column is used as prefix.
- If no column named metric is found the column name of the value column is used as series name - If no column named metric is found the column name of the value column is used as series name
Resultsets of time series queries need to be sorted by time.
Table: Table:
- return any set of columns - return any set of columns
......
...@@ -143,6 +143,8 @@ Optional: ...@@ -143,6 +143,8 @@ Optional:
- If multiple value columns are returned the metric column is used as prefix. - If multiple value columns are returned the metric column is used as prefix.
- If no column named metric is found the column name of the value column is used as series name - If no column named metric is found the column name of the value column is used as series name
Resultsets of time series queries need to be sorted by time.
Table: Table:
- return any set of columns - return any set of columns
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment