Hi, I've encountered an issue where I get negative rates as output from my tick script which a non-negative derivative.
The issue seems to be caused by a rare race condition in my specific environment, but in the end is caused by the derivative not checking if it's using a duration below 0:
Kapacitor keeps information about the previous point - but this point may not always be chronologically before the new/incoming point.
If a point arrives which has a timestamp before the prev point, it will lead to a negative rate, even if the NonNegativeFlag is specified.
If any further information is needed, please let me know.