diff --git a/model/histogram/generic.go b/model/histogram/generic.go index b5aa19f9cb..cc1fbce685 100644 --- a/model/histogram/generic.go +++ b/model/histogram/generic.go @@ -39,7 +39,7 @@ var ( ErrHistogramCustomBucketsInfinite = errors.New("histogram custom bounds must be finite") ErrHistogramsIncompatibleSchema = errors.New("cannot apply this operation on histograms with a mix of exponential and custom bucket schemas") ErrHistogramsIncompatibleBounds = errors.New("cannot apply this operation on custom buckets histograms with different custom bounds") - ErrHistogramsInvalidSchema = errors.New("histogram has an invalid schema, which must be between -4 and 8 for exponential buckets, or -53 for custom buckets") + ErrHistogramsInvalidSchema = fmt.Errorf("histogram has an invalid schema, which must be between %d and %d for exponential buckets, or %d for custom buckets", ExponentialSchemaMin, ExponentialSchemaMax, CustomBucketsSchema) ) func IsCustomBucketsSchema(s int32) bool { diff --git a/storage/remote/codec.go b/storage/remote/codec.go index 2042e12199..87b7ff2290 100644 --- a/storage/remote/codec.go +++ b/storage/remote/codec.go @@ -475,7 +475,7 @@ func validateHistogramSchema(h *prompb.Histogram) error { if histogram.IsValidSchema(h.Schema) { return nil } - return fmt.Errorf("invalid histogram schema %d", h.Schema) + return return fmt.Errorf("%w, got schema %d", h.Schema, histogram.ErrHistogramsInvalidSchema) } func getHistogramValType(h *prompb.Histogram) chunkenc.ValueType {