I then parse the response into PRTG.
The problem i have is that sometimes it will return with nothing () in Postman (and PRTG) and some other times it will return 2 groups of keys and values.
Normal (expected) response:
If i keep clicking Send in Postman every 10-20 seconds it sometimes returns:
Some other times, rare but it happens, it will return something like:
That results into a parsing and graphing mess in PRTG.
The issue in the last example seems to be the 'timespan' parameter, notice that it returns the value for two periods of time, 1 minute duration each. That's confirmed in the dashboard as the uplink 'Historical Data' graph seems to work in 1 minute intervals.
My first thought was that the 90 seconds timespan will occasionally return two values, one for the past 60 seconds and one for the 60 seconds before it. I now tried requesting a timespan of 60 seconds instead but i am seeing the same issue where it will often return nothing. That stops PRTG from plotting a smooth graph similar to the one on the dashboard. Interestingly, the issue applies to both WAN links, they will both either return something or nothing.
Nothing else is querying this API so we are definitely not hitting the 5 calls per second limit.
I could play around with a longer timespan or the t0 and t1 values but i would like to monitor this in a way where i can spot latency spikes, ideally so it looks similar to the graph on the dashboard.
Anyone knows what pattern this follows?
It seems to be clearing the values every now and then and eventually replacing them with the most current ones, then adding to these.
Some experiments i've done:
-- timespan=300 usually returns 4 values but something 5.
-- timespan=180 sometimes returns 1 value, other times 3, some other times 2 which makes no sense.
-- timespan=180 and above seem to ALWAYS return at least 1 value.