Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG:Option "ignore unknown" removes too many columns #217

Closed
Kortenbach opened this issue Oct 3, 2022 · 4 comments
Closed

BUG:Option "ignore unknown" removes too many columns #217

Kortenbach opened this issue Oct 3, 2022 · 4 comments

Comments

@Kortenbach
Copy link

Kortenbach commented Oct 3, 2022

When using the CSV plugin in Grafana "explore" you can define a name and a datatype for each column.
Then, when you tick "ignore unknown" the columns that do not match the schema should disappear.
Instead every column disappears (sometimes except for the first).
When I use the query inspector I find that the datatype of each column is "string" instead of string, string, num, num.

This is my datasource:

tagName;comment;min;max
CHRONOS/PLC1/Reg400001;Modbus dataregister;15.0;30.1
CHRONOS/PLC1/Reg400002;Modbus dataregister;16.0;30.1
CHRONOS/PLC1/Reg400003;Modbus dataregister;17.0;30.2
CHRONOS/PLC1/Reg400004;Modbus dataregister;18.0;30.3
CHRONOS/PLC1/Reg400005;Modbus dataregister;19.0;30.4
CHRONOS/PLC1/Reg400006;Modbus dataregister;20.0;30.0 

(Edit)
I found that this has to do with the query editor in Grafana.
When I select the column type as "Number" then, sometimes, I see the 15.0, 16.0,... (strings) turn into 15, 16,... (Numbers). If that happens then everything works fine! (But I don't know how to trigger that yet)

(Edit 2)
I just succeeded to trigger the "number" field type again. This is the log from the Query history:
{"decimalSeparator":".","delimiter":";","header":true,"hide":false,"ignoreUnknown":false,"params":[["test","0"]],"path":"/AnaAlarms-csv","schema":[{"name":"tagName","type":"string"},{"name":"min","type":"string"}],"skipRows":0}
(not working)

{"decimalSeparator":".","delimiter":";","header":true,"hide":false,"ignoreUnknown":false,"params":[["test","0"]],"path":"/AnaAlarms-csv","schema":[{"name":"tagName","type":"string"},{"name":"min","type":"number"}],"skipRows":0}
(working)

(edit 3)
When building a dashboard with the CSV plugin I can look at and change the JSON that is sent. In this JSON I can look at the "min" field and change it's type from string to number. This is a work around.
However, this workaround (edit JSON) is not accessable from the alert-rule editor or the explorer.

(edit 4)
Final workaround: Started using the infinity plugin (supports CSV among others).

@Kortenbach
Copy link
Author

Issue closed, but is it solved??

@zoltanbedi
Copy link
Member

You solved it by using infinity datasource instead.

@Kortenbach
Copy link
Author

OK
I would call that a work-around. :-)

@zoltanbedi
Copy link
Member

I closed it because you found a workaround and because there wasn't much reaction from community in a year.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants