Skip to content

Commit 82e2b6a

Browse files
committed
make use of annotations
1 parent 87174d8 commit 82e2b6a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/distributor/otel.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ func otelMetricsToTimeseries(ctx context.Context, tenantID string, addSuffixes,
432432
// Old, less efficient, version of otelMetricsToTimeseries.
433433
func otelMetricsToTimeseriesOld(ctx context.Context, tenantID string, addSuffixes, enableCTZeroIngestion bool, discardedDueToOtelParseError *prometheus.CounterVec, logger log.Logger, md pmetric.Metrics) ([]mimirpb.PreallocTimeseries, error) {
434434
converter := prometheusremotewrite.NewPrometheusConverter()
435-
errs := converter.FromMetrics(ctx, md, prometheusremotewrite.Settings{
435+
annots, errs := converter.FromMetrics(ctx, md, prometheusremotewrite.Settings{
436436
AddMetricSuffixes: addSuffixes,
437437
EnableCreatedTimestampZeroIngestion: enableCTZeroIngestion,
438438
})
@@ -452,6 +452,10 @@ func otelMetricsToTimeseriesOld(ctx context.Context, tenantID string, addSuffixe
452452

453453
level.Warn(logger).Log("msg", "OTLP parse error", "err", parseErrs)
454454
}
455+
ws, _ := annots.AsStrings("", 0, 0)
456+
if len(ws) > 0 {
457+
level.Warn(logger).Log("msg", "Warnings translating OTLP metrics to Prometheus write request", "warnings", ws)
458+
}
455459

456460
mimirTS := mimirpb.PreallocTimeseriesSliceFromPool()
457461
for _, ts := range promTS {

0 commit comments

Comments
 (0)