The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/docs/sources/shared/datasources/sql-query-builder-macros.md

869 B

headless labels
true [{products [enterprise oss]}]

Macros

You can enable macros support in the select clause to create time-series queries.

{{< docs/experimental product="Macros support in visual query builder" featureFlag="sqlQuerybuilderFunctionParameters" >}}

Use the Data operations drop-down to select a macro like $__timeGroup or $__timeGroupAlias. Select a time column from the Column drop-down and a time interval from the Interval drop-down to create a time-series query.

{{< figure src="/media/docs/grafana/data-sources/screenshot-sql-builder-time-series-query.png" class="docs-image--no-shadow" caption="SQL query builder time-series query" >}}

You can also add custom value to the Data operations. For example, a function that's not in the drop-down list. This allows you to add any number of parameters.