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
{{ message }}
This repository was archived by the owner on Dec 11, 2022. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+33Lines changed: 33 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -124,6 +124,39 @@ If Grafana is running on a Google Compute Engine (GCE) virtual machine, it is po
124
124
125
125
Read more about creating and enabling service accounts for GCE VM instances [here](https://cloud.google.com/compute/docs/access/create-enable-service-accounts-for-instances).
126
126
127
+
#### Using the Query Builder
128
+
The query builder provides a simple user-friendly interface to help you quickly set up your query. The builder enables you to define the basic parts of your query, The common ones are:
129
+
1. The table you want to query from
130
+
2. The time field and metric field
131
+
3. WHERE clause - You can use one of the pre-defined macros to speed your writing time or set up your own Expression. Existing Macros are:
132
+
133
+
a. Macro $__timeFiler with last 7 days example:
134
+
```
135
+
WHERE `createDate` BETWEEN TIMESTAMP_MILLIS (1592147699012) AND TIMESTAMP_MILLIS (1592752499012) AND _PARTITIONTIME >= '2020-06-14 18:14:59' AND _PARTITIONTIME < '2020-06-21 18:14:59'
136
+
```
137
+
b. Macro $__timeFrom with last 7 days example:
138
+
```
139
+
WHERE `createDate` > TIMESTAMP_MILLIS (1592223758609) AND _PARTITIONTIME >= '2020-06-15 15:22:38' AND _PARTITIONTIME < '2020-06-22 15:22:38'
140
+
```
141
+
c. Macro $__timeTo with last 7 days example:
142
+
```
143
+
WHERE `createDate` < TIMESTAMP_MILLIS (1592828659681) AND _PARTITIONTIME >= '2020-06-15 15:24:19' AND _PARTITIONTIME < '2020-06-22 15:24:19'
144
+
```
145
+
146
+
4. GROUP BY option - You can use a pre-defined macro or use one of the fields from your query
147
+
a. time ($__interval,none)
148
+
5. ORDER BY option
149
+
150
+
Note: If your processing location is not the Default US one set your location from the processing Location drop-down at the top right bottom of the query builder
151
+
152
+
###Troubleshooting
153
+
Viewing your Query
154
+
1. Use The Query Inspector located at the top of the query builder
155
+
156
+
2. The query Inspector enables you to see the clean query and troubleshoot SQL errors
157
+
158
+
The Query builder comes with a set of defaults which are control from the top of the Query Builder
0 commit comments