So I’m using grafana to display the current over time:

The query:

Note that the math(*1000) is just to convert from A to mA.
You can see that the average current is 0.663mA. If we supose this average as the constant value over the 24h period (which is what is being displayed) we would get: 0.663mA*24h=15.91mAh

So now I want to calculate and show this value but doing it the correct way. This means using integral() to take into account the fact that the current is not really constant (but nearly):

I multiply by 1000 to convert from A to mA and divide by 3600 to convert from seconds to hours.

At the end:

As you can see the result is 10 times bigger than the expected aproximated value.

What am I doing wrong?