From f36517310f6bd94b0d6e4f89d1eb2336f140af83 Mon Sep 17 00:00:00 2001 From: Ben Ye Date: Sun, 4 Aug 2024 13:49:06 -0700 Subject: [PATCH 1/2] OTLP handler: enable metric name normalization Signed-off-by: Ben Ye --- pkg/util/push/otlp.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/util/push/otlp.go b/pkg/util/push/otlp.go index 6a263fe5991..b3bae4dd4ef 100644 --- a/pkg/util/push/otlp.go +++ b/pkg/util/push/otlp.go @@ -38,7 +38,11 @@ func OTLPHandler(sourceIPs *middleware.SourceIPExtractor, push Func) http.Handle } promConverter := prometheusremotewrite.NewPrometheusConverter() - err = promConverter.FromMetrics(convertToMetricsAttributes(req.Metrics()), prometheusremotewrite.Settings{DisableTargetInfo: true}) + setting := prometheusremotewrite.Settings{ + AddMetricSuffixes: true, + DisableTargetInfo: true, + } + err = promConverter.FromMetrics(convertToMetricsAttributes(req.Metrics()), setting) if err != nil { level.Error(logger).Log("err", err.Error()) http.Error(w, err.Error(), http.StatusBadRequest) From f54f0a6680990976f703a87de8c4184e1b7da037 Mon Sep 17 00:00:00 2001 From: Ben Ye Date: Sun, 4 Aug 2024 13:53:42 -0700 Subject: [PATCH 2/2] changelog Signed-off-by: Ben Ye --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e22f7125fc8..edb3d0c5c3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * [CHANGE] Ingester: Remove `-querier.query-store-for-labels-enabled` flag. Querying long-term store for labels is always enabled. #5984 * [CHANGE] Server: Instrument `cortex_request_duration_seconds` metric with native histogram. If `native-histograms` feature is enabled in monitoring Prometheus then the metric name needs to be updated in your dashboards. #6056 * [CHANGE] Distributor/Ingester: Change `cortex_distributor_ingester_appends_total`, `cortex_distributor_ingester_append_failures_total`, `cortex_distributor_ingester_queries_total`, and `cortex_distributor_ingester_query_failures_total` metrics to use the ingester ID instead of its IP as the label value. #6078 +* [CHANGE] OTLP: Set `AddMetricSuffixes` to true to always enable metric name normalization. #6136 * [FEATURE] Ingester/Distributor: Experimental: Enable native histogram ingestion via `-blocks-storage.tsdb.enable-native-histograms` flag. #5986 #6010 #6020 * [FEATURE] Querier: Enable querying native histogram chunks. #5944 #6031 * [FEATURE] Query Frontend: Support native histogram in query frontend response. #5996 #6043