diff --git a/cmd/mimir/config-descriptor.json b/cmd/mimir/config-descriptor.json index e360766c19c..828be1530a7 100644 --- a/cmd/mimir/config-descriptor.json +++ b/cmd/mimir/config-descriptor.json @@ -3089,7 +3089,7 @@ "kind": "field", "name": "accept_native_histograms", "required": false, - "desc": "Flag to enable the ingestion of native histogram samples.", + "desc": "Enable ingestion of native histogram samples. If false, native histogram samples are ignored without an error.", "fieldValue": null, "fieldDefaultValue": false, "fieldFlag": "ingester.accept-native-histograms", diff --git a/cmd/mimir/help-all.txt.tmpl b/cmd/mimir/help-all.txt.tmpl index 467538220ce..d2a8b0acccc 100644 --- a/cmd/mimir/help-all.txt.tmpl +++ b/cmd/mimir/help-all.txt.tmpl @@ -980,7 +980,7 @@ Usage of ./cmd/mimir/mimir: -http.prometheus-http-prefix string HTTP URL path under which the Prometheus api will be served. (default "/prometheus") -ingester.accept-native-histograms - [experimental] Flag to enable the ingestion of native histogram samples. + [experimental] Enable ingestion of native histogram samples. If false, native histogram samples are ignored without an error. -ingester.active-series-custom-trackers value Additional active series metrics, matching the provided matchers. Matchers should be in form :, like 'foobar:{foo="bar"}'. Multiple matchers can be provided either providing the flag multiple times or providing multiple semicolon-separated values to a single flag. -ingester.active-series-metrics-enabled diff --git a/docs/sources/mimir/reference-configuration-parameters/index.md b/docs/sources/mimir/reference-configuration-parameters/index.md index 829203c31a0..f039b258496 100644 --- a/docs/sources/mimir/reference-configuration-parameters/index.md +++ b/docs/sources/mimir/reference-configuration-parameters/index.md @@ -2566,7 +2566,8 @@ The `limits` block configures default and per-tenant limits imposed by component # CLI flag: -ingester.max-global-exemplars-per-user [max_global_exemplars_per_user: | default = 0] -# (experimental) Flag to enable the ingestion of native histogram samples. +# (experimental) Enable ingestion of native histogram samples. If false, native +# histogram samples are ignored without an error. # CLI flag: -ingester.accept-native-histograms [accept_native_histograms: | default = false] diff --git a/pkg/ingester/ingester.go b/pkg/ingester/ingester.go index 1c6b97d3bd5..3b7b4110d6c 100644 --- a/pkg/ingester/ingester.go +++ b/pkg/ingester/ingester.go @@ -1612,21 +1612,19 @@ func (i *Ingester) queryStreamSamples(ctx context.Context, db *userTSDB, from, t it = series.Iterator(it) for valType := it.Next(); valType != chunkenc.ValNone; valType = it.Next() { - if valType == chunkenc.ValFloat { + switch valType { + case chunkenc.ValFloat: t, v := it.At() - ts.Samples = append(ts.Samples, mimirpb.Sample{ - Value: v, - TimestampMs: t, - }) - } else if valType == chunkenc.ValHistogram { + ts.Samples = append(ts.Samples, mimirpb.Sample{Value: v, TimestampMs: t}) + case chunkenc.ValHistogram: // TODO when read path for native histograms is ready, return Histogram samples // t, v := it.AtHistogram() // ts.Histograms = append(ts.Histograms, mimirpb.FromHistogramToHistogramProto(t, v)) - } else if valType == chunkenc.ValFloatHistogram { + case chunkenc.ValFloatHistogram: // TODO when read path for native histograms is ready, return Histogram samples // t, v := it.AtFloatHistogram() // ts.Histograms = append(ts.Histograms, mimirpb.FromFloatHistogramToHistogramProto(t, v)) - } else { + default: return 0, 0, 0, fmt.Errorf("unsupported value type: %v", valType) } } diff --git a/pkg/mimirpb/mimir.proto b/pkg/mimirpb/mimir.proto index 79f0a7b762e..48fc1413dfa 100644 --- a/pkg/mimirpb/mimir.proto +++ b/pkg/mimirpb/mimir.proto @@ -5,9 +5,6 @@ // Provenance-includes-location: https://github.com/prometheus/prometheus/blob/main/prompb/types.proto // Provenance-includes-license: Apache-2.0 // Provenance-includes-copyright: Prometheus Team. -// Provenance-includes-location: https://github.com/prometheus/common/blob/main/model/value_histogram.go -// Provenance-includes-license: Apache-2.0 -// Provenance-includes-copyright: The Prometheus Authors. syntax = "proto3"; diff --git a/pkg/util/validation/limits.go b/pkg/util/validation/limits.go index 0c5edc9a77d..884d9c7c46d 100644 --- a/pkg/util/validation/limits.go +++ b/pkg/util/validation/limits.go @@ -209,7 +209,7 @@ func (l *Limits) RegisterFlags(f *flag.FlagSet) { f.IntVar(&l.MaxGlobalExemplarsPerUser, "ingester.max-global-exemplars-per-user", 0, "The maximum number of exemplars in memory, across the cluster. 0 to disable exemplars ingestion.") f.Var(&l.ActiveSeriesCustomTrackersConfig, "ingester.active-series-custom-trackers", "Additional active series metrics, matching the provided matchers. Matchers should be in form :, like 'foobar:{foo=\"bar\"}'. Multiple matchers can be provided either providing the flag multiple times or providing multiple semicolon-separated values to a single flag.") f.Var(&l.OutOfOrderTimeWindow, "ingester.out-of-order-time-window", "Non-zero value enables out-of-order support for most recent samples that are within the time window in relation to the TSDB's maximum time, i.e., within [db.maxTime-timeWindow, db.maxTime]). The ingester will need more memory as a factor of rate of out-of-order samples being ingested and the number of series that are getting out-of-order samples. A lower TTL of 10 minutes will be set for the query cache entries that overlap with this window.") - f.BoolVar(&l.AcceptNativeHistograms, "ingester.accept-native-histograms", false, "Flag to enable the ingestion of native histogram samples.") + f.BoolVar(&l.AcceptNativeHistograms, "ingester.accept-native-histograms", false, "Enable ingestion of native histogram samples. If false, native histogram samples are ignored without an error.") f.StringVar(&l.SeparateMetricsGroupLabel, "validation.separate-metrics-group-label", "", "Label used to define the group label for metrics separation. For each write request, the group is obtained from the first non-empty group label from the first timeseries in the incoming list of timeseries. Specific distributor and ingester metrics will be further separated adding a 'group' label with group label's value. Currently applies to the following metrics: cortex_discarded_samples_total")