Go reads a group name as Unicode letters, decimal digits and _, so in
$1² the name is 1; char::is_alphanumeric also takes ² and other number
characters.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
Prometheus compares bounds with < and >, so +0 and -0 are equal, keep
input order, and coalescing keeps the first; ordering -0 first returned
the other zero and flipped the sign of an infinite reciprocal.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
Prometheus treats +0 and -0 as equal and sorts short windows by
insertion, keeping them in window order; sorting -0 before +0 picked
the other zero and flipped the sign of an infinite reciprocal.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
Prometheus 3.15 takes the max of the last float timestamp and the
histogram one, which defaults to 0 without histograms.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
The aggregation kept one owned histogram slot per point of the whole
input span before trimming, which for a sparse group allocated far more
than the result.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
label_replace expands its template with Go's regexp.Expand rules, where
$01 or a reference of more than nine digits names a group. Series that
share a label set merge field by field, colliding only when one field
has two values at one point.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
topk and bottomk reject a NaN k and one out of int64, as Prometheus
does, instead of returning results. absent marks each field absent on
its own, as fields are evaluated independently.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
Results only need to agree with Prometheus within the relative tolerance
promql-compat uses, so Go's bound table and the ports of math.Log2,
Exp2, Ldexp and Frexp go; the fixtures are compared within that
tolerance.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
Results only need to agree with Prometheus within the relative tolerance
promql-compat uses, so the ports of Go's math.Pow and math.Atan2 go; the
Go results stay as a fixture compared within that tolerance.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
The evaluator stopped at a grid point whose window was not complete yet
before advancing past the samples that window cannot use, so a long gap
between grid points kept every sample pushed in the meantime.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
Prometheus drops __type__ and __unit__ with __name__ for these functions,
but only __name__ for the single-histogram functions.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
Arithmetic and bool comparisons drop __type__ and __unit__ with
__name__, as Prometheus does. __type__ stays part of the match group, so
results of different groups can now share a label set; that fails as
duplicate label sets after the operator, while two results within one
group still fail the group_x uniqueness check.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
Prometheus drops __name__, __type__ and __unit__ from the result of every
range function except last_over_time and first_over_time; the evaluator
passed the metric through unchanged.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>