QL charts: Overview
QL charts are charts created from a connection if the connection source is a database, Prometheus, or Monitoring. To create such charts, one uses direct queries to the source. Depending on the chart type, the query can be run in the source database's SQL dialect, as well as the Prometheus or Monitoring query languages. This helps you to expand visualization capabilities by using language-specific transactions.
Running a query does not create a separate dataset object: a chart is generated on the fly and displayed in the preview panel.
Unlike dataset-based charts, the logic of a visualization area in QL charts favors queries against the source, i.e., the visualization area only displays the data from the query.
Alert
If users are granted permission to view your QL chart, they will be able to make any queries to any source data of this QL chart.
The following types of QL charts are supported:
-
SQL. These allow you to build visualizations with flexible dataset management based on parameterization of an SQL query to the source DB.
SQL charts:
-
Reduce database workload by using direct queries.
-
Are only suitable for
SELECT
queries. -
Enable the use of
JOIN
,GROUP BY
, andSORT BY
queries and aggregate functions in SQL queries. -
Enable the parameterization of any part of a SQL query.
-
Support a limited set of visualizations types.
-
Do not support RLS and calculable fields.
Example database query ClickHouse®
SELECT Category, Month, ROUND(SUM(Sales)) FROM samples.SampleLite WHERE Category in {{category}}: A variable used in the selector GROUP BY Category, Month: Grouping by category and month ORDER BY Category, Month: Sorting by category and month
-
-
Prometheus. These allow you to create a chart based on Prometheus. You cannot build a dataset on top of this source. You can only work with it using QL charts.
Example query for Prometheus
sum by (name) (rate(container_cpu_user_seconds_total{container_label_org_label_schema_group="monitoring"}[1m]) * 100 / scalar(count(node_cpu_seconds_total{mode="user"})))
-
Monitoring. These allow you to create a chart based on Yandex Monitoring. You cannot build a dataset on top of this source. You can only work with it using QL charts.
Example query for Monitoring
{project="monitoring", sensor="nodejs.heap_space.size.bytes"}
Warning
Access rights to QL charts by Monitoring and Prometheus data are managed both on the DataLens side and in Monitoring and Prometheus.
To view a chart in DataLens, the user needs chart access and connection permissions, as well as permissions to read data from a specific Prometheus API or project in Monitoring.
To create a QL chart, follow this guide.
See also
ClickHouse® is a registered trademark of ClickHouse, Inc