bosun-monitor / bosun

Time Series Alerting Framework
http://bosun.org
MIT License
3.4k stars 495 forks source link

Bug: dropbool() documentation inconsistent with behaviour #2496

Closed muffix closed 3 years ago

muffix commented 3 years ago

Context

The documentation for dropbool() currently states

Drop datapoints where the corresponding value in the second series set is non-zero. (See Series Operations for what corresponding means).

The name of the function suggests that the described behaviour is the intended one, but the behaviour is inconsistent with the documentation. Currently, the points are *kept( (rather than dropped) where the corresponding value in the second series set is non-zero.

We should update the documentation to describe the actual behaviour and consider a breaking change that gives the function the desired (and from the name more intuitive behaviour) in a future version.

Steps to reproduce

  1. Run the following query: dropbool(series("foo=bar", 0, 1, 1, 1, 2, 1, 3, 1), series("", 0, 1, 1, 2, 2, 3, 3, 2) != 2)
  2. Observe the output: {"0": 1, "2": 1} - expected is {"1": 1, "3": 1} with the current documentation.