mirror of
https://github.com/prometheus/prometheus.git
synced 2025-07-03 11:03:25 +00:00
Make translatorMetricFromOtelMetric public (#16683)
Some checks are pending
buf.build / lint and publish (push) Waiting to run
CI / Go tests (push) Waiting to run
CI / More Go tests (push) Waiting to run
CI / Go tests with previous Go version (push) Waiting to run
CI / UI tests (push) Waiting to run
CI / Go tests on Windows (push) Waiting to run
CI / Mixins tests (push) Waiting to run
CI / Build Prometheus for common architectures (push) Waiting to run
CI / Build Prometheus for all architectures (push) Waiting to run
CI / Report status of build Prometheus for all architectures (push) Blocked by required conditions
CI / Check generated parser (push) Waiting to run
CI / golangci-lint (push) Waiting to run
CI / fuzzing (push) Waiting to run
CI / codeql (push) Waiting to run
CI / Publish main branch artifacts (push) Blocked by required conditions
CI / Publish release artefacts (push) Blocked by required conditions
CI / Publish UI on npm Registry (push) Blocked by required conditions
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
Some checks are pending
buf.build / lint and publish (push) Waiting to run
CI / Go tests (push) Waiting to run
CI / More Go tests (push) Waiting to run
CI / Go tests with previous Go version (push) Waiting to run
CI / UI tests (push) Waiting to run
CI / Go tests on Windows (push) Waiting to run
CI / Mixins tests (push) Waiting to run
CI / Build Prometheus for common architectures (push) Waiting to run
CI / Build Prometheus for all architectures (push) Waiting to run
CI / Report status of build Prometheus for all architectures (push) Blocked by required conditions
CI / Check generated parser (push) Waiting to run
CI / golangci-lint (push) Waiting to run
CI / fuzzing (push) Waiting to run
CI / codeql (push) Waiting to run
CI / Publish main branch artifacts (push) Blocked by required conditions
CI / Publish release artefacts (push) Blocked by required conditions
CI / Publish UI on npm Registry (push) Blocked by required conditions
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
This commit is contained in:
parent
8fd46f74aa
commit
40a27ce875
3 changed files with 5 additions and 5 deletions
|
@ -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,
|
||||
)
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue