grafana-discrete-panel icon indicating copy to clipboard operation
grafana-discrete-panel copied to clipboard

support showing string value for postgres data source

Open joezhoujinjing opened this issue 5 years ago • 10 comments

Currently it seems only numeric values are support. If the value is string (i.e. varchar), it will not crash but no value is shown.

joezhoujinjing avatar Oct 24 '18 08:10 joezhoujinjing

@ryantxu if it's supported but I somehow missed that, could you kindly point me how to do it? Thanks very much.

joezhoujinjing avatar Oct 24 '18 08:10 joezhoujinjing

I could use this feature too, but for ms sql data sources. I can use string values with influxdb sources already.

nathanpegram avatar Oct 26 '18 00:10 nathanpegram

Yea, influxdb works for me as well, but I wanted to use redshift, so want to have postgres working as well.

joezhoujinjing avatar Oct 26 '18 02:10 joezhoujinjing

what behavior are you seeing? I am using it with a postgres (google SQL, pretendign to be postres) datasource without issue

ryantxu avatar Oct 26 '18 04:10 ryantxu

Same problem here. Using postgres 10. It says: "Value column must have numeric datatype, column: status type: string value: OK" Wierdly enoug, if I choose my primary key id as metric it says, that it would be able to use a string as a metric name: "Column metric must be of type UNKNOWN, TEXT, VARCHAR, CHAR. metric column name: metric type: INT8 but datatype is int64" Screenshot from 2019-03-18 09-55-23

egodigitus avatar Mar 18 '19 09:03 egodigitus

I've got the same issue with mysql. would be grate if "value" could be a string.

balu- avatar Oct 16 '19 15:10 balu-

It seems that I am running into the same issue. @ryantxu what extra information do you need?

Without touching to the query, if I "format as table" and use the default table visualization tool, the data is a simple table with a column "time" and another one with strings in it.

leolchat avatar Jan 14 '20 01:01 leolchat

It might be a grafana issue, since when I format the query as "time series" and expand the query, it seems that the output is empty:

Screenshot from 2020-01-13 17-57-22

Is there any chance to have the plugin work with query formatted as table? #40

leolchat avatar Jan 14 '20 01:01 leolchat

Having the same problem with MySQL datasource, so have to convert my Values to ints using a case statement... which doesn't make for a very readable graph legend :(

nefilim avatar Mar 25 '20 17:03 nefilim

Hi All

I've been banging my head against this lately too. I've found that with current versions of Grafana (ie: 6+), the currently released version of the plugin (0.0.9) doesn't work with strings.

Long story short: build your own v0.0.10-dev version from git master, and you'll get something that works with the latest Grafana.

cheers Ben

nerdb0y avatar Apr 06 '20 08:04 nerdb0y