You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docusaurus/docs/how-to-guides/data-source-plugins/sql-requirements.md
+8-11Lines changed: 8 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,36 +2,32 @@
2
2
id: sql-requirements
3
3
title: Requirements to support SQL expressions
4
4
sidebar_label: Support SQL expressions
5
-
description: Data source requirements to support SQL expressions.
5
+
description: Requirements for data source plugins to support SQL expressions.
6
6
keywords:
7
7
- grafana
8
8
- plugin
9
9
- datasource
10
10
- sql
11
11
---
12
12
13
-
Follow this guide to understand the plugin requirements to support SQL expressions.
13
+
Follow this guide to understand what your data source plugin requires to support SQL expressions.
14
14
15
15
:::caution
16
16
Only plugins with a backend can support SQL expressions.
17
17
:::
18
18
19
-
## Types of SQL responses
20
-
21
-
Requirements depend on the type of response for your query.
22
-
23
-
SQL expressions support two types of responses:
19
+
Requirements depend on the type of response for your query. SQL expressions support two types of responses:
24
20
25
21
-[Tabular data response](#tabular-data-response)
26
22
-[Labeled metric time data response](#labeled-metric-time-data-response)
27
23
28
-
### Tabular data response
24
+
##Requirements for tabular data responses
29
25
30
26
A tabular data response is a single [data frame](../../key-concepts/data-frames) with no labels on any of the fields (columns). In short, a data frame that can be directly mapped to a SQL table.
31
27
32
28
Tabular data responses work out-of-the-box.
33
29
34
-
### Labeled metric time data response
30
+
##Requirements for labeled metric time data responses
35
31
36
32
A labeled metric time data response contains data that meets the [data plane specification](https://grafana.com/developers/dataplane) and has the `Frame.Meta.Type` property set with the data plane `type`. It can be a timeseries or numeric.
37
33
@@ -79,13 +75,13 @@ func main() {
79
75
}
80
76
```
81
77
82
-
####What does the conversion look like?
78
+
### What does the conversion look like?
83
79
84
80
This is how SQL expressions convert labeled data:
85
81
86
82

87
83
88
-
## Instrument and test
84
+
## Instrument and test your plugin
89
85
90
86
### Test your plugin's SQL compatibility
91
87
@@ -102,6 +98,7 @@ Use the following metrics to check your data source's compatibility with SQL exp
102
98
```
103
99
sum(rate(grafana_sse_sql_command_input_count[$__rate_interval])) by (status,attempted_conversion,datasource_type,input_frame_type)`
104
100
```
101
+
105
102
## Troubleshooting
106
103
107
104
### My data source sends labeled data without a frame type
0 commit comments