From 424c2346126687e10a0c88d14b489b23476fd52f Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Mon, 14 Aug 2023 07:48:48 -0700 Subject: [PATCH] Fix merge --- .../otlpmetricgrpc/internal/oconf/envconfig.go | 5 ++--- .../otlpmetricgrpc/internal/oconf/envconfig_test.go | 9 ++++----- .../otlpmetrichttp/internal/oconf/envconfig.go | 5 ++--- .../otlpmetrichttp/internal/oconf/envconfig_test.go | 9 ++++----- internal/shared/otlp/otlpmetric/oconf/envconfig.go.tmpl | 5 ++--- .../shared/otlp/otlpmetric/oconf/envconfig_test.go.tmpl | 9 ++++----- 6 files changed, 18 insertions(+), 24 deletions(-) diff --git a/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/oconf/envconfig.go b/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/oconf/envconfig.go index c08b0b6d483..ae100513bad 100644 --- a/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/oconf/envconfig.go +++ b/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/oconf/envconfig.go @@ -29,7 +29,6 @@ import ( "go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/envconfig" "go.opentelemetry.io/otel/internal/global" "go.opentelemetry.io/otel/sdk/metric" - "go.opentelemetry.io/otel/sdk/metric/aggregation" "go.opentelemetry.io/otel/sdk/metric/metricdata" ) @@ -204,9 +203,9 @@ func withEnvAggPreference(n string, fn func(metric.AggregationSelector)) func(e case "explicit_bucket_histogram": fn(metric.DefaultAggregationSelector) case "base2_exponential_bucket_histogram": - fn(func(kind metric.InstrumentKind) aggregation.Aggregation { + fn(func(kind metric.InstrumentKind) metric.Aggregation { if kind == metric.InstrumentKindHistogram { - return aggregation.Base2ExponentialHistogram{ + return metric.AggregationBase2ExponentialHistogram{ MaxSize: 160, MaxScale: 20, NoMinMax: false, diff --git a/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/oconf/envconfig_test.go b/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/oconf/envconfig_test.go index 559d9f3bc23..b3f9f9c3714 100644 --- a/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/oconf/envconfig_test.go +++ b/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/oconf/envconfig_test.go @@ -24,7 +24,6 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/otel/sdk/metric" - "go.opentelemetry.io/otel/sdk/metric/aggregation" "go.opentelemetry.io/otel/sdk/metric/metricdata" ) @@ -111,7 +110,7 @@ func TestWithEnvAggPreference(t *testing.T) { tests := []struct { name string envValue string - want map[metric.InstrumentKind]aggregation.Aggregation + want map[metric.InstrumentKind]metric.Aggregation }{ { name: "default do not set the selector", @@ -124,7 +123,7 @@ func TestWithEnvAggPreference(t *testing.T) { { name: "explicit_bucket_histogram", envValue: "explicit_bucket_histogram", - want: map[metric.InstrumentKind]aggregation.Aggregation{ + want: map[metric.InstrumentKind]metric.Aggregation{ metric.InstrumentKindCounter: metric.DefaultAggregationSelector(metric.InstrumentKindCounter), metric.InstrumentKindHistogram: metric.DefaultAggregationSelector(metric.InstrumentKindHistogram), metric.InstrumentKindUpDownCounter: metric.DefaultAggregationSelector(metric.InstrumentKindUpDownCounter), @@ -136,9 +135,9 @@ func TestWithEnvAggPreference(t *testing.T) { { name: "base2_exponential_bucket_histogram", envValue: "base2_exponential_bucket_histogram", - want: map[metric.InstrumentKind]aggregation.Aggregation{ + want: map[metric.InstrumentKind]metric.Aggregation{ metric.InstrumentKindCounter: metric.DefaultAggregationSelector(metric.InstrumentKindCounter), - metric.InstrumentKindHistogram: aggregation.Base2ExponentialHistogram{ + metric.InstrumentKindHistogram: metric.AggregationBase2ExponentialHistogram{ MaxSize: 160, MaxScale: 20, NoMinMax: false, diff --git a/exporters/otlp/otlpmetric/otlpmetrichttp/internal/oconf/envconfig.go b/exporters/otlp/otlpmetric/otlpmetrichttp/internal/oconf/envconfig.go index 67f3b32f618..2bab35be6c4 100644 --- a/exporters/otlp/otlpmetric/otlpmetrichttp/internal/oconf/envconfig.go +++ b/exporters/otlp/otlpmetric/otlpmetrichttp/internal/oconf/envconfig.go @@ -29,7 +29,6 @@ import ( "go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp/internal/envconfig" "go.opentelemetry.io/otel/internal/global" "go.opentelemetry.io/otel/sdk/metric" - "go.opentelemetry.io/otel/sdk/metric/aggregation" "go.opentelemetry.io/otel/sdk/metric/metricdata" ) @@ -204,9 +203,9 @@ func withEnvAggPreference(n string, fn func(metric.AggregationSelector)) func(e case "explicit_bucket_histogram": fn(metric.DefaultAggregationSelector) case "base2_exponential_bucket_histogram": - fn(func(kind metric.InstrumentKind) aggregation.Aggregation { + fn(func(kind metric.InstrumentKind) metric.Aggregation { if kind == metric.InstrumentKindHistogram { - return aggregation.Base2ExponentialHistogram{ + return metric.AggregationBase2ExponentialHistogram{ MaxSize: 160, MaxScale: 20, NoMinMax: false, diff --git a/exporters/otlp/otlpmetric/otlpmetrichttp/internal/oconf/envconfig_test.go b/exporters/otlp/otlpmetric/otlpmetrichttp/internal/oconf/envconfig_test.go index 559d9f3bc23..b3f9f9c3714 100644 --- a/exporters/otlp/otlpmetric/otlpmetrichttp/internal/oconf/envconfig_test.go +++ b/exporters/otlp/otlpmetric/otlpmetrichttp/internal/oconf/envconfig_test.go @@ -24,7 +24,6 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/otel/sdk/metric" - "go.opentelemetry.io/otel/sdk/metric/aggregation" "go.opentelemetry.io/otel/sdk/metric/metricdata" ) @@ -111,7 +110,7 @@ func TestWithEnvAggPreference(t *testing.T) { tests := []struct { name string envValue string - want map[metric.InstrumentKind]aggregation.Aggregation + want map[metric.InstrumentKind]metric.Aggregation }{ { name: "default do not set the selector", @@ -124,7 +123,7 @@ func TestWithEnvAggPreference(t *testing.T) { { name: "explicit_bucket_histogram", envValue: "explicit_bucket_histogram", - want: map[metric.InstrumentKind]aggregation.Aggregation{ + want: map[metric.InstrumentKind]metric.Aggregation{ metric.InstrumentKindCounter: metric.DefaultAggregationSelector(metric.InstrumentKindCounter), metric.InstrumentKindHistogram: metric.DefaultAggregationSelector(metric.InstrumentKindHistogram), metric.InstrumentKindUpDownCounter: metric.DefaultAggregationSelector(metric.InstrumentKindUpDownCounter), @@ -136,9 +135,9 @@ func TestWithEnvAggPreference(t *testing.T) { { name: "base2_exponential_bucket_histogram", envValue: "base2_exponential_bucket_histogram", - want: map[metric.InstrumentKind]aggregation.Aggregation{ + want: map[metric.InstrumentKind]metric.Aggregation{ metric.InstrumentKindCounter: metric.DefaultAggregationSelector(metric.InstrumentKindCounter), - metric.InstrumentKindHistogram: aggregation.Base2ExponentialHistogram{ + metric.InstrumentKindHistogram: metric.AggregationBase2ExponentialHistogram{ MaxSize: 160, MaxScale: 20, NoMinMax: false, diff --git a/internal/shared/otlp/otlpmetric/oconf/envconfig.go.tmpl b/internal/shared/otlp/otlpmetric/oconf/envconfig.go.tmpl index e1dc855b631..a76a4835ddb 100644 --- a/internal/shared/otlp/otlpmetric/oconf/envconfig.go.tmpl +++ b/internal/shared/otlp/otlpmetric/oconf/envconfig.go.tmpl @@ -29,7 +29,6 @@ import ( "{{ .envconfigImportPath }}" "go.opentelemetry.io/otel/internal/global" "go.opentelemetry.io/otel/sdk/metric" - "go.opentelemetry.io/otel/sdk/metric/aggregation" "go.opentelemetry.io/otel/sdk/metric/metricdata" ) @@ -204,9 +203,9 @@ func withEnvAggPreference(n string, fn func(metric.AggregationSelector)) func(e case "explicit_bucket_histogram": fn(metric.DefaultAggregationSelector) case "base2_exponential_bucket_histogram": - fn(func(kind metric.InstrumentKind) aggregation.Aggregation { + fn(func(kind metric.InstrumentKind) metric.Aggregation { if kind == metric.InstrumentKindHistogram { - return aggregation.Base2ExponentialHistogram{ + return metric.AggregationBase2ExponentialHistogram{ MaxSize: 160, MaxScale: 20, NoMinMax: false, diff --git a/internal/shared/otlp/otlpmetric/oconf/envconfig_test.go.tmpl b/internal/shared/otlp/otlpmetric/oconf/envconfig_test.go.tmpl index 559d9f3bc23..b3f9f9c3714 100644 --- a/internal/shared/otlp/otlpmetric/oconf/envconfig_test.go.tmpl +++ b/internal/shared/otlp/otlpmetric/oconf/envconfig_test.go.tmpl @@ -24,7 +24,6 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/otel/sdk/metric" - "go.opentelemetry.io/otel/sdk/metric/aggregation" "go.opentelemetry.io/otel/sdk/metric/metricdata" ) @@ -111,7 +110,7 @@ func TestWithEnvAggPreference(t *testing.T) { tests := []struct { name string envValue string - want map[metric.InstrumentKind]aggregation.Aggregation + want map[metric.InstrumentKind]metric.Aggregation }{ { name: "default do not set the selector", @@ -124,7 +123,7 @@ func TestWithEnvAggPreference(t *testing.T) { { name: "explicit_bucket_histogram", envValue: "explicit_bucket_histogram", - want: map[metric.InstrumentKind]aggregation.Aggregation{ + want: map[metric.InstrumentKind]metric.Aggregation{ metric.InstrumentKindCounter: metric.DefaultAggregationSelector(metric.InstrumentKindCounter), metric.InstrumentKindHistogram: metric.DefaultAggregationSelector(metric.InstrumentKindHistogram), metric.InstrumentKindUpDownCounter: metric.DefaultAggregationSelector(metric.InstrumentKindUpDownCounter), @@ -136,9 +135,9 @@ func TestWithEnvAggPreference(t *testing.T) { { name: "base2_exponential_bucket_histogram", envValue: "base2_exponential_bucket_histogram", - want: map[metric.InstrumentKind]aggregation.Aggregation{ + want: map[metric.InstrumentKind]metric.Aggregation{ metric.InstrumentKindCounter: metric.DefaultAggregationSelector(metric.InstrumentKindCounter), - metric.InstrumentKindHistogram: aggregation.Base2ExponentialHistogram{ + metric.InstrumentKindHistogram: metric.AggregationBase2ExponentialHistogram{ MaxSize: 160, MaxScale: 20, NoMinMax: false,