Like Prometheus, but for logs.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
loki/pkg/util/validation/validate.go

38 lines
1.1 KiB

package validation
import "github.com/prometheus/client_golang/prometheus"
const (
discardReasonLabel = "reason"
// 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.
var DiscardedBytes = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: "loki",
Name: "discarded_bytes_total",
Help: "The total number of bytes that were discarded.",
},
[]string{discardReasonLabel, "tenant"},
)
// DiscardedSamples is a metric of the number of discarded samples, by reason.
var DiscardedSamples = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: "loki",
Name: "discarded_samples_total",
Help: "The total number of samples that were discarded.",
},
[]string{discardReasonLabel, "tenant"},
)
func init() {
prometheus.MustRegister(DiscardedSamples, DiscardedBytes)
}