fetzerch / grafana-sunandmoon-datasource

SunAndMoon is a datasource plugin for Grafana that calculates the position of Sun and Moon as well as the Moon illumination. ☀️🌙🧛‍♂️
MIT License
41 stars 8 forks source link

Messed up graphics #29

Closed BertSchel closed 3 years ago

BertSchel commented 3 years ago

EXPECTED: Sun altitude curve to follow values REALITY: Curve not following values When doing certain actions view gets back to normal. (Actions for example: settings: transparant slider off and on again, changing timepicker, sometimes refresh works but not always...) Grafana-version is Grafana v7.1.3 . In pictures white filled curve is sun altitude, Both metrics are on different axes. notok ok

fetzerch commented 3 years ago

The addon just passes datapoints to Grafana. I doubt that the issue is caused by the addon. Have you tried reporting this in https://github.com/grafana/grafana.

BertSchel commented 3 years ago

The addon just passes datapoints to Grafana. I doubt that the issue is caused by the addon. Have you tried reporting this in https://github.com/grafana/grafana.

Nope, did not report it there yet. Guess you're right that it cannot be caused by the addon, but i never ever had this issue with any other datasources or addons. Will give it a try later in the link you gave me. Thx!

Schrolli91 commented 3 years ago

Same problem here... And only with this plugin. Grafana 7.2.2

image

@BertSchel have you opened a issue in the grafana repo? Can't find any from you. Do you have found a solution?

BertSchel commented 3 years ago

Same problem here... And only with this plugin. Grafana 7.2.2

image

@BertSchel have you opened a issue in the grafana repo? Can't find any from you. Do you have found a solution?

Sorry, I did not open an issue in the grafana repo. For me the issue is currently gone. Here's what I did: Updated grafana, also 7.2.2, The problem was still there. I made a new dashboard and copy/pasted the graph panels one by one from the old dashboard to the new dashboard. (copy-function from the dropdown menu in the panel: More...→copy) Strangely the graphs seem to be working well now without the unwanted lines.

BertSchel commented 3 years ago

Schrolli91 opened an issue in the grafana repo, looks like a bug in the addon afterall.

See: grafana/grafana/issues/28804

Schrolli91 commented 3 years ago

@fetzerch it looks realy like a bug in the datasource plugin.

Take a look at this. It's using wrong values for the calculation but the raw data gauge is correct. image

Anf if you take look into the issue i've posted in the grafana repo, the data have w wrong order sometimes. Values are correct, but the timestamps seem's to be messy here:

...
06.11.2020 12:12:27 - 24 °
06.11.2020 12:12:59 - 24 °
06.11.2020 11:47:47 - 24 °
06.11.2020 11:48:18 - 24 °
...

Most times it works correct in the gauges if i push F5 but after a dashboard refresh the valus are wrong

Schrolli91 commented 3 years ago

I think the problem is, that sometimes, there are missing values and these are not filled with previous. And in this case the calculations will be wrong. It wont help, if i select Last (Not Null) on the gauges, because the result of my calc isn't null. In conclusion it will calc null - 31 and the result isn't null but -31. image

fetzerch commented 3 years ago

Hm. Ok thanks and sorry. That's really strange. Looking at the code I can't spot what could be causing this.

I've reworked the plugin to be compatible with the new grafana plugin toolkit in https://github.com/fetzerch/grafana-sunandmoon-datasource/pull/32. In that branch I'm also no longer able to reproduce your issue. Maybe you want to try it :-)

Schrolli91 commented 3 years ago

Thanks for your fast reply. How can i install the plugin from this branch?

fetzerch commented 3 years ago

Until it's released on grafana.com, I suppose the easiest is to fetch the zip file from github (branch react) and unzip into the grafana plugins directory. See https://grafana.com/docs/grafana/latest/plugins/installation/#install-a-packaged-plugin

Schrolli91 commented 3 years ago

works like a charm with the react branch - thanks

but its running only a few minutes till now - i will report later if there was any further problems

Schrolli91 commented 3 years ago

No problems so far - works nice now - thank you

BertSchel commented 3 years ago

Thanks for this, works great!