Skip to content

Commit b2ce96c

Browse files
authored
OTLP handler: enable metric name normalization (#6136)
1 parent f7f6ed2 commit b2ce96c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* [CHANGE] Ingester: Remove `-querier.query-store-for-labels-enabled` flag. Querying long-term store for labels is always enabled. #5984
66
* [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
77
* [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
8+
* [CHANGE] OTLP: Set `AddMetricSuffixes` to true to always enable metric name normalization. #6136
89
* [FEATURE] Ingester/Distributor: Experimental: Enable native histogram ingestion via `-blocks-storage.tsdb.enable-native-histograms` flag. #5986 #6010 #6020
910
* [FEATURE] Querier: Enable querying native histogram chunks. #5944 #6031
1011
* [FEATURE] Query Frontend: Support native histogram in query frontend response. #5996 #6043

pkg/util/push/otlp.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ func OTLPHandler(sourceIPs *middleware.SourceIPExtractor, push Func) http.Handle
3838
}
3939

4040
promConverter := prometheusremotewrite.NewPrometheusConverter()
41-
err = promConverter.FromMetrics(convertToMetricsAttributes(req.Metrics()), prometheusremotewrite.Settings{DisableTargetInfo: true})
41+
setting := prometheusremotewrite.Settings{
42+
AddMetricSuffixes: true,
43+
DisableTargetInfo: true,
44+
}
45+
err = promConverter.FromMetrics(convertToMetricsAttributes(req.Metrics()), setting)
4246
if err != nil {
4347
level.Error(logger).Log("err", err.Error())
4448
http.Error(w, err.Error(), http.StatusBadRequest)

0 commit comments

Comments
 (0)