Increase discarded samples when line is too long. (#1708)

* Increase discarded samples when line is too long.

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>

* Add comment on the public props

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>

Co-authored-by: Joe Elliott <joe.elliott@grafana.com>
pull/1748/head
Cyril Tovena 5 years ago committed by GitHub
parent 6328146876
commit 4fdfbe8e56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      pkg/distributor/validator.go
  2. 2
      pkg/util/validation/validate.go

@ -12,6 +12,7 @@ import (
"github.com/grafana/loki/pkg/logproto"
"github.com/grafana/loki/pkg/util"
"github.com/grafana/loki/pkg/util/flagext"
"github.com/grafana/loki/pkg/util/validation"
)
type Validator struct {
@ -38,6 +39,7 @@ func (v Validator) ValidateEntry(userID string, entry logproto.Entry) error {
// an orthogonal concept (we need not use ValidateLabels in this context)
// but the upstream cortex_validation pkg uses it, so we keep this
// for parity.
validation.DiscardedSamples.WithLabelValues(validation.LineTooLong, userID).Inc()
return httpgrpc.Errorf(
http.StatusBadRequest,
"max line size (%s) exceeded while adding (%s) size line",

@ -8,6 +8,8 @@ const (
// RateLimited is one of the values for the reason to discard samples.
// Declared here to avoid duplication in ingester and distributor.
RateLimited = "rate_limited"
// LineTooLong is a reason for discarding too long log lines.
LineTooLong = "line_too_long"
)
// DiscardedBytes is a metric of the total discarded bytes, by reason.

Loading…
Cancel
Save