prometheus/pkg
Callum Styan 5bb7f00d00
change labelset comparison in promql engine to avoid false positive during detection of duplicates (#7058)
* Use go1.14 new hash/maphash to hash both RHS and LHS instead of XOR'ing
which has been resulting in hash collisions.

Signed-off-by: Callum Styan <callumstyan@gmail.com>

* Refactor engine labelset signature generation, just use labels.Labels
instead of hashes.

Signed-off-by: Callum Styan <callumstyan@gmail.com>

* Address review comments; function comments + store result of
lhs.String+rhs.String as key.

Signed-off-by: Callum Styan <callumstyan@gmail.com>

* Replace all signatureFunc usage with signatureFuncString.

Signed-off-by: Callum Styan <callumstyan@gmail.com>

* Make optimizations to labels String function and generation of rhs+lhs
as string in resultMetric.

Signed-off-by: Callum Styan <callumstyan@gmail.com>

* Use separate string functions that don't use strconv just for engine
maps.

Signed-off-by: Callum Styan <callumstyan@gmail.com>

* Use a byte invalid separator instead of quoting and have a buffer
attached to EvalNodeHelper instead of using a global pool in the labels
package.

Signed-off-by: Callum Styan <callumstyan@gmail.com>

* Address review comments.

Signed-off-by: Callum Styan <callumstyan@gmail.com>

* Address more review comments, labels has a function that now builds a
byte slice without turning it into a string.

Signed-off-by: Callum Styan <callumstyan@gmail.com>

* Use two different non-ascii hex codes as byte separators between labels
and between sets of labels when building bytes of a Labels struct.

Signed-off-by: Callum Styan <callumstyan@gmail.com>

* We only need the 2nd byte invalid sep. at the beginning of a
labels.Bytes

Signed-off-by: Callum Styan <callumstyan@gmail.com>
2020-05-12 14:03:15 -07:00
..
exemplar Add exemplar support to the openmetrics parser (#6292) 2019-11-19 09:33:30 +00:00
gate Fix exported function comments (#6002) 2019-09-10 14:45:09 +01:00
labels change labelset comparison in promql engine to avoid false positive during detection of duplicates (#7058) 2020-05-12 14:03:15 -07:00
logging Add windows tests for query logger (#6653) 2020-01-20 13:17:11 +00:00
modtimevfs *: check that assets are up-to-date (#4731) 2018-11-09 11:31:36 +01:00
pool Fixed flakty pool test. 2020-04-23 14:14:44 +01:00
relabel refine error handling in prometheus (#5388) 2019-03-26 00:01:12 +01:00
rulefmt fix bug missing an error. (#7020) 2020-03-21 12:05:19 +00:00
runtime Fix golint issues. 2020-03-23 20:38:43 +01:00
textparse Fix golint issues. 2020-03-23 20:38:43 +01:00
timestamp Use .UTC everywhere we use time.Unix (#7066) 2020-03-29 17:35:39 +01:00
value Fix spelling/typos (#4921) 2018-11-27 17:44:29 +01:00