grafana / grafana-csv-datasource

A data source for loading CSV data into Grafana.
https://grafana.com/plugins/marcusolsson-csv-datasource
Apache License 2.0
73 stars 28 forks source link

space char at end of file fails #11

Closed mikethebee closed 3 years ago

mikethebee commented 3 years ago

This is not a big issue, but may be easy to address. My csv was failing and it took me a bit of time to realise that I had got a 'space' at the end of each line. If this was identified in the fail error message someway it would have alerted me to my formatting error.

marcusolsson commented 3 years ago

Thanks for the bug report! Indeed this should be a small fix. Would it be ok with you if I keep this as a "good first issue" for anyone looking to contribute to the plugin?

mikethebee commented 3 years ago

New Year greetings. Indeed that is great. I will look at it myself, although I have no Typescript experience yet, it will be an opportunity. BTW, I thought I would need an InFlux DB, but setting a simple one up proved more complicated than needed for a simple mqtt data feed from LoraWAN temperature sensors, so your plugin was a god-send. Thx.

marcusolsson commented 3 years ago

The CSV data source is a backend plugin (it's run server-side rather than in the browser) and is written in Go. I'm currently refactoring the code in question to add support for loading CSV from disk, but feel free to experiment with it in the meantime.

You can find the function for parsing the CSV here:

https://github.com/marcusolsson/grafana-csv-datasource/blob/b9980b21199f968a2da47fba62b8bed96e0da430/pkg/datasource.go#L137-L268

(I'm not touching the code in that function during my refactoring work)

I'd be happy to help answering any TypeScript or Go related questions if you run into any trouble!