mirror of
https://github.com/grafana/grafana.git
synced 2025-01-23 15:03:41 -06:00
AzureMonitor: Improve Azure Resource Graph docs (#34450)
* Add macros in ARG doc * Update docs/sources/datasources/azuremonitor.md Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com> * Update docs/sources/datasources/azuremonitor.md Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com> * Update docs/sources/datasources/azuremonitor.md Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com> * Update docs/sources/datasources/azuremonitor.md Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com> * Update docs/sources/datasources/azuremonitor.md Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com> * Update docs/sources/datasources/azuremonitor.md Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com> * Update docs/sources/datasources/azuremonitor.md Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com> Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
This commit is contained in:
parent
e8d5b2431e
commit
5c5c3bdd94
@ -231,6 +231,28 @@ In Azure Resource Graph many nested properties (`properties.displayName`) are of
|
||||
|
||||
The Azure documentation also hosts [many sample queries](https://docs.microsoft.com/en-gb/azure/governance/resource-graph/samples/starter) to help you get started
|
||||
|
||||
### Azure Resource Graph macros
|
||||
|
||||
You can use Grafana macros when constructing a query. Use the macros in the where clause of a query:
|
||||
|
||||
- `$__timeFilter()` - Expands to
|
||||
`timestamp ≥ datetime(2018-06-05T18:09:58.907Z) and`
|
||||
`timestamp ≤ datetime(2018-06-05T20:09:58.907Z)` where the from and to datetimes are from the Grafana time picker.
|
||||
|
||||
- `$__timeFilter(datetimeColumn)` - Expands to
|
||||
`datetimeColumn ≥ datetime(2018-06-05T18:09:58.907Z) and`
|
||||
`datetimeColumn ≤ datetime(2018-06-05T20:09:58.907Z)` where the from and to datetimes are from the Grafana time picker.
|
||||
|
||||
- `$__timeFrom()` - Returns the From datetime from the Grafana picker. Example: `datetime(2018-06-05T18:09:58.907Z)`.
|
||||
|
||||
- `$__timeTo()` - Returns the To datetime from the Grafana picker. Example: `datetime(2018-06-05T20:09:58.907Z)`.
|
||||
|
||||
- `$__escapeMulti($myVar)` - Use with multi-value template variables that contain illegal characters. If `$myVar` has the two values as a string `'\\grafana-vm\Network(eth0)\Total','\\hello!'`, then it expands to: `@'\\grafana-vm\Network(eth0)\Total', @'\\hello!'`. If you are using single value variables, then there is no need for this macro, simply escape the variable inline instead - `@'\$myVar'`.
|
||||
|
||||
- `$__contains(colName, $myVar)` - Use with multi-value template variables. If `$myVar` has the value `'value1','value2'`, the it expands to: `colName in ('value1','value2')`.
|
||||
|
||||
If using the `All` option, then check the `Include All Option` checkbox and in the `Custom all value` field type in the following value: `all`. If `$myVar` has value `all` then the macro will instead expand to `1 == 1`. For template variables with a lot of options, this will increase the query performance by not building a large "where..in" clause.
|
||||
|
||||
## Going further with Azure Monitor
|
||||
|
||||
See the following topics to learn more about the Azure Monitor data source:
|
||||
|
Loading…
Reference in New Issue
Block a user