sni / grafana-thruk-datasource

Use Thruks Rest API within Grafana
MIT License
13 stars 2 forks source link

Feature request: SELECT count(*) AS < value > #44

Closed lgmu closed 7 months ago

lgmu commented 10 months ago

It would be nice to be able to use SELECT count(*) AS < value > from /services where ...

Then < value > could be displayed in a Bar gauge for example, without having to use an override as shown below:

image

Here I'm querying the plugin_output and want to count how many services have "SQL Server 2022" in the output. image

Currently the only workaround is to use Overrides: image

I also can't re-use count(*) in multiple queries, because then it would just show a single time in the Overrides. So to avoid that, you need to count different attributes

sni commented 7 months ago

SELECT count(*) AS name from /services should work as expected now.

lgmu commented 2 months ago

only works in lowercase

SELECT count(*) as TEST from /services

sni commented 2 months ago

fixed in https://github.com/sni/Thruk/commit/811ea2bf186f7318e521a75b9b13b3eac493c67c