lib/protoparser/prometheus/parser.go (#970)

fix parse timestamp error if there are some whitespaces after timestamp
This commit is contained in:
BigFish 2020-12-17 05:36:20 +08:00 committed by Aliaksandr Valialkin
parent 49b6c6f6ab
commit 60dd48c9eb

View file

@ -166,6 +166,8 @@ func (r *Row) unmarshal(s string, tagsPool []Tag, noEscapes bool) ([]Tag, error)
// There is no timestamp - just a whitespace after the value.
return tagsPool, nil
}
// There are some whitespaces after timestamp
s = skipTrailingWhitespace(s)
ts, err := fastfloat.Parse(s)
if err != nil {
return tagsPool, fmt.Errorf("cannot parse timestamp %q: %w", s, err)