When i use prometheus (promql) in grafana as datasource i can define a single query that shows multiple graphs on the same panel (e.g. http_requests_total shows all http request). Now i would like to do the same with a sql datasource. I have a table that contains time series data as a simple counter with some tags. i would like to show the counter_value for each tag as a graph. It would work when i define for each tag a single query. But this solution is not really maintainable because the tags can vary. I would prefere to have only 1 query as it works with promql. Is there a way to define a single query that shows for each tag a graph?
In this example only 1 graph is shown. I tried it with group by and my tag column but without success.
SELECT
$__timeGroupAlias(created,24h),
sum(counter_value) AS "counter_value"
FROM counter
GROUP BY 1
ORDER BY 1