Make translatorMetricFromOtelMetric public (#16683)

Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
This commit is contained in:
zenador 2025-06-03 18:39:21 +08:00 committed by GitHub
parent 8fd46f74aa
commit 40a27ce875
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 5 deletions

View File

@ -771,7 +771,7 @@ func TestPrometheusConverter_addExponentialHistogramDataPoints(t *testing.T) {
Settings{
ExportCreatedMetric: true,
},
namer.Build(translatorMetricFromOtelMetric(metric)),
namer.Build(TranslatorMetricFromOtelMetric(metric)),
pmetric.AggregationTemporalityCumulative,
)
require.NoError(t, err)
@ -1143,7 +1143,7 @@ func TestPrometheusConverter_addCustomBucketsHistogramDataPoints(t *testing.T) {
ExportCreatedMetric: true,
ConvertHistogramsToNHCB: true,
},
namer.Build(translatorMetricFromOtelMetric(metric)),
namer.Build(TranslatorMetricFromOtelMetric(metric)),
pmetric.AggregationTemporalityCumulative,
)

View File

@ -65,7 +65,7 @@ func NewPrometheusConverter() *PrometheusConverter {
}
}
func translatorMetricFromOtelMetric(metric pmetric.Metric) otlptranslator.Metric {
func TranslatorMetricFromOtelMetric(metric pmetric.Metric) otlptranslator.Metric {
m := otlptranslator.Metric{
Name: metric.Name(),
Unit: metric.Unit(),
@ -144,7 +144,7 @@ func (c *PrometheusConverter) FromMetrics(ctx context.Context, md pmetric.Metric
continue
}
promName := namer.Build(translatorMetricFromOtelMetric(metric))
promName := namer.Build(TranslatorMetricFromOtelMetric(metric))
c.metadata = append(c.metadata, prompb.MetricMetadata{
Type: otelMetricTypeToPromMetricType(metric),
MetricFamilyName: promName,

View File

@ -49,7 +49,7 @@ func TestFromMetrics(t *testing.T) {
for k := 0; k < metricSlice.Len(); k++ {
metric := metricSlice.At(k)
namer := otlptranslator.MetricNamer{}
promName := namer.Build(translatorMetricFromOtelMetric(metric))
promName := namer.Build(TranslatorMetricFromOtelMetric(metric))
expMetadata = append(expMetadata, prompb.MetricMetadata{
Type: otelMetricTypeToPromMetricType(metric),
MetricFamilyName: promName,