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 28ea993872
commit cdf1e6684b

View file

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