mirror of
https://github.com/prometheus/prometheus
synced 2025-04-01 22:59:03 +00:00
Add comment to state intent of check
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
This commit is contained in:
parent
0793a26d96
commit
c309f50ee7
@ -365,6 +365,8 @@ type bucketLimitAppender struct {
|
|||||||
|
|
||||||
func (app *bucketLimitAppender) AppendHistogram(ref storage.SeriesRef, lset labels.Labels, t int64, h *histogram.Histogram, fh *histogram.FloatHistogram) (storage.SeriesRef, error) {
|
func (app *bucketLimitAppender) AppendHistogram(ref storage.SeriesRef, lset labels.Labels, t int64, h *histogram.Histogram, fh *histogram.FloatHistogram) (storage.SeriesRef, error) {
|
||||||
if h != nil {
|
if h != nil {
|
||||||
|
// Return with an early error if the histogram has too many buckets and the
|
||||||
|
// schema is not exponential, in which case we can't reduce the resolution.
|
||||||
if len(h.PositiveBuckets)+len(h.NegativeBuckets) > app.limit && !histogram.IsExponentialSchema(h.Schema) {
|
if len(h.PositiveBuckets)+len(h.NegativeBuckets) > app.limit && !histogram.IsExponentialSchema(h.Schema) {
|
||||||
return 0, errBucketLimit
|
return 0, errBucketLimit
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user