Hi Alexander
Thanks for a supreme plugin for Zabbix and Grafana
We are using it very intensive
That said, we have some issues with the SLA / IT-service calculation from Zabbix to Grafana
Our SLA is'nt correct displayed in Grafana. If we query the Zabbix API we get the correct number, but not in grafana
Example:
SLA in grafana shows 97.9647 % with "max data points" set and "This month so far" set

without the max data points the result is this time the same (sometimes the SLA is more accurate when the "Max data points" are set to 100, but not always)
SLA in Zabbix shows 97.0300 for the same period

We think it's because the plugin calculates the intervals instead of just displaying the value, but you might also have an opinion about this, I think
The problem is both in Grafana 6.2.0 and the lastest release 6.5.3
Cheers
Lars
Denmark
I confirm the problem. Look at SLA graph - last data's point has value 98.750 at 2020-02-14 05:00:00. But as you can see at graph, real last value higher. And Zabbix display value 99.0675.
Interval - 7 days.
Grafana 6.5.3, Zabbix 4.0.17.

same here
We have the same problem.
I performed some diagnostics.
Results in screenshots. It's clear, that result in grafana incorrect.



I have done some digging in the code, and as far as I can see, there are a number of isssues in play here. Some also depend on the way the plugin is used in the individual case. In our use case (lbaad and me) we use singlestat panels to show a 30 day based SLA.
We have two issues:
For item 2 removing the for loop in getLSAIntervals seems to do the trick, however this will not work for tables or graphs. It would probaply be better to look at the type of visualization used and then proceed based on that.
Cheers
Kristian
I have done some digging in the code, and as far as I can see, there are a number of isssues in play here. Some also depend on the way the plugin is used in the individual case. In our use case (lbaad and me) we use singlestat panels to show a 30 day based SLA.
We have two issues:
- The date rounding seems to add some time to the interval. This is the Math.floor and Math.ceil part of getSLAIntervals.
- The interval requested for a singlestat for a month is resulting in some 32 individual intervals being requested from Zabbix and then pieced together in Grafana.
For item 2 removing the for loop in getLSAIntervals seems to do the trick, however this will not work for tables or graphs. It would probaply be better to look at the type of visualization used and then proceed based on that.
Cheers
Kristian
Where can you remove these loops? I also have differences in values.
A my mistake.
Item 2 is in the BuildSLAIntervals function, located in ZabbixAPIConnector.js.
It is this loop:
for (let i = timeFrom; i <= timeTo - slaInterval; i += slaInterval) {
intervals.push({
from : i,
to : (i + slaInterval)
});
which need to be altered like this:
intervals.push({
from: timeFrom,
to: timeTo
})
But as previously stated, this will only work for singlestat type visualizations where we need to have 1 interval returned.
Cheers
Kristian
The overall problem is that Grafana plugin requests SLA data with breaking it down to 1h intervals, then math is applied (avg etc), it's incorrect.
For tables/singlestats plugin should not break down by 1 hour intervals, instead it have to request SLA value for the whole dashboard's time range. Zabbix API will return 1 value - SLA for this period, calculated correctly.
How i do that?
El mar., 31 de mar. de 2020 a la(s) 07:46, Konstantin Kornienko (
[email protected]) escribió:
The overall problem is that Grafana plugin requests SLA data with breaking
it down to 1h intervals, then math is applied (avg etc), it's incorrect.
For tables/singlestats plugin should not break down by 1 hour intervals,
instead it have to request SLA value for the whole dashboard's time range.
Zabbix API will return 1 value - SLA for this period, calculated correctly.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/alexanderzobnin/grafana-zabbix/issues/885#issuecomment-606547832,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ACK7TXKW7FQ6JIYDTHWGIRTRKHCZLANCNFSM4KM7VBEQ
.
--
"Si tienes una manzana y yo tengo una manzana y las intercambiamos,
entonces tu y yo todavÃa tendremos una manzana. Pero si tu tienes
una idea y yo tengo una idea e intercambiamos esas ideas, entonces
I suppose, that plugin should be updated with new option for SLA:
SLA aggregation interval with values like this:
have no time to create PR. Maybe someone could help?
Hi! Yes, it's because of the new feature introduced recently - SLA over time. I should add interval option as @konstantin-kornienko mentioned.
@alexanderzobnin, thanks a lot for this! Tested, at first glance works as expected!
Most helpful comment
I have done some digging in the code, and as far as I can see, there are a number of isssues in play here. Some also depend on the way the plugin is used in the individual case. In our use case (lbaad and me) we use singlestat panels to show a 30 day based SLA.
We have two issues:
For item 2 removing the for loop in getLSAIntervals seems to do the trick, however this will not work for tables or graphs. It would probaply be better to look at the type of visualization used and then proceed based on that.
Cheers
Kristian