Grafana_Status_panel icon indicating copy to clipboard operation
Grafana_Status_panel copied to clipboard

Extend to support SQL DBs?

Open mixmastamyk opened this issue 6 years ago • 9 comments

Hi,

Would like to use this panel with an SQL DB. Currently have a job where MS SQL Server is unfortunately required. Postgres would be a great second choice.

Thanks,

mixmastamyk avatar May 11 '18 21:05 mixmastamyk

This plugin should work fine regardless of Grafana datasource used. We use it with Postgres for example. What's the specific issue you are encountering?

svet-b avatar Jul 07 '18 00:07 svet-b

Sorry, I'm not on that project any longer.

However, I seem to remember that there was no documentation on how to use it with SQL, and the readme implied it wasn't ready.

mixmastamyk avatar Jul 08 '18 01:07 mixmastamyk

Svet-b, With a postgres db, how are you able to give the metric query a unique alias to be used under options? There is no place to specify it if I choose the postgres data source under the metrics tab. If I choose an influx db, I get the alias field. The query inspector shows the expected result from the query, but I can't figure out how to use it in status panel without the alias field. Running V. 5.2.1 og Grafana and 1.08 of the Grafana Status panel plugin.

Orjanp avatar Jul 25 '18 09:07 Orjanp

@Orjanp you're right, there's some odd behavior here. A little while ago we actually transitioned our data stores from Postgres to Influx; but I just did a quick test with a Postgres data source and the status panel indeed doesn't seem to pick up the data properly (while a graph panel for example does).

For what it's worth, I don't think the alias specifically is an issue here. Under the "Metrics" tab we often define raw Influx queries without aliases, and the aliases can then be define for each of them in the "Options" tab. But at least in my test, it does look like the data itself isn't being picked up by the status panel.

svet-b avatar Jul 27 '18 16:07 svet-b

Also problem with MySQL datasource. One metric is working fine, but adding second metric gives Error: There are multiple measurements with the same alias. Please give each measurement a unique name. Please, add support for SQL datasources

kornikov avatar Oct 11 '18 06:10 kornikov

@kornikov Were you able to get it working with MYSQL. I am seeing the same issue. If i use time series my simple sql query does not return any data in the panel. If I choose table it does return data but I see an error on the panel "Cannot read property 'length' of undefined"

syedsfayaz avatar Nov 13 '18 19:11 syedsfayaz

@syedsfayaz to workaround the Cannot read property 'length' of undefined issue I had to use extract(epoch from now()) as "time" (my use case is to get real time data) in the query to set up a time column, but I'm experiencing the same issue, even though I can get the data I want (checked through query inspector), I can't get the status panel to display it.

@svet-b any plans on supporting it?

PXMYH avatar Jan 29 '19 22:01 PXMYH

Any chance support for postgres could be implemented?

Orjanp avatar Apr 15 '19 08:04 Orjanp

Hello, Any update on this issue? Looks very weird to me as SQL data sources are very popular.

wyxa avatar Nov 14 '19 18:11 wyxa