lib/protoparser/opentsdbhttp: increment errors counter on unmarshal errors

This is a follow-up for 149c0c4a6d
This commit is contained in:
Aliaksandr Valialkin 2020-11-13 13:22:00 +02:00
parent 4d9501a0c4
commit d21b1606a1

View File

@ -62,6 +62,7 @@ func ParseStream(req *http.Request, callback func(rows []Row) error) error {
defer putJSONParser(p)
v, err := p.ParseBytes(ctx.reqBuf.B)
if err != nil {
unmarshalErrors.Inc()
return fmt.Errorf("cannot parse HTTP OpenTSDB json: %w", err)
}
rs := getRows()