neuralfraud / grafana-prtg

A PRTG Datasource plugin for Grafana
177 stars 75 forks source link

Graph shows execution time instead of value seemingly at random. #158

Open digdilem opened 4 years ago

digdilem commented 4 years ago

Great plugin, thanks.

I have exactly one issue, which is confusing me.

I have a prtg plugin that collects directory sizes from various database servers and plonks them in PRTG. This works fine and is very reliable.

The grafana plugin grabs these from PRTG and displays them - but sometimes they work as expected, and sometimes they don't.

What seems to be happening is that Grafana is interpreting one of the fields, Execution Time, as the value and using that to display, meaning all the dirsizes are displayed with a byte size matching that of the execution time.

Then, if I leave it, eventually it'll change back on one refresh to correctly displaying values. It'll switch back between these states seemingly at random. It might be in the order these fields are received by Grafana but I've not been able to prove that.

Is there a way I can force Grafana to only read the field?

Redacted pics and a snippet from the Query inspector follow. Thanks.

`xhrStatus:"complete" request:Object method:"GET" url:"api/datasources/proxy/2/historicdata.xml" response:"<?xml version="1.0" encoding="UTF-8"?> 20.1.55.1775 01/03/2020 13:40:00 - 13:45:00 43891.5729166667 387 msec 387.0000 522 MB 547360887.0000 15,394 MB 16141659622.0000

` ![thing1](https://user-images.githubusercontent.com/4052275/75682030-a31d3a80-5c8c-11ea-8c28-22b8649a1fa3.jpg) ![thing2](https://user-images.githubusercontent.com/4052275/75682031-a3b5d100-5c8c-11ea-8539-0de8dac8ea23.jpg)
digdilem commented 4 years ago

Also example of the query

thing3

angela-d commented 4 years ago

Your output is generating XML, the latest version neuralfraud released uses json. Have you given it a shot to see if it fixes this issue?

When upgrading from v4.0.3 to v4.0.4, some graphs may break due to the channel name change. To fix, go into the query for the broken objects and re-add the channel for the affected visualizations.

digdilem commented 4 years ago

Thank you for your response. I have just tried that and after restarting grafana, unfortunately results were mixed.

It did seem to fix these specific graphs - at least, they displayed okay.

Unfortunately it broke a lot of the other graphs and singlestats. As you suggested, I tried re-creating them using the usual grafana interface but despite the query inspector showing a full set of results, the graph/ss still showed no data. I don't have enough time today to dig deeper so I've reverted to 4.0.3. (Even if it worked, this change would also mean several hundred manual changes on my part)

Sorry