From 4496b8b2537aa799e3a6435d278070b4003206e3 Mon Sep 17 00:00:00 2001 From: Jared Tan Date: Tue, 19 Sep 2023 21:38:39 +0800 Subject: [PATCH] [exporter/loadbalancer] unexport `MetricsViews` function (#26992) **Link to tracking Issue:** https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/26304 Signed-off-by: Jared Tan --- cmd/checkapi/allowlist.txt | 1 - exporter/loadbalancingexporter/factory.go | 2 +- exporter/loadbalancingexporter/metrics.go | 4 ++-- exporter/loadbalancingexporter/metrics_test.go | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cmd/checkapi/allowlist.txt b/cmd/checkapi/allowlist.txt index 26e8655942696..3f58158f1143c 100644 --- a/cmd/checkapi/allowlist.txt +++ b/cmd/checkapi/allowlist.txt @@ -6,7 +6,6 @@ exporter/dynatraceexporter exporter/f5cloudexporter exporter/kafkaexporter exporter/kineticaexporter -exporter/loadbalancingexporter exporter/logzioexporter exporter/lokiexporter exporter/pulsarexporter diff --git a/exporter/loadbalancingexporter/factory.go b/exporter/loadbalancingexporter/factory.go index 52501eacd771b..79d9681433464 100644 --- a/exporter/loadbalancingexporter/factory.go +++ b/exporter/loadbalancingexporter/factory.go @@ -18,7 +18,7 @@ import ( // NewFactory creates a factory for the exporter. func NewFactory() exporter.Factory { - _ = view.Register(MetricViews()...) + _ = view.Register(metricViews()...) return exporter.NewFactory( metadata.Type, diff --git a/exporter/loadbalancingexporter/metrics.go b/exporter/loadbalancingexporter/metrics.go index 66a3d900b7f70..0bbdb4528d13e 100644 --- a/exporter/loadbalancingexporter/metrics.go +++ b/exporter/loadbalancingexporter/metrics.go @@ -19,8 +19,8 @@ var ( successFalseMutator = tag.Upsert(tag.MustNewKey("success"), "false") ) -// MetricViews return the metrics views according to given telemetry level. -func MetricViews() []*view.View { +// metricViews return the metrics views according to given telemetry level. +func metricViews() []*view.View { return []*view.View{ { Name: mNumResolutions.Name(), diff --git a/exporter/loadbalancingexporter/metrics_test.go b/exporter/loadbalancingexporter/metrics_test.go index 87759d6de1118..2db6ea4183fa9 100644 --- a/exporter/loadbalancingexporter/metrics_test.go +++ b/exporter/loadbalancingexporter/metrics_test.go @@ -17,7 +17,7 @@ func TestProcessorMetrics(t *testing.T) { "loadbalancer_backend_latency", } - views := MetricViews() + views := metricViews() for i, viewName := range expectedViewNames { assert.Equal(t, viewName, views[i].Name) }