From 9b2404bb515a16db9c435f8fc9e1177246498f8d Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Fri, 12 Nov 2021 15:31:28 -0800 Subject: [PATCH] Remove sdk/export/metric module, embed into the sdk/metric Signed-off-by: Bogdan Drutu --- CHANGELOG.md | 7 +- bridge/opencensus/aggregation.go | 2 +- bridge/opencensus/aggregation_test.go | 2 +- bridge/opencensus/exporter.go | 4 +- bridge/opencensus/exporter_test.go | 9 +-- bridge/opencensus/go.mod | 3 - bridge/opencensus/test/go.mod | 2 - bridge/opentracing/go.mod | 2 - example/fib/go.mod | 2 - example/jaeger/go.mod | 2 - example/namedtracer/go.mod | 2 - example/opencensus/go.mod | 4 +- example/opencensus/main.go | 4 +- example/otel-collector/go.mod | 2 - example/passthrough/go.mod | 2 - example/prometheus/go.mod | 3 - example/prometheus/main.go | 2 +- example/zipkin/go.mod | 2 - exporters/jaeger/go.mod | 2 - exporters/otlp/otlpmetric/exporter.go | 8 +- exporters/otlp/otlpmetric/exporter_test.go | 18 ++--- exporters/otlp/otlpmetric/go.mod | 3 - .../internal/metrictransform/metric.go | 4 +- .../internal/metrictransform/metric_test.go | 4 +- .../internal/otlpmetrictest/data.go | 16 ++-- .../internal/otlpmetrictest/otlptest.go | 2 +- exporters/otlp/otlpmetric/options.go | 2 +- .../otlp/otlpmetric/otlpmetricgrpc/go.mod | 2 - .../otlp/otlpmetric/otlpmetrichttp/go.mod | 2 - exporters/otlp/otlptrace/go.mod | 2 - exporters/otlp/otlptrace/otlptracegrpc/go.mod | 2 - exporters/otlp/otlptrace/otlptracehttp/go.mod | 2 - exporters/prometheus/go.mod | 3 - exporters/prometheus/prometheus.go | 4 +- exporters/prometheus/prometheus_test.go | 2 +- exporters/stdout/stdoutmetric/exporter.go | 6 +- exporters/stdout/stdoutmetric/go.mod | 3 - exporters/stdout/stdoutmetric/metric.go | 12 +-- exporters/stdout/stdoutmetric/metric_test.go | 2 +- exporters/stdout/stdouttrace/go.mod | 2 - exporters/zipkin/go.mod | 2 - go.mod | 2 - internal/metric/go.mod | 2 - internal/tools/go.mod | 2 - metric/go.mod | 2 - schema/go.mod | 2 - sdk/export/metric/go.mod | 74 ------------------- sdk/export/metric/go.sum | 17 ----- sdk/go.mod | 2 - sdk/metric/aggregator/aggregator.go | 4 +- sdk/metric/aggregator/aggregator_test.go | 2 +- sdk/metric/aggregator/aggregatortest/test.go | 4 +- sdk/metric/aggregator/histogram/histogram.go | 4 +- .../aggregator/histogram/histogram_test.go | 2 +- sdk/metric/aggregator/lastvalue/lastvalue.go | 4 +- .../aggregator/lastvalue/lastvalue_test.go | 4 +- sdk/metric/aggregator/minmaxsumcount/mmsc.go | 4 +- .../aggregator/minmaxsumcount/mmsc_test.go | 4 +- sdk/metric/aggregator/sum/sum.go | 4 +- sdk/metric/aggregator/sum/sum_test.go | 2 +- sdk/metric/benchmark_test.go | 2 +- sdk/metric/controller/basic/config.go | 2 +- sdk/metric/controller/basic/controller.go | 2 +- .../controller/basic/controller_test.go | 4 +- sdk/metric/controller/basic/pull_test.go | 2 +- sdk/metric/controller/basic/push_test.go | 4 +- sdk/metric/controller/controllertest/test.go | 4 +- sdk/metric/correct_test.go | 4 +- sdk/metric/doc.go | 2 +- .../export}/aggregation/aggregation.go | 2 +- .../export}/aggregation/temporality.go | 2 +- .../export}/aggregation/temporality_string.go | 0 .../export}/aggregation/temporality_test.go | 0 .../metric => metric/export}/metric.go | 4 +- .../metric => metric/export}/metric_test.go | 2 +- sdk/metric/go.mod | 3 - sdk/metric/processor/basic/basic.go | 4 +- sdk/metric/processor/basic/basic_test.go | 4 +- sdk/metric/processor/processortest/test.go | 4 +- .../processor/processortest/test_test.go | 4 +- sdk/metric/processor/reducer/reducer.go | 2 +- sdk/metric/processor/reducer/reducer_test.go | 2 +- sdk/metric/sdk.go | 2 +- sdk/metric/selector/simple/simple.go | 2 +- sdk/metric/selector/simple/simple_test.go | 2 +- sdk/metric/stress_test.go | 4 +- trace/go.mod | 2 - 87 files changed, 109 insertions(+), 264 deletions(-) delete mode 100644 sdk/export/metric/go.mod delete mode 100644 sdk/export/metric/go.sum rename sdk/{export/metric => metric/export}/aggregation/aggregation.go (97%) rename sdk/{export/metric => metric/export}/aggregation/temporality.go (97%) rename sdk/{export/metric => metric/export}/aggregation/temporality_string.go (100%) rename sdk/{export/metric => metric/export}/aggregation/temporality_test.go (100%) rename sdk/{export/metric => metric/export}/metric.go (99%) rename sdk/{export/metric => metric/export}/metric_test.go (99%) diff --git a/CHANGELOG.md b/CHANGELOG.md index edbbca911468..ad0025f46f1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,9 +8,14 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ## [Unreleased] +### Changed + +- Move export module `"go.opentelemetry.io/otel/sdk/export/metric"` into the "go.opentelemetry.io/otel/sdk/metric" module: + - Import path changed `import "go.opentelemetry.io/otel/sdk/export/metric"` to `import go.opentelemetry.io/otel/sdk/metric/export` (#2382). + ## [1.2.0] - 2021-11-12 -## Changed +### Changed - Metric SDK `export.ExportKind`, `export.ExportKindSelector` types have been renamed to `aggregation.Temporality` and `aggregation.TemporalitySelector` respectively to keep in line with current specification and protocol along with built-in selectors (e.g., `aggregation.CumulativeTemporalitySelector`, ...). (#2274) - The Metric `Exporter` interface now requires a `TemporalitySelector` method instead of an `ExportKindSelector`. (#2274) diff --git a/bridge/opencensus/aggregation.go b/bridge/opencensus/aggregation.go index 10616b993aa8..3d88f7589a4d 100644 --- a/bridge/opencensus/aggregation.go +++ b/bridge/opencensus/aggregation.go @@ -22,7 +22,7 @@ import ( "go.opencensus.io/metric/metricdata" "go.opentelemetry.io/otel/metric/number" - "go.opentelemetry.io/otel/sdk/export/metric/aggregation" + "go.opentelemetry.io/otel/sdk/metric/export/aggregation" ) var ( diff --git a/bridge/opencensus/aggregation_test.go b/bridge/opencensus/aggregation_test.go index dbd9d69b8276..13093c673367 100644 --- a/bridge/opencensus/aggregation_test.go +++ b/bridge/opencensus/aggregation_test.go @@ -21,7 +21,7 @@ import ( "go.opencensus.io/metric/metricdata" - "go.opentelemetry.io/otel/sdk/export/metric/aggregation" + "go.opentelemetry.io/otel/sdk/metric/export/aggregation" ) func TestNewAggregationFromPoints(t *testing.T) { diff --git a/bridge/opencensus/exporter.go b/bridge/opencensus/exporter.go index 1720c67f21f3..bdc22eced731 100644 --- a/bridge/opencensus/exporter.go +++ b/bridge/opencensus/exporter.go @@ -31,9 +31,9 @@ import ( "go.opentelemetry.io/otel/metric/number" "go.opentelemetry.io/otel/metric/sdkapi" "go.opentelemetry.io/otel/metric/unit" - export "go.opentelemetry.io/otel/sdk/export/metric" - "go.opentelemetry.io/otel/sdk/export/metric/aggregation" "go.opentelemetry.io/otel/sdk/instrumentation" + "go.opentelemetry.io/otel/sdk/metric/export" + "go.opentelemetry.io/otel/sdk/metric/export/aggregation" "go.opentelemetry.io/otel/sdk/resource" ) diff --git a/bridge/opencensus/exporter_test.go b/bridge/opencensus/exporter_test.go index 0910cb5720bc..8fe6893477e0 100644 --- a/bridge/opencensus/exporter_test.go +++ b/bridge/opencensus/exporter_test.go @@ -31,11 +31,10 @@ import ( "go.opentelemetry.io/otel/metric/number" "go.opentelemetry.io/otel/metric/sdkapi" "go.opentelemetry.io/otel/metric/unit" - export "go.opentelemetry.io/otel/sdk/export/metric" - exportmetric "go.opentelemetry.io/otel/sdk/export/metric" - "go.opentelemetry.io/otel/sdk/export/metric/aggregation" "go.opentelemetry.io/otel/sdk/instrumentation" "go.opentelemetry.io/otel/sdk/metric/controller/controllertest" + "go.opentelemetry.io/otel/sdk/metric/export" + "go.opentelemetry.io/otel/sdk/metric/export/aggregation" "go.opentelemetry.io/otel/sdk/resource" ) @@ -46,9 +45,9 @@ type fakeExporter struct { err error } -func (f *fakeExporter) Export(ctx context.Context, res *resource.Resource, ilr exportmetric.InstrumentationLibraryReader) error { +func (f *fakeExporter) Export(ctx context.Context, res *resource.Resource, ilr export.InstrumentationLibraryReader) error { return controllertest.ReadAll(ilr, aggregation.StatelessTemporalitySelector(), - func(_ instrumentation.Library, record exportmetric.Record) error { + func(_ instrumentation.Library, record export.Record) error { f.resource = res f.records = append(f.records, record) return f.err diff --git a/bridge/opencensus/go.mod b/bridge/opencensus/go.mod index 131310b3f740..aadbdf975e64 100644 --- a/bridge/opencensus/go.mod +++ b/bridge/opencensus/go.mod @@ -7,7 +7,6 @@ require ( go.opentelemetry.io/otel v1.2.0 go.opentelemetry.io/otel/metric v0.25.0 go.opentelemetry.io/otel/sdk v1.2.0 - go.opentelemetry.io/otel/sdk/export/metric v0.25.0 go.opentelemetry.io/otel/sdk/metric v0.25.0 go.opentelemetry.io/otel/trace v1.2.0 ) @@ -44,8 +43,6 @@ replace go.opentelemetry.io/otel/sdk => ../../sdk replace go.opentelemetry.io/otel/metric => ../../metric -replace go.opentelemetry.io/otel/sdk/export/metric => ../../sdk/export/metric - replace go.opentelemetry.io/otel/sdk/metric => ../../sdk/metric replace go.opentelemetry.io/otel/trace => ../../trace diff --git a/bridge/opencensus/test/go.mod b/bridge/opencensus/test/go.mod index 42940a1900ae..e7d68399ec18 100644 --- a/bridge/opencensus/test/go.mod +++ b/bridge/opencensus/test/go.mod @@ -62,8 +62,6 @@ replace go.opentelemetry.io/otel/metric => ../../../metric replace go.opentelemetry.io/otel/sdk => ../../../sdk -replace go.opentelemetry.io/otel/sdk/export/metric => ../../../sdk/export/metric - replace go.opentelemetry.io/otel/sdk/metric => ../../../sdk/metric replace go.opentelemetry.io/otel/trace => ../../../trace diff --git a/bridge/opentracing/go.mod b/bridge/opentracing/go.mod index d0a4ac5e73f2..59c2fcd3ce5d 100644 --- a/bridge/opentracing/go.mod +++ b/bridge/opentracing/go.mod @@ -40,8 +40,6 @@ replace go.opentelemetry.io/otel/sdk => ../../sdk replace go.opentelemetry.io/otel/metric => ../../metric -replace go.opentelemetry.io/otel/sdk/export/metric => ../../sdk/export/metric - replace go.opentelemetry.io/otel/sdk/metric => ../../sdk/metric replace go.opentelemetry.io/otel/trace => ../../trace diff --git a/example/fib/go.mod b/example/fib/go.mod index 9c5f42246457..28cac6cc1741 100644 --- a/example/fib/go.mod +++ b/example/fib/go.mod @@ -61,8 +61,6 @@ replace go.opentelemetry.io/otel/metric => ../../metric replace go.opentelemetry.io/otel/sdk => ../../sdk -replace go.opentelemetry.io/otel/sdk/export/metric => ../../sdk/export/metric - replace go.opentelemetry.io/otel/sdk/metric => ../../sdk/metric replace go.opentelemetry.io/otel/trace => ../../trace diff --git a/example/jaeger/go.mod b/example/jaeger/go.mod index d3bfefdb5119..fdf91bd662a0 100644 --- a/example/jaeger/go.mod +++ b/example/jaeger/go.mod @@ -40,8 +40,6 @@ replace go.opentelemetry.io/otel/internal/tools => ../../internal/tools replace go.opentelemetry.io/otel/metric => ../../metric -replace go.opentelemetry.io/otel/sdk/export/metric => ../../sdk/export/metric - replace go.opentelemetry.io/otel/sdk/metric => ../../sdk/metric replace go.opentelemetry.io/otel/trace => ../../trace diff --git a/example/namedtracer/go.mod b/example/namedtracer/go.mod index 17ca9a2ed2b2..bfc060a5953f 100644 --- a/example/namedtracer/go.mod +++ b/example/namedtracer/go.mod @@ -42,8 +42,6 @@ replace go.opentelemetry.io/otel/internal/tools => ../../internal/tools replace go.opentelemetry.io/otel/metric => ../../metric -replace go.opentelemetry.io/otel/sdk/export/metric => ../../sdk/export/metric - replace go.opentelemetry.io/otel/sdk/metric => ../../sdk/metric replace go.opentelemetry.io/otel/trace => ../../trace diff --git a/example/opencensus/go.mod b/example/opencensus/go.mod index fc03db32dfc8..00fa1431a2f8 100644 --- a/example/opencensus/go.mod +++ b/example/opencensus/go.mod @@ -15,7 +15,7 @@ require ( go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.25.0 go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.2.0 go.opentelemetry.io/otel/sdk v1.2.0 - go.opentelemetry.io/otel/sdk/export/metric v0.25.0 + go.opentelemetry.io/otel/sdk/metric v0.25.0 ) replace go.opentelemetry.io/otel/bridge/opentracing => ../../bridge/opentracing @@ -44,8 +44,6 @@ replace go.opentelemetry.io/otel/internal/tools => ../../internal/tools replace go.opentelemetry.io/otel/metric => ../../metric -replace go.opentelemetry.io/otel/sdk/export/metric => ../../sdk/export/metric - replace go.opentelemetry.io/otel/sdk/metric => ../../sdk/metric replace go.opentelemetry.io/otel/trace => ../../trace diff --git a/example/opencensus/main.go b/example/opencensus/main.go index 8014bb15d343..ceccb82d0837 100644 --- a/example/opencensus/main.go +++ b/example/opencensus/main.go @@ -33,7 +33,7 @@ import ( "go.opentelemetry.io/otel/bridge/opencensus" "go.opentelemetry.io/otel/exporters/stdout/stdoutmetric" "go.opentelemetry.io/otel/exporters/stdout/stdouttrace" - otmetricexport "go.opentelemetry.io/otel/sdk/export/metric" + "go.opentelemetry.io/otel/sdk/metric/export" sdktrace "go.opentelemetry.io/otel/sdk/trace" ) @@ -100,7 +100,7 @@ func tracing(otExporter sdktrace.SpanExporter) { // monitoring demonstrates creating an IntervalReader using the OpenTelemetry // exporter to send metrics to the exporter by using either an OpenCensus // registry or an OpenCensus view. -func monitoring(otExporter otmetricexport.Exporter) { +func monitoring(otExporter export.Exporter) { log.Println("Using the OpenTelemetry stdoutmetric exporter to export OpenCensus metrics. This allows routing telemetry from both OpenTelemetry and OpenCensus to a single exporter.") ocExporter := opencensus.NewMetricExporter(otExporter) intervalReader, err := metricexport.NewIntervalReader(&metricexport.Reader{}, ocExporter) diff --git a/example/otel-collector/go.mod b/example/otel-collector/go.mod index 153c85dc6735..ce8370c0486e 100644 --- a/example/otel-collector/go.mod +++ b/example/otel-collector/go.mod @@ -43,8 +43,6 @@ replace go.opentelemetry.io/otel/internal/tools => ../../internal/tools replace go.opentelemetry.io/otel/metric => ../../metric -replace go.opentelemetry.io/otel/sdk/export/metric => ../../sdk/export/metric - replace go.opentelemetry.io/otel/sdk/metric => ../../sdk/metric replace go.opentelemetry.io/otel/trace => ../../trace diff --git a/example/passthrough/go.mod b/example/passthrough/go.mod index f9c0630e1058..6e37e67e65e9 100644 --- a/example/passthrough/go.mod +++ b/example/passthrough/go.mod @@ -45,8 +45,6 @@ replace go.opentelemetry.io/otel/internal/tools => ../../internal/tools replace go.opentelemetry.io/otel/metric => ../../metric -replace go.opentelemetry.io/otel/sdk/export/metric => ../../sdk/export/metric - replace go.opentelemetry.io/otel/sdk/metric => ../../sdk/metric replace go.opentelemetry.io/otel/sdk/trace => ../../sdk/trace diff --git a/example/prometheus/go.mod b/example/prometheus/go.mod index c5e0343e865f..3a202c5bb827 100644 --- a/example/prometheus/go.mod +++ b/example/prometheus/go.mod @@ -12,7 +12,6 @@ require ( go.opentelemetry.io/otel v1.2.0 go.opentelemetry.io/otel/exporters/prometheus v0.25.0 go.opentelemetry.io/otel/metric v0.25.0 - go.opentelemetry.io/otel/sdk/export/metric v0.25.0 go.opentelemetry.io/otel/sdk/metric v0.25.0 ) @@ -42,8 +41,6 @@ replace go.opentelemetry.io/otel/internal/tools => ../../internal/tools replace go.opentelemetry.io/otel/metric => ../../metric -replace go.opentelemetry.io/otel/sdk/export/metric => ../../sdk/export/metric - replace go.opentelemetry.io/otel/sdk/metric => ../../sdk/metric replace go.opentelemetry.io/otel/trace => ../../trace diff --git a/example/prometheus/main.go b/example/prometheus/main.go index 968beb3d4837..4ef0f2e89e23 100644 --- a/example/prometheus/main.go +++ b/example/prometheus/main.go @@ -26,9 +26,9 @@ import ( "go.opentelemetry.io/otel/exporters/prometheus" "go.opentelemetry.io/otel/metric" "go.opentelemetry.io/otel/metric/global" - "go.opentelemetry.io/otel/sdk/export/metric/aggregation" "go.opentelemetry.io/otel/sdk/metric/aggregator/histogram" controller "go.opentelemetry.io/otel/sdk/metric/controller/basic" + "go.opentelemetry.io/otel/sdk/metric/export/aggregation" processor "go.opentelemetry.io/otel/sdk/metric/processor/basic" selector "go.opentelemetry.io/otel/sdk/metric/selector/simple" ) diff --git a/example/zipkin/go.mod b/example/zipkin/go.mod index fa2494c92172..ce6ae60c17c2 100644 --- a/example/zipkin/go.mod +++ b/example/zipkin/go.mod @@ -41,8 +41,6 @@ replace go.opentelemetry.io/otel/internal/tools => ../../internal/tools replace go.opentelemetry.io/otel/metric => ../../metric -replace go.opentelemetry.io/otel/sdk/export/metric => ../../sdk/export/metric - replace go.opentelemetry.io/otel/sdk/metric => ../../sdk/metric replace go.opentelemetry.io/otel/trace => ../../trace diff --git a/exporters/jaeger/go.mod b/exporters/jaeger/go.mod index 9c87adb97751..d6e34de710e5 100644 --- a/exporters/jaeger/go.mod +++ b/exporters/jaeger/go.mod @@ -38,8 +38,6 @@ replace go.opentelemetry.io/otel/internal/tools => ../../internal/tools replace go.opentelemetry.io/otel/metric => ../../metric -replace go.opentelemetry.io/otel/sdk/export/metric => ../../sdk/export/metric - replace go.opentelemetry.io/otel/sdk/metric => ../../sdk/metric replace go.opentelemetry.io/otel/trace => ../../trace diff --git a/exporters/otlp/otlpmetric/exporter.go b/exporters/otlp/otlpmetric/exporter.go index 798b690be01e..d6c9a6f4e766 100644 --- a/exporters/otlp/otlpmetric/exporter.go +++ b/exporters/otlp/otlpmetric/exporter.go @@ -21,8 +21,8 @@ import ( "go.opentelemetry.io/otel/exporters/otlp/otlpmetric/internal/metrictransform" "go.opentelemetry.io/otel/metric/sdkapi" - metricsdk "go.opentelemetry.io/otel/sdk/export/metric" - "go.opentelemetry.io/otel/sdk/export/metric/aggregation" + "go.opentelemetry.io/otel/sdk/metric/export" + "go.opentelemetry.io/otel/sdk/metric/export/aggregation" "go.opentelemetry.io/otel/sdk/resource" metricpb "go.opentelemetry.io/proto/otlp/metrics/v1" ) @@ -44,7 +44,7 @@ type Exporter struct { } // Export exports a batch of metrics. -func (e *Exporter) Export(ctx context.Context, res *resource.Resource, ilr metricsdk.InstrumentationLibraryReader) error { +func (e *Exporter) Export(ctx context.Context, res *resource.Resource, ilr export.InstrumentationLibraryReader) error { rm, err := metrictransform.InstrumentationLibraryReader(ctx, e, res, ilr, 1) if err != nil { return err @@ -100,7 +100,7 @@ func (e *Exporter) TemporalityFor(descriptor *sdkapi.Descriptor, kind aggregatio return e.temporalitySelector.TemporalityFor(descriptor, kind) } -var _ metricsdk.Exporter = (*Exporter)(nil) +var _ export.Exporter = (*Exporter)(nil) // New constructs a new Exporter and starts it. func New(ctx context.Context, client Client, opts ...Option) (*Exporter, error) { diff --git a/exporters/otlp/otlpmetric/exporter_test.go b/exporters/otlp/otlpmetric/exporter_test.go index 733d19788260..229d8838e277 100644 --- a/exporters/otlp/otlpmetric/exporter_test.go +++ b/exporters/otlp/otlpmetric/exporter_test.go @@ -32,11 +32,11 @@ import ( "go.opentelemetry.io/otel/metric/metrictest" "go.opentelemetry.io/otel/metric/number" "go.opentelemetry.io/otel/metric/sdkapi" - metricsdk "go.opentelemetry.io/otel/sdk/export/metric" - "go.opentelemetry.io/otel/sdk/export/metric/aggregation" "go.opentelemetry.io/otel/sdk/instrumentation" "go.opentelemetry.io/otel/sdk/metric/aggregator/histogram" "go.opentelemetry.io/otel/sdk/metric/aggregator/sum" + "go.opentelemetry.io/otel/sdk/metric/export" + "go.opentelemetry.io/otel/sdk/metric/export/aggregation" "go.opentelemetry.io/otel/sdk/metric/processor/processortest" "go.opentelemetry.io/otel/sdk/resource" commonpb "go.opentelemetry.io/proto/otlp/common/v1" @@ -675,14 +675,14 @@ func TestStatelessAggregationTemporality(t *testing.T) { func runMetricExportTests(t *testing.T, opts []otlpmetric.Option, res *resource.Resource, records []testRecord, expected []*metricpb.ResourceMetrics) { exp, driver := newExporter(t, opts...) - libraryRecs := map[instrumentation.Library][]metricsdk.Record{} + libraryRecs := map[instrumentation.Library][]export.Record{} for _, r := range records { lcopy := make([]attribute.KeyValue, len(r.labels)) copy(lcopy, r.labels) desc := metrictest.NewDescriptor(r.name, r.iKind, r.nKind) labs := attribute.NewSet(lcopy...) - var agg, ckpt metricsdk.Aggregator + var agg, ckpt export.Aggregator if r.iKind.Adding() { sums := sum.New(2) agg, ckpt = &sums[0], &sums[1] @@ -723,7 +723,7 @@ func runMetricExportTests(t *testing.T, opts []otlpmetric.Option, res *resource. Version: meterCfg.InstrumentationVersion(), SchemaURL: meterCfg.SchemaURL(), } - libraryRecs[lib] = append(libraryRecs[lib], metricsdk.NewRecord(&desc, &labs, ckpt.Aggregation(), intervalStart, intervalEnd)) + libraryRecs[lib] = append(libraryRecs[lib], export.NewRecord(&desc, &labs, ckpt.Aggregation(), intervalStart, intervalEnd)) } assert.NoError(t, exp.Export(context.Background(), res, processortest.MultiInstrumentationLibraryReader(libraryRecs))) @@ -772,20 +772,20 @@ func TestEmptyMetricExport(t *testing.T) { exp, driver := newExporter(t) for _, test := range []struct { - records []metricsdk.Record + records []export.Record want []*metricpb.ResourceMetrics }{ { - []metricsdk.Record(nil), + []export.Record(nil), []*metricpb.ResourceMetrics(nil), }, { - []metricsdk.Record{}, + []export.Record{}, []*metricpb.ResourceMetrics(nil), }, } { driver.Reset() - require.NoError(t, exp.Export(context.Background(), resource.Empty(), processortest.MultiInstrumentationLibraryReader(map[instrumentation.Library][]metricsdk.Record{ + require.NoError(t, exp.Export(context.Background(), resource.Empty(), processortest.MultiInstrumentationLibraryReader(map[instrumentation.Library][]export.Record{ { Name: testLibName, }: test.records, diff --git a/exporters/otlp/otlpmetric/go.mod b/exporters/otlp/otlpmetric/go.mod index a30f7a33f0e1..59848001cf3d 100644 --- a/exporters/otlp/otlpmetric/go.mod +++ b/exporters/otlp/otlpmetric/go.mod @@ -9,7 +9,6 @@ require ( go.opentelemetry.io/otel v1.2.0 go.opentelemetry.io/otel/metric v0.25.0 go.opentelemetry.io/otel/sdk v1.2.0 - go.opentelemetry.io/otel/sdk/export/metric v0.25.0 go.opentelemetry.io/otel/sdk/metric v0.25.0 go.opentelemetry.io/proto/otlp v0.11.0 google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 @@ -27,8 +26,6 @@ replace go.opentelemetry.io/otel/metric => ../../../metric replace go.opentelemetry.io/otel/trace => ../../../trace -replace go.opentelemetry.io/otel/sdk/export/metric => ../../../sdk/export/metric - replace go.opentelemetry.io/otel/sdk/metric => ../../../sdk/metric replace go.opentelemetry.io/otel/bridge/opencensus => ../../../bridge/opencensus diff --git a/exporters/otlp/otlpmetric/internal/metrictransform/metric.go b/exporters/otlp/otlpmetric/internal/metrictransform/metric.go index 2b342fbc17f5..bbbfb7847129 100644 --- a/exporters/otlp/otlpmetric/internal/metrictransform/metric.go +++ b/exporters/otlp/otlpmetric/internal/metrictransform/metric.go @@ -25,9 +25,9 @@ import ( "time" "go.opentelemetry.io/otel/metric/number" - export "go.opentelemetry.io/otel/sdk/export/metric" - "go.opentelemetry.io/otel/sdk/export/metric/aggregation" "go.opentelemetry.io/otel/sdk/instrumentation" + "go.opentelemetry.io/otel/sdk/metric/export" + "go.opentelemetry.io/otel/sdk/metric/export/aggregation" "go.opentelemetry.io/otel/sdk/resource" commonpb "go.opentelemetry.io/proto/otlp/common/v1" metricpb "go.opentelemetry.io/proto/otlp/metrics/v1" diff --git a/exporters/otlp/otlpmetric/internal/metrictransform/metric_test.go b/exporters/otlp/otlpmetric/internal/metrictransform/metric_test.go index 120e85852c3d..7deb56cab7d8 100644 --- a/exporters/otlp/otlpmetric/internal/metrictransform/metric_test.go +++ b/exporters/otlp/otlpmetric/internal/metrictransform/metric_test.go @@ -28,11 +28,11 @@ import ( "go.opentelemetry.io/otel/metric/metrictest" "go.opentelemetry.io/otel/metric/number" "go.opentelemetry.io/otel/metric/sdkapi" - export "go.opentelemetry.io/otel/sdk/export/metric" - "go.opentelemetry.io/otel/sdk/export/metric/aggregation" "go.opentelemetry.io/otel/sdk/metric/aggregator/lastvalue" "go.opentelemetry.io/otel/sdk/metric/aggregator/minmaxsumcount" "go.opentelemetry.io/otel/sdk/metric/aggregator/sum" + "go.opentelemetry.io/otel/sdk/metric/export" + "go.opentelemetry.io/otel/sdk/metric/export/aggregation" commonpb "go.opentelemetry.io/proto/otlp/common/v1" metricpb "go.opentelemetry.io/proto/otlp/metrics/v1" ) diff --git a/exporters/otlp/otlpmetric/internal/otlpmetrictest/data.go b/exporters/otlp/otlpmetric/internal/otlpmetrictest/data.go index 65f79594ee60..cc3f7871598e 100644 --- a/exporters/otlp/otlpmetric/internal/otlpmetrictest/data.go +++ b/exporters/otlp/otlpmetric/internal/otlpmetrictest/data.go @@ -23,16 +23,16 @@ import ( "go.opentelemetry.io/otel/metric/metrictest" "go.opentelemetry.io/otel/metric/number" "go.opentelemetry.io/otel/metric/sdkapi" - exportmetric "go.opentelemetry.io/otel/sdk/export/metric" "go.opentelemetry.io/otel/sdk/instrumentation" "go.opentelemetry.io/otel/sdk/metric/aggregator/sum" + "go.opentelemetry.io/otel/sdk/metric/export" "go.opentelemetry.io/otel/sdk/metric/processor/processortest" ) // OneRecordReader is a Reader that returns just one // filled record. It may be useful for testing driver's metrics // export. -func OneRecordReader() exportmetric.InstrumentationLibraryReader { +func OneRecordReader() export.InstrumentationLibraryReader { desc := metrictest.NewDescriptor( "foo", sdkapi.CounterInstrumentKind, @@ -45,17 +45,17 @@ func OneRecordReader() exportmetric.InstrumentationLibraryReader { start := time.Date(2020, time.December, 8, 19, 15, 0, 0, time.UTC) end := time.Date(2020, time.December, 8, 19, 16, 0, 0, time.UTC) labels := attribute.NewSet(attribute.String("abc", "def"), attribute.Int64("one", 1)) - rec := exportmetric.NewRecord(&desc, &labels, agg[0].Aggregation(), start, end) + rec := export.NewRecord(&desc, &labels, agg[0].Aggregation(), start, end) return processortest.MultiInstrumentationLibraryReader( - map[instrumentation.Library][]exportmetric.Record{ + map[instrumentation.Library][]export.Record{ { Name: "onelib", }: {rec}, }) } -func EmptyReader() exportmetric.InstrumentationLibraryReader { +func EmptyReader() export.InstrumentationLibraryReader { return processortest.MultiInstrumentationLibraryReader(nil) } @@ -63,9 +63,9 @@ func EmptyReader() exportmetric.InstrumentationLibraryReader { // ForEach. type FailReader struct{} -var _ exportmetric.InstrumentationLibraryReader = FailReader{} +var _ export.InstrumentationLibraryReader = FailReader{} -// ForEach implements exportmetric.Reader. It always fails. -func (FailReader) ForEach(readerFunc func(instrumentation.Library, exportmetric.Reader) error) error { +// ForEach implements export.Reader. It always fails. +func (FailReader) ForEach(readerFunc func(instrumentation.Library, export.Reader) error) error { return fmt.Errorf("fail") } diff --git a/exporters/otlp/otlpmetric/internal/otlpmetrictest/otlptest.go b/exporters/otlp/otlpmetric/internal/otlpmetrictest/otlptest.go index 82e5d53aebbb..c29472496386 100644 --- a/exporters/otlp/otlpmetric/internal/otlpmetrictest/otlptest.go +++ b/exporters/otlp/otlpmetric/internal/otlpmetrictest/otlptest.go @@ -28,8 +28,8 @@ import ( "go.opentelemetry.io/otel/metric" "go.opentelemetry.io/otel/metric/number" "go.opentelemetry.io/otel/metric/sdkapi" - "go.opentelemetry.io/otel/sdk/export/metric/aggregation" controller "go.opentelemetry.io/otel/sdk/metric/controller/basic" + "go.opentelemetry.io/otel/sdk/metric/export/aggregation" processor "go.opentelemetry.io/otel/sdk/metric/processor/basic" "go.opentelemetry.io/otel/sdk/metric/selector/simple" metricpb "go.opentelemetry.io/proto/otlp/metrics/v1" diff --git a/exporters/otlp/otlpmetric/options.go b/exporters/otlp/otlpmetric/options.go index dab33127be67..ce8a5f58c5ae 100644 --- a/exporters/otlp/otlpmetric/options.go +++ b/exporters/otlp/otlpmetric/options.go @@ -14,7 +14,7 @@ package otlpmetric // import "go.opentelemetry.io/otel/exporters/otlp/otlpmetric" -import "go.opentelemetry.io/otel/sdk/export/metric/aggregation" +import "go.opentelemetry.io/otel/sdk/metric/export/aggregation" // Option are setting options passed to an Exporter on creation. type Option interface { diff --git a/exporters/otlp/otlpmetric/otlpmetricgrpc/go.mod b/exporters/otlp/otlpmetric/otlpmetricgrpc/go.mod index 4a191e7dfe68..c45c3d3d122a 100644 --- a/exporters/otlp/otlpmetric/otlpmetricgrpc/go.mod +++ b/exporters/otlp/otlpmetric/otlpmetricgrpc/go.mod @@ -59,8 +59,6 @@ replace go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp => ../.. replace go.opentelemetry.io/otel/internal/tools => ../../../../internal/tools -replace go.opentelemetry.io/otel/sdk/export/metric => ../../../../sdk/export/metric - replace go.opentelemetry.io/otel/internal/metric => ../../../../internal/metric replace go.opentelemetry.io/otel/exporters/jaeger => ../../../jaeger diff --git a/exporters/otlp/otlpmetric/otlpmetrichttp/go.mod b/exporters/otlp/otlpmetric/otlpmetrichttp/go.mod index c5d8b0328512..8303cc688782 100644 --- a/exporters/otlp/otlpmetric/otlpmetrichttp/go.mod +++ b/exporters/otlp/otlpmetric/otlpmetrichttp/go.mod @@ -61,8 +61,6 @@ replace go.opentelemetry.io/otel/exporters/trace/zipkin => ../../../trace/zipkin replace go.opentelemetry.io/otel/internal/tools => ../../../../internal/tools -replace go.opentelemetry.io/otel/sdk/export/metric => ../../../../sdk/export/metric - replace go.opentelemetry.io/otel/internal/metric => ../../../../internal/metric replace go.opentelemetry.io/otel/exporters/jaeger => ../../../jaeger diff --git a/exporters/otlp/otlptrace/go.mod b/exporters/otlp/otlptrace/go.mod index 16704c288123..442331051446 100644 --- a/exporters/otlp/otlptrace/go.mod +++ b/exporters/otlp/otlptrace/go.mod @@ -53,8 +53,6 @@ replace go.opentelemetry.io/otel/exporters/zipkin => ../../zipkin replace go.opentelemetry.io/otel/internal/tools => ../../../internal/tools -replace go.opentelemetry.io/otel/sdk/export/metric => ../../../sdk/export/metric - replace go.opentelemetry.io/otel/sdk/metric => ../../../sdk/metric replace go.opentelemetry.io/otel/example/passthrough => ../../../example/passthrough diff --git a/exporters/otlp/otlptrace/otlptracegrpc/go.mod b/exporters/otlp/otlptrace/otlptracegrpc/go.mod index 08e67d27f907..22a4b6d22fea 100644 --- a/exporters/otlp/otlptrace/otlptracegrpc/go.mod +++ b/exporters/otlp/otlptrace/otlptracegrpc/go.mod @@ -49,8 +49,6 @@ replace go.opentelemetry.io/otel/exporters/zipkin => ../../../zipkin replace go.opentelemetry.io/otel/internal/tools => ../../../../internal/tools -replace go.opentelemetry.io/otel/sdk/export/metric => ../../../../sdk/export/metric - replace go.opentelemetry.io/otel/sdk/metric => ../../../../sdk/metric replace go.opentelemetry.io/otel/example/passthrough => ../../../../example/passthrough diff --git a/exporters/otlp/otlptrace/otlptracehttp/go.mod b/exporters/otlp/otlptrace/otlptracehttp/go.mod index 2d776b12f3b3..66793ef9b706 100644 --- a/exporters/otlp/otlptrace/otlptracehttp/go.mod +++ b/exporters/otlp/otlptrace/otlptracehttp/go.mod @@ -52,8 +52,6 @@ replace go.opentelemetry.io/otel/metric => ../../../../metric replace go.opentelemetry.io/otel/sdk => ../../../../sdk -replace go.opentelemetry.io/otel/sdk/export/metric => ../../../../sdk/export/metric - replace go.opentelemetry.io/otel/sdk/metric => ../../../../sdk/metric replace go.opentelemetry.io/otel/trace => ../../../../trace diff --git a/exporters/prometheus/go.mod b/exporters/prometheus/go.mod index 7e88e55a2200..9dffd062456d 100644 --- a/exporters/prometheus/go.mod +++ b/exporters/prometheus/go.mod @@ -8,7 +8,6 @@ require ( go.opentelemetry.io/otel v1.2.0 go.opentelemetry.io/otel/metric v0.25.0 go.opentelemetry.io/otel/sdk v1.2.0 - go.opentelemetry.io/otel/sdk/export/metric v0.25.0 go.opentelemetry.io/otel/sdk/metric v0.25.0 ) @@ -56,8 +55,6 @@ replace go.opentelemetry.io/otel/metric => ../../metric replace go.opentelemetry.io/otel/sdk => ../../sdk -replace go.opentelemetry.io/otel/sdk/export/metric => ../../sdk/export/metric - replace go.opentelemetry.io/otel/sdk/metric => ../../sdk/metric replace go.opentelemetry.io/otel/trace => ../../trace diff --git a/exporters/prometheus/prometheus.go b/exporters/prometheus/prometheus.go index 369c0ce1fe1a..085955262635 100644 --- a/exporters/prometheus/prometheus.go +++ b/exporters/prometheus/prometheus.go @@ -31,10 +31,10 @@ import ( "go.opentelemetry.io/otel/metric" "go.opentelemetry.io/otel/metric/number" "go.opentelemetry.io/otel/metric/sdkapi" - export "go.opentelemetry.io/otel/sdk/export/metric" - "go.opentelemetry.io/otel/sdk/export/metric/aggregation" "go.opentelemetry.io/otel/sdk/instrumentation" controller "go.opentelemetry.io/otel/sdk/metric/controller/basic" + "go.opentelemetry.io/otel/sdk/metric/export" + "go.opentelemetry.io/otel/sdk/metric/export/aggregation" "go.opentelemetry.io/otel/sdk/resource" ) diff --git a/exporters/prometheus/prometheus_test.go b/exporters/prometheus/prometheus_test.go index 5efdba334691..907db0db4b7c 100644 --- a/exporters/prometheus/prometheus_test.go +++ b/exporters/prometheus/prometheus_test.go @@ -27,9 +27,9 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/exporters/prometheus" "go.opentelemetry.io/otel/metric" - "go.opentelemetry.io/otel/sdk/export/metric/aggregation" "go.opentelemetry.io/otel/sdk/metric/aggregator/histogram" controller "go.opentelemetry.io/otel/sdk/metric/controller/basic" + "go.opentelemetry.io/otel/sdk/metric/export/aggregation" processor "go.opentelemetry.io/otel/sdk/metric/processor/basic" selector "go.opentelemetry.io/otel/sdk/metric/selector/simple" "go.opentelemetry.io/otel/sdk/resource" diff --git a/exporters/stdout/stdoutmetric/exporter.go b/exporters/stdout/stdoutmetric/exporter.go index 25b129dcdfdf..e1ea02339c0c 100644 --- a/exporters/stdout/stdoutmetric/exporter.go +++ b/exporters/stdout/stdoutmetric/exporter.go @@ -14,16 +14,14 @@ package stdoutmetric // import "go.opentelemetry.io/otel/exporters/stdout/stdoutmetric" -import ( - "go.opentelemetry.io/otel/sdk/export/metric" -) +import "go.opentelemetry.io/otel/sdk/metric/export" type Exporter struct { metricExporter } var ( - _ metric.Exporter = &Exporter{} + _ export.Exporter = &Exporter{} ) // New creates an Exporter with the passed options. diff --git a/exporters/stdout/stdoutmetric/go.mod b/exporters/stdout/stdoutmetric/go.mod index d4bb9d5b8550..a5f282ec2d9b 100644 --- a/exporters/stdout/stdoutmetric/go.mod +++ b/exporters/stdout/stdoutmetric/go.mod @@ -12,7 +12,6 @@ require ( go.opentelemetry.io/otel v1.2.0 go.opentelemetry.io/otel/metric v0.25.0 go.opentelemetry.io/otel/sdk v1.2.0 - go.opentelemetry.io/otel/sdk/export/metric v0.25.0 go.opentelemetry.io/otel/sdk/metric v0.25.0 ) @@ -46,8 +45,6 @@ replace go.opentelemetry.io/otel/internal/tools => ../../../internal/tools replace go.opentelemetry.io/otel/metric => ../../../metric -replace go.opentelemetry.io/otel/sdk/export/metric => ../../../sdk/export/metric - replace go.opentelemetry.io/otel/sdk/metric => ../../../sdk/metric replace go.opentelemetry.io/otel/trace => ../../../trace diff --git a/exporters/stdout/stdoutmetric/metric.go b/exporters/stdout/stdoutmetric/metric.go index 07333c64fb77..10dfef7c8a91 100644 --- a/exporters/stdout/stdoutmetric/metric.go +++ b/exporters/stdout/stdoutmetric/metric.go @@ -23,9 +23,9 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/metric/sdkapi" - exportmetric "go.opentelemetry.io/otel/sdk/export/metric" - "go.opentelemetry.io/otel/sdk/export/metric/aggregation" "go.opentelemetry.io/otel/sdk/instrumentation" + "go.opentelemetry.io/otel/sdk/metric/export" + "go.opentelemetry.io/otel/sdk/metric/export/aggregation" "go.opentelemetry.io/otel/sdk/resource" ) @@ -33,7 +33,7 @@ type metricExporter struct { config config } -var _ exportmetric.Exporter = &metricExporter{} +var _ export.Exporter = &metricExporter{} type line struct { Name string `json:"Name"` @@ -51,10 +51,10 @@ func (e *metricExporter) TemporalityFor(desc *sdkapi.Descriptor, kind aggregatio return aggregation.StatelessTemporalitySelector().TemporalityFor(desc, kind) } -func (e *metricExporter) Export(_ context.Context, res *resource.Resource, reader exportmetric.InstrumentationLibraryReader) error { +func (e *metricExporter) Export(_ context.Context, res *resource.Resource, reader export.InstrumentationLibraryReader) error { var aggError error var batch []line - aggError = reader.ForEach(func(lib instrumentation.Library, mr exportmetric.Reader) error { + aggError = reader.ForEach(func(lib instrumentation.Library, mr export.Reader) error { var instLabels []attribute.KeyValue if name := lib.Name; name != "" { @@ -69,7 +69,7 @@ func (e *metricExporter) Export(_ context.Context, res *resource.Resource, reade instSet := attribute.NewSet(instLabels...) encodedInstLabels := instSet.Encoded(e.config.LabelEncoder) - return mr.ForEach(e, func(record exportmetric.Record) error { + return mr.ForEach(e, func(record export.Record) error { desc := record.Descriptor() agg := record.Aggregation() kind := desc.NumberKind() diff --git a/exporters/stdout/stdoutmetric/metric_test.go b/exporters/stdout/stdoutmetric/metric_test.go index 0fb243f5d242..62e89424119f 100644 --- a/exporters/stdout/stdoutmetric/metric_test.go +++ b/exporters/stdout/stdoutmetric/metric_test.go @@ -29,8 +29,8 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/exporters/stdout/stdoutmetric" "go.opentelemetry.io/otel/metric" - "go.opentelemetry.io/otel/sdk/export/metric/aggregation" controller "go.opentelemetry.io/otel/sdk/metric/controller/basic" + "go.opentelemetry.io/otel/sdk/metric/export/aggregation" processor "go.opentelemetry.io/otel/sdk/metric/processor/basic" "go.opentelemetry.io/otel/sdk/metric/processor/processortest" "go.opentelemetry.io/otel/sdk/resource" diff --git a/exporters/stdout/stdouttrace/go.mod b/exporters/stdout/stdouttrace/go.mod index f697e6832ddd..593673f607d2 100644 --- a/exporters/stdout/stdouttrace/go.mod +++ b/exporters/stdout/stdouttrace/go.mod @@ -44,8 +44,6 @@ replace go.opentelemetry.io/otel/internal/tools => ../../../internal/tools replace go.opentelemetry.io/otel/metric => ../../../metric -replace go.opentelemetry.io/otel/sdk/export/metric => ../../../sdk/export/metric - replace go.opentelemetry.io/otel/sdk/metric => ../../../sdk/metric replace go.opentelemetry.io/otel/trace => ../../../trace diff --git a/exporters/zipkin/go.mod b/exporters/zipkin/go.mod index 870f44177237..6958f4f98e58 100644 --- a/exporters/zipkin/go.mod +++ b/exporters/zipkin/go.mod @@ -41,8 +41,6 @@ replace go.opentelemetry.io/otel/internal/tools => ../../internal/tools replace go.opentelemetry.io/otel/metric => ../../metric -replace go.opentelemetry.io/otel/sdk/export/metric => ../../sdk/export/metric - replace go.opentelemetry.io/otel/sdk/metric => ../../sdk/metric replace go.opentelemetry.io/otel/trace => ../../trace diff --git a/go.mod b/go.mod index ca30e57cd738..410c4e9f31ba 100644 --- a/go.mod +++ b/go.mod @@ -42,8 +42,6 @@ replace go.opentelemetry.io/otel/internal/metric => ./internal/metric replace go.opentelemetry.io/otel/metric => ./metric -replace go.opentelemetry.io/otel/sdk/export/metric => ./sdk/export/metric - replace go.opentelemetry.io/otel/sdk/metric => ./sdk/metric replace go.opentelemetry.io/otel/trace => ./trace diff --git a/internal/metric/go.mod b/internal/metric/go.mod index 59b4b82fbd7a..dbdcfa87d75e 100644 --- a/internal/metric/go.mod +++ b/internal/metric/go.mod @@ -50,8 +50,6 @@ replace go.opentelemetry.io/otel/internal/tools => ../tools replace go.opentelemetry.io/otel/sdk => ../../sdk -replace go.opentelemetry.io/otel/sdk/export/metric => ../../sdk/export/metric - replace go.opentelemetry.io/otel/sdk/metric => ../../sdk/metric replace go.opentelemetry.io/otel/trace => ../../trace diff --git a/internal/tools/go.mod b/internal/tools/go.mod index 4b3200b95026..4d558a6ba972 100644 --- a/internal/tools/go.mod +++ b/internal/tools/go.mod @@ -47,8 +47,6 @@ replace go.opentelemetry.io/otel/sdk => ../../sdk replace go.opentelemetry.io/otel/metric => ../../metric -replace go.opentelemetry.io/otel/sdk/export/metric => ../../sdk/export/metric - replace go.opentelemetry.io/otel/sdk/metric => ../../sdk/metric replace go.opentelemetry.io/otel/trace => ../../trace diff --git a/metric/go.mod b/metric/go.mod index f8f9ce76eff3..839bc5b8db71 100644 --- a/metric/go.mod +++ b/metric/go.mod @@ -34,8 +34,6 @@ replace go.opentelemetry.io/otel/metric => ./ replace go.opentelemetry.io/otel/sdk => ../sdk -replace go.opentelemetry.io/otel/sdk/export/metric => ../sdk/export/metric - replace go.opentelemetry.io/otel/sdk/metric => ../sdk/metric replace go.opentelemetry.io/otel/trace => ../trace diff --git a/schema/go.mod b/schema/go.mod index 1797a666710c..6390306c8309 100644 --- a/schema/go.mod +++ b/schema/go.mod @@ -64,8 +64,6 @@ replace go.opentelemetry.io/otel/schema => ./ replace go.opentelemetry.io/otel/sdk => ../sdk -replace go.opentelemetry.io/otel/sdk/export/metric => ../sdk/export/metric - replace go.opentelemetry.io/otel/sdk/metric => ../sdk/metric replace go.opentelemetry.io/otel/trace => ../trace diff --git a/sdk/export/metric/go.mod b/sdk/export/metric/go.mod deleted file mode 100644 index c4f47cf650c2..000000000000 --- a/sdk/export/metric/go.mod +++ /dev/null @@ -1,74 +0,0 @@ -module go.opentelemetry.io/otel/sdk/export/metric - -go 1.15 - -replace go.opentelemetry.io/otel => ../../.. - -replace go.opentelemetry.io/otel/bridge/opencensus => ../../../bridge/opencensus - -replace go.opentelemetry.io/otel/bridge/opentracing => ../../../bridge/opentracing - -replace go.opentelemetry.io/otel/example/jaeger => ../../../example/jaeger - -replace go.opentelemetry.io/otel/example/namedtracer => ../../../example/namedtracer - -replace go.opentelemetry.io/otel/example/opencensus => ../../../example/opencensus - -replace go.opentelemetry.io/otel/example/otel-collector => ../../../example/otel-collector - -replace go.opentelemetry.io/otel/example/prom-collector => ../../../example/prom-collector - -replace go.opentelemetry.io/otel/example/prometheus => ../../../example/prometheus - -replace go.opentelemetry.io/otel/example/zipkin => ../../../example/zipkin - -replace go.opentelemetry.io/otel/exporters/prometheus => ../../../exporters/prometheus - -replace go.opentelemetry.io/otel/exporters/jaeger => ../../../exporters/jaeger - -replace go.opentelemetry.io/otel/exporters/zipkin => ../../../exporters/zipkin - -replace go.opentelemetry.io/otel/internal/tools => ../../../internal/tools - -replace go.opentelemetry.io/otel/metric => ../../../metric - -replace go.opentelemetry.io/otel/sdk => ../.. - -replace go.opentelemetry.io/otel/sdk/export/metric => ./ - -replace go.opentelemetry.io/otel/sdk/metric => ../../metric - -replace go.opentelemetry.io/otel/trace => ../../../trace - -require ( - github.com/stretchr/testify v1.7.0 - go.opentelemetry.io/otel v1.2.0 - go.opentelemetry.io/otel/metric v0.25.0 - go.opentelemetry.io/otel/sdk v1.2.0 -) - -replace go.opentelemetry.io/otel/example/passthrough => ../../../example/passthrough - -replace go.opentelemetry.io/otel/exporters/otlp/otlptrace => ../../../exporters/otlp/otlptrace - -replace go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc => ../../../exporters/otlp/otlptrace/otlptracegrpc - -replace go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp => ../../../exporters/otlp/otlptrace/otlptracehttp - -replace go.opentelemetry.io/otel/internal/metric => ../../../internal/metric - -replace go.opentelemetry.io/otel/exporters/otlp/otlpmetric => ../../../exporters/otlp/otlpmetric - -replace go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc => ../../../exporters/otlp/otlpmetric/otlpmetricgrpc - -replace go.opentelemetry.io/otel/exporters/stdout/stdoutmetric => ../../../exporters/stdout/stdoutmetric - -replace go.opentelemetry.io/otel/exporters/stdout/stdouttrace => ../../../exporters/stdout/stdouttrace - -replace go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp => ../../../exporters/otlp/otlpmetric/otlpmetrichttp - -replace go.opentelemetry.io/otel/bridge/opencensus/test => ../../../bridge/opencensus/test - -replace go.opentelemetry.io/otel/example/fib => ../../../example/fib - -replace go.opentelemetry.io/otel/schema => ../../../schema diff --git a/sdk/export/metric/go.sum b/sdk/export/metric/go.sum deleted file mode 100644 index 2ae2b35b2895..000000000000 --- a/sdk/export/metric/go.sum +++ /dev/null @@ -1,17 +0,0 @@ -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7 h1:iGu644GcxtEcrInvDsQRCwJjtCIOlT2V7IRt6ah2Whw= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/go.mod b/sdk/go.mod index 3e53688cd54c..d751792e11d9 100644 --- a/sdk/go.mod +++ b/sdk/go.mod @@ -42,8 +42,6 @@ replace go.opentelemetry.io/otel/sdk => ./ replace go.opentelemetry.io/otel/metric => ../metric -replace go.opentelemetry.io/otel/sdk/export/metric => ./export/metric - replace go.opentelemetry.io/otel/sdk/metric => ./metric replace go.opentelemetry.io/otel/trace => ../trace diff --git a/sdk/metric/aggregator/aggregator.go b/sdk/metric/aggregator/aggregator.go index 13a315e2d4ac..103c08cfa0b4 100644 --- a/sdk/metric/aggregator/aggregator.go +++ b/sdk/metric/aggregator/aggregator.go @@ -20,8 +20,8 @@ import ( "go.opentelemetry.io/otel/metric/number" "go.opentelemetry.io/otel/metric/sdkapi" - export "go.opentelemetry.io/otel/sdk/export/metric" - "go.opentelemetry.io/otel/sdk/export/metric/aggregation" + "go.opentelemetry.io/otel/sdk/metric/export" + "go.opentelemetry.io/otel/sdk/metric/export/aggregation" ) // NewInconsistentAggregatorError formats an error describing an attempt to diff --git a/sdk/metric/aggregator/aggregator_test.go b/sdk/metric/aggregator/aggregator_test.go index fd85297ed1dc..bf405b5c3f83 100644 --- a/sdk/metric/aggregator/aggregator_test.go +++ b/sdk/metric/aggregator/aggregator_test.go @@ -24,10 +24,10 @@ import ( "go.opentelemetry.io/otel/metric/metrictest" "go.opentelemetry.io/otel/metric/number" "go.opentelemetry.io/otel/metric/sdkapi" - "go.opentelemetry.io/otel/sdk/export/metric/aggregation" "go.opentelemetry.io/otel/sdk/metric/aggregator" "go.opentelemetry.io/otel/sdk/metric/aggregator/lastvalue" "go.opentelemetry.io/otel/sdk/metric/aggregator/sum" + "go.opentelemetry.io/otel/sdk/metric/export/aggregation" ) func TestInconsistentAggregatorErr(t *testing.T) { diff --git a/sdk/metric/aggregator/aggregatortest/test.go b/sdk/metric/aggregator/aggregatortest/test.go index 2fbfca5eed92..48b92ec9c7eb 100644 --- a/sdk/metric/aggregator/aggregatortest/test.go +++ b/sdk/metric/aggregator/aggregatortest/test.go @@ -29,9 +29,9 @@ import ( "go.opentelemetry.io/otel/metric/metrictest" "go.opentelemetry.io/otel/metric/number" "go.opentelemetry.io/otel/metric/sdkapi" - export "go.opentelemetry.io/otel/sdk/export/metric" - "go.opentelemetry.io/otel/sdk/export/metric/aggregation" "go.opentelemetry.io/otel/sdk/metric/aggregator" + "go.opentelemetry.io/otel/sdk/metric/export" + "go.opentelemetry.io/otel/sdk/metric/export/aggregation" ) const Magnitude = 1000 diff --git a/sdk/metric/aggregator/histogram/histogram.go b/sdk/metric/aggregator/histogram/histogram.go index 899c71cacd1c..888c985ce3e1 100644 --- a/sdk/metric/aggregator/histogram/histogram.go +++ b/sdk/metric/aggregator/histogram/histogram.go @@ -21,9 +21,9 @@ import ( "go.opentelemetry.io/otel/metric/number" "go.opentelemetry.io/otel/metric/sdkapi" - export "go.opentelemetry.io/otel/sdk/export/metric" - "go.opentelemetry.io/otel/sdk/export/metric/aggregation" "go.opentelemetry.io/otel/sdk/metric/aggregator" + "go.opentelemetry.io/otel/sdk/metric/export" + "go.opentelemetry.io/otel/sdk/metric/export/aggregation" ) // Note: This code uses a Mutex to govern access to the exclusive diff --git a/sdk/metric/aggregator/histogram/histogram_test.go b/sdk/metric/aggregator/histogram/histogram_test.go index a4c5c6da6870..2d09edbfdc9d 100644 --- a/sdk/metric/aggregator/histogram/histogram_test.go +++ b/sdk/metric/aggregator/histogram/histogram_test.go @@ -25,9 +25,9 @@ import ( "go.opentelemetry.io/otel/metric/number" "go.opentelemetry.io/otel/metric/sdkapi" - export "go.opentelemetry.io/otel/sdk/export/metric" "go.opentelemetry.io/otel/sdk/metric/aggregator/aggregatortest" "go.opentelemetry.io/otel/sdk/metric/aggregator/histogram" + "go.opentelemetry.io/otel/sdk/metric/export" ) const count = 100 diff --git a/sdk/metric/aggregator/lastvalue/lastvalue.go b/sdk/metric/aggregator/lastvalue/lastvalue.go index 71b117890cb5..4a1da7060620 100644 --- a/sdk/metric/aggregator/lastvalue/lastvalue.go +++ b/sdk/metric/aggregator/lastvalue/lastvalue.go @@ -22,9 +22,9 @@ import ( "go.opentelemetry.io/otel/metric/number" "go.opentelemetry.io/otel/metric/sdkapi" - export "go.opentelemetry.io/otel/sdk/export/metric" - "go.opentelemetry.io/otel/sdk/export/metric/aggregation" "go.opentelemetry.io/otel/sdk/metric/aggregator" + "go.opentelemetry.io/otel/sdk/metric/export" + "go.opentelemetry.io/otel/sdk/metric/export/aggregation" ) type ( diff --git a/sdk/metric/aggregator/lastvalue/lastvalue_test.go b/sdk/metric/aggregator/lastvalue/lastvalue_test.go index 8f1a771009cb..bdfe6a65bd4f 100644 --- a/sdk/metric/aggregator/lastvalue/lastvalue_test.go +++ b/sdk/metric/aggregator/lastvalue/lastvalue_test.go @@ -27,9 +27,9 @@ import ( ottest "go.opentelemetry.io/otel/internal/internaltest" "go.opentelemetry.io/otel/metric/number" "go.opentelemetry.io/otel/metric/sdkapi" - export "go.opentelemetry.io/otel/sdk/export/metric" - "go.opentelemetry.io/otel/sdk/export/metric/aggregation" "go.opentelemetry.io/otel/sdk/metric/aggregator/aggregatortest" + "go.opentelemetry.io/otel/sdk/metric/export" + "go.opentelemetry.io/otel/sdk/metric/export/aggregation" ) const count = 100 diff --git a/sdk/metric/aggregator/minmaxsumcount/mmsc.go b/sdk/metric/aggregator/minmaxsumcount/mmsc.go index 663cb4e0d3d1..467de0ebb960 100644 --- a/sdk/metric/aggregator/minmaxsumcount/mmsc.go +++ b/sdk/metric/aggregator/minmaxsumcount/mmsc.go @@ -20,9 +20,9 @@ import ( "go.opentelemetry.io/otel/metric/number" "go.opentelemetry.io/otel/metric/sdkapi" - export "go.opentelemetry.io/otel/sdk/export/metric" - "go.opentelemetry.io/otel/sdk/export/metric/aggregation" "go.opentelemetry.io/otel/sdk/metric/aggregator" + "go.opentelemetry.io/otel/sdk/metric/export" + "go.opentelemetry.io/otel/sdk/metric/export/aggregation" ) type ( diff --git a/sdk/metric/aggregator/minmaxsumcount/mmsc_test.go b/sdk/metric/aggregator/minmaxsumcount/mmsc_test.go index b0dc7f8fb191..dd4f81c160c8 100644 --- a/sdk/metric/aggregator/minmaxsumcount/mmsc_test.go +++ b/sdk/metric/aggregator/minmaxsumcount/mmsc_test.go @@ -24,9 +24,9 @@ import ( "go.opentelemetry.io/otel/metric/number" "go.opentelemetry.io/otel/metric/sdkapi" - export "go.opentelemetry.io/otel/sdk/export/metric" - "go.opentelemetry.io/otel/sdk/export/metric/aggregation" "go.opentelemetry.io/otel/sdk/metric/aggregator/aggregatortest" + "go.opentelemetry.io/otel/sdk/metric/export" + "go.opentelemetry.io/otel/sdk/metric/export/aggregation" ) const count = 100 diff --git a/sdk/metric/aggregator/sum/sum.go b/sdk/metric/aggregator/sum/sum.go index 26390a61015d..47af665029fd 100644 --- a/sdk/metric/aggregator/sum/sum.go +++ b/sdk/metric/aggregator/sum/sum.go @@ -19,9 +19,9 @@ import ( "go.opentelemetry.io/otel/metric/number" "go.opentelemetry.io/otel/metric/sdkapi" - export "go.opentelemetry.io/otel/sdk/export/metric" - "go.opentelemetry.io/otel/sdk/export/metric/aggregation" "go.opentelemetry.io/otel/sdk/metric/aggregator" + "go.opentelemetry.io/otel/sdk/metric/export" + "go.opentelemetry.io/otel/sdk/metric/export/aggregation" ) // Aggregator aggregates counter events. diff --git a/sdk/metric/aggregator/sum/sum_test.go b/sdk/metric/aggregator/sum/sum_test.go index 3387c83cc8d5..da614d83f49b 100644 --- a/sdk/metric/aggregator/sum/sum_test.go +++ b/sdk/metric/aggregator/sum/sum_test.go @@ -24,8 +24,8 @@ import ( ottest "go.opentelemetry.io/otel/internal/internaltest" "go.opentelemetry.io/otel/metric/number" "go.opentelemetry.io/otel/metric/sdkapi" - export "go.opentelemetry.io/otel/sdk/export/metric" "go.opentelemetry.io/otel/sdk/metric/aggregator/aggregatortest" + "go.opentelemetry.io/otel/sdk/metric/export" ) const count = 100 diff --git a/sdk/metric/benchmark_test.go b/sdk/metric/benchmark_test.go index f7eacae962cd..063bc099ddc4 100644 --- a/sdk/metric/benchmark_test.go +++ b/sdk/metric/benchmark_test.go @@ -24,8 +24,8 @@ import ( "go.opentelemetry.io/otel/metric" "go.opentelemetry.io/otel/metric/global" "go.opentelemetry.io/otel/metric/sdkapi" - export "go.opentelemetry.io/otel/sdk/export/metric" sdk "go.opentelemetry.io/otel/sdk/metric" + "go.opentelemetry.io/otel/sdk/metric/export" "go.opentelemetry.io/otel/sdk/metric/processor/processortest" ) diff --git a/sdk/metric/controller/basic/config.go b/sdk/metric/controller/basic/config.go index cbc91a8f59d7..01691ecadd1d 100644 --- a/sdk/metric/controller/basic/config.go +++ b/sdk/metric/controller/basic/config.go @@ -18,7 +18,7 @@ import ( "time" "go.opentelemetry.io/otel" - export "go.opentelemetry.io/otel/sdk/export/metric" + "go.opentelemetry.io/otel/sdk/metric/export" "go.opentelemetry.io/otel/sdk/resource" ) diff --git a/sdk/metric/controller/basic/controller.go b/sdk/metric/controller/basic/controller.go index bf3be5fe1c9d..a684f65678e5 100644 --- a/sdk/metric/controller/basic/controller.go +++ b/sdk/metric/controller/basic/controller.go @@ -23,10 +23,10 @@ import ( "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/internal/metric/registry" "go.opentelemetry.io/otel/metric" - export "go.opentelemetry.io/otel/sdk/export/metric" "go.opentelemetry.io/otel/sdk/instrumentation" sdk "go.opentelemetry.io/otel/sdk/metric" controllerTime "go.opentelemetry.io/otel/sdk/metric/controller/time" + "go.opentelemetry.io/otel/sdk/metric/export" "go.opentelemetry.io/otel/sdk/resource" ) diff --git a/sdk/metric/controller/basic/controller_test.go b/sdk/metric/controller/basic/controller_test.go index 870e65f2c0c7..503a278148ce 100644 --- a/sdk/metric/controller/basic/controller_test.go +++ b/sdk/metric/controller/basic/controller_test.go @@ -27,11 +27,11 @@ import ( ottest "go.opentelemetry.io/otel/internal/internaltest" "go.opentelemetry.io/otel/metric" "go.opentelemetry.io/otel/metric/sdkapi" - export "go.opentelemetry.io/otel/sdk/export/metric" - "go.opentelemetry.io/otel/sdk/export/metric/aggregation" "go.opentelemetry.io/otel/sdk/instrumentation" controller "go.opentelemetry.io/otel/sdk/metric/controller/basic" "go.opentelemetry.io/otel/sdk/metric/controller/controllertest" + "go.opentelemetry.io/otel/sdk/metric/export" + "go.opentelemetry.io/otel/sdk/metric/export/aggregation" processor "go.opentelemetry.io/otel/sdk/metric/processor/basic" "go.opentelemetry.io/otel/sdk/metric/processor/processortest" "go.opentelemetry.io/otel/sdk/resource" diff --git a/sdk/metric/controller/basic/pull_test.go b/sdk/metric/controller/basic/pull_test.go index 6e87c6f6a97b..96d1e1adad15 100644 --- a/sdk/metric/controller/basic/pull_test.go +++ b/sdk/metric/controller/basic/pull_test.go @@ -24,9 +24,9 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/metric" - "go.opentelemetry.io/otel/sdk/export/metric/aggregation" controller "go.opentelemetry.io/otel/sdk/metric/controller/basic" "go.opentelemetry.io/otel/sdk/metric/controller/controllertest" + "go.opentelemetry.io/otel/sdk/metric/export/aggregation" processor "go.opentelemetry.io/otel/sdk/metric/processor/basic" "go.opentelemetry.io/otel/sdk/metric/processor/processortest" "go.opentelemetry.io/otel/sdk/resource" diff --git a/sdk/metric/controller/basic/push_test.go b/sdk/metric/controller/basic/push_test.go index 775754774bf7..0a6679b29de2 100644 --- a/sdk/metric/controller/basic/push_test.go +++ b/sdk/metric/controller/basic/push_test.go @@ -28,10 +28,10 @@ import ( "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/metric" - export "go.opentelemetry.io/otel/sdk/export/metric" - "go.opentelemetry.io/otel/sdk/export/metric/aggregation" controller "go.opentelemetry.io/otel/sdk/metric/controller/basic" "go.opentelemetry.io/otel/sdk/metric/controller/controllertest" + "go.opentelemetry.io/otel/sdk/metric/export" + "go.opentelemetry.io/otel/sdk/metric/export/aggregation" processor "go.opentelemetry.io/otel/sdk/metric/processor/basic" "go.opentelemetry.io/otel/sdk/metric/processor/processortest" "go.opentelemetry.io/otel/sdk/resource" diff --git a/sdk/metric/controller/controllertest/test.go b/sdk/metric/controller/controllertest/test.go index 8676129ebe53..ed0bb88f1a3c 100644 --- a/sdk/metric/controller/controllertest/test.go +++ b/sdk/metric/controller/controllertest/test.go @@ -19,10 +19,10 @@ import ( "github.com/benbjohnson/clock" - export "go.opentelemetry.io/otel/sdk/export/metric" - "go.opentelemetry.io/otel/sdk/export/metric/aggregation" "go.opentelemetry.io/otel/sdk/instrumentation" controllerTime "go.opentelemetry.io/otel/sdk/metric/controller/time" + "go.opentelemetry.io/otel/sdk/metric/export" + "go.opentelemetry.io/otel/sdk/metric/export/aggregation" ) type MockClock struct { diff --git a/sdk/metric/correct_test.go b/sdk/metric/correct_test.go index e41a3f9924d9..9f96b442ffca 100644 --- a/sdk/metric/correct_test.go +++ b/sdk/metric/correct_test.go @@ -27,9 +27,9 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/metric" "go.opentelemetry.io/otel/metric/sdkapi" - export "go.opentelemetry.io/otel/sdk/export/metric" - "go.opentelemetry.io/otel/sdk/export/metric/aggregation" metricsdk "go.opentelemetry.io/otel/sdk/metric" + "go.opentelemetry.io/otel/sdk/metric/export" + "go.opentelemetry.io/otel/sdk/metric/export/aggregation" "go.opentelemetry.io/otel/sdk/metric/processor/processortest" ) diff --git a/sdk/metric/doc.go b/sdk/metric/doc.go index 35d0fa554472..cda06cd61234 100644 --- a/sdk/metric/doc.go +++ b/sdk/metric/doc.go @@ -67,7 +67,7 @@ Export Pipeline While the SDK serves to maintain a current set of records and coordinate collection, the behavior of a metrics export pipeline is configured through the export types in -go.opentelemetry.io/otel/sdk/export/metric. It is important to keep +go.opentelemetry.io/otel/sdk/metric/export. It is important to keep in mind the context these interfaces are called from. There are two contexts, instrumentation context, where a user-level goroutine that enters the SDK resulting in a new record, and collection context, diff --git a/sdk/export/metric/aggregation/aggregation.go b/sdk/metric/export/aggregation/aggregation.go similarity index 97% rename from sdk/export/metric/aggregation/aggregation.go rename to sdk/metric/export/aggregation/aggregation.go index 51d3bd31c450..880a4c8dd707 100644 --- a/sdk/export/metric/aggregation/aggregation.go +++ b/sdk/metric/export/aggregation/aggregation.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package aggregation // import "go.opentelemetry.io/otel/sdk/export/metric/aggregation" +package aggregation // import "go.opentelemetry.io/otel/sdk/metric/export/aggregation" import ( "fmt" diff --git a/sdk/export/metric/aggregation/temporality.go b/sdk/metric/export/aggregation/temporality.go similarity index 97% rename from sdk/export/metric/aggregation/temporality.go rename to sdk/metric/export/aggregation/temporality.go index 4a4a733aa285..ca71b79d03fd 100644 --- a/sdk/export/metric/aggregation/temporality.go +++ b/sdk/metric/export/aggregation/temporality.go @@ -14,7 +14,7 @@ //go:generate stringer -type=Temporality -package aggregation // import "go.opentelemetry.io/otel/sdk/export/metric/aggregation" +package aggregation // import "go.opentelemetry.io/otel/sdk/metric/export/aggregation" import ( "go.opentelemetry.io/otel/metric/sdkapi" diff --git a/sdk/export/metric/aggregation/temporality_string.go b/sdk/metric/export/aggregation/temporality_string.go similarity index 100% rename from sdk/export/metric/aggregation/temporality_string.go rename to sdk/metric/export/aggregation/temporality_string.go diff --git a/sdk/export/metric/aggregation/temporality_test.go b/sdk/metric/export/aggregation/temporality_test.go similarity index 100% rename from sdk/export/metric/aggregation/temporality_test.go rename to sdk/metric/export/aggregation/temporality_test.go diff --git a/sdk/export/metric/metric.go b/sdk/metric/export/metric.go similarity index 99% rename from sdk/export/metric/metric.go rename to sdk/metric/export/metric.go index f077f74013fc..d536b9d4b2c8 100644 --- a/sdk/export/metric/metric.go +++ b/sdk/metric/export/metric.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package metric // import "go.opentelemetry.io/otel/sdk/export/metric" +package export // import "go.opentelemetry.io/otel/sdk/metric/export" import ( "context" @@ -22,8 +22,8 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/metric/number" "go.opentelemetry.io/otel/metric/sdkapi" - "go.opentelemetry.io/otel/sdk/export/metric/aggregation" "go.opentelemetry.io/otel/sdk/instrumentation" + "go.opentelemetry.io/otel/sdk/metric/export/aggregation" "go.opentelemetry.io/otel/sdk/resource" ) diff --git a/sdk/export/metric/metric_test.go b/sdk/metric/export/metric_test.go similarity index 99% rename from sdk/export/metric/metric_test.go rename to sdk/metric/export/metric_test.go index 706e3b83a517..5337d11c9e8e 100644 --- a/sdk/export/metric/metric_test.go +++ b/sdk/metric/export/metric_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package metric +package export import ( "testing" diff --git a/sdk/metric/go.mod b/sdk/metric/go.mod index b9c53984ebcf..96a27f11734d 100644 --- a/sdk/metric/go.mod +++ b/sdk/metric/go.mod @@ -34,8 +34,6 @@ replace go.opentelemetry.io/otel/metric => ../../metric replace go.opentelemetry.io/otel/sdk => ../ -replace go.opentelemetry.io/otel/sdk/export/metric => ../export/metric - replace go.opentelemetry.io/otel/sdk/metric => ./ replace go.opentelemetry.io/otel/trace => ../../trace @@ -47,7 +45,6 @@ require ( go.opentelemetry.io/otel/internal/metric v0.25.0 go.opentelemetry.io/otel/metric v0.25.0 go.opentelemetry.io/otel/sdk v1.2.0 - go.opentelemetry.io/otel/sdk/export/metric v0.25.0 ) replace go.opentelemetry.io/otel/example/passthrough => ../../example/passthrough diff --git a/sdk/metric/processor/basic/basic.go b/sdk/metric/processor/basic/basic.go index 7e2fd26320a1..ce7d5ca3b936 100644 --- a/sdk/metric/processor/basic/basic.go +++ b/sdk/metric/processor/basic/basic.go @@ -22,8 +22,8 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/metric/sdkapi" - export "go.opentelemetry.io/otel/sdk/export/metric" - "go.opentelemetry.io/otel/sdk/export/metric/aggregation" + "go.opentelemetry.io/otel/sdk/metric/export" + "go.opentelemetry.io/otel/sdk/metric/export/aggregation" ) type ( diff --git a/sdk/metric/processor/basic/basic_test.go b/sdk/metric/processor/basic/basic_test.go index c972a963fb6a..4f6063b7aad7 100644 --- a/sdk/metric/processor/basic/basic_test.go +++ b/sdk/metric/processor/basic/basic_test.go @@ -29,11 +29,11 @@ import ( "go.opentelemetry.io/otel/metric/metrictest" "go.opentelemetry.io/otel/metric/number" "go.opentelemetry.io/otel/metric/sdkapi" - export "go.opentelemetry.io/otel/sdk/export/metric" - "go.opentelemetry.io/otel/sdk/export/metric/aggregation" "go.opentelemetry.io/otel/sdk/instrumentation" sdk "go.opentelemetry.io/otel/sdk/metric" "go.opentelemetry.io/otel/sdk/metric/aggregator/aggregatortest" + "go.opentelemetry.io/otel/sdk/metric/export" + "go.opentelemetry.io/otel/sdk/metric/export/aggregation" "go.opentelemetry.io/otel/sdk/metric/processor/basic" "go.opentelemetry.io/otel/sdk/metric/processor/processortest" processorTest "go.opentelemetry.io/otel/sdk/metric/processor/processortest" diff --git a/sdk/metric/processor/processortest/test.go b/sdk/metric/processor/processortest/test.go index 6f7e56ef8b86..b1c8efeef63f 100644 --- a/sdk/metric/processor/processortest/test.go +++ b/sdk/metric/processor/processortest/test.go @@ -23,13 +23,13 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/metric/sdkapi" - export "go.opentelemetry.io/otel/sdk/export/metric" - "go.opentelemetry.io/otel/sdk/export/metric/aggregation" "go.opentelemetry.io/otel/sdk/instrumentation" "go.opentelemetry.io/otel/sdk/metric/aggregator/histogram" "go.opentelemetry.io/otel/sdk/metric/aggregator/lastvalue" "go.opentelemetry.io/otel/sdk/metric/aggregator/minmaxsumcount" "go.opentelemetry.io/otel/sdk/metric/aggregator/sum" + "go.opentelemetry.io/otel/sdk/metric/export" + "go.opentelemetry.io/otel/sdk/metric/export/aggregation" "go.opentelemetry.io/otel/sdk/resource" ) diff --git a/sdk/metric/processor/processortest/test_test.go b/sdk/metric/processor/processortest/test_test.go index 2ddbafc0ec85..4cc990c344a9 100644 --- a/sdk/metric/processor/processortest/test_test.go +++ b/sdk/metric/processor/processortest/test_test.go @@ -22,10 +22,10 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/metric" - export "go.opentelemetry.io/otel/sdk/export/metric" - "go.opentelemetry.io/otel/sdk/export/metric/aggregation" "go.opentelemetry.io/otel/sdk/instrumentation" metricsdk "go.opentelemetry.io/otel/sdk/metric" + "go.opentelemetry.io/otel/sdk/metric/export" + "go.opentelemetry.io/otel/sdk/metric/export/aggregation" "go.opentelemetry.io/otel/sdk/metric/processor/processortest" processorTest "go.opentelemetry.io/otel/sdk/metric/processor/processortest" "go.opentelemetry.io/otel/sdk/resource" diff --git a/sdk/metric/processor/reducer/reducer.go b/sdk/metric/processor/reducer/reducer.go index deb9edd34f12..b7fb48940367 100644 --- a/sdk/metric/processor/reducer/reducer.go +++ b/sdk/metric/processor/reducer/reducer.go @@ -17,7 +17,7 @@ package reducer // import "go.opentelemetry.io/otel/sdk/metric/processor/reducer import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/metric/sdkapi" - export "go.opentelemetry.io/otel/sdk/export/metric" + "go.opentelemetry.io/otel/sdk/metric/export" ) type ( diff --git a/sdk/metric/processor/reducer/reducer_test.go b/sdk/metric/processor/reducer/reducer_test.go index bac96ae2b6cb..3da65d313ef3 100644 --- a/sdk/metric/processor/reducer/reducer_test.go +++ b/sdk/metric/processor/reducer/reducer_test.go @@ -23,9 +23,9 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/metric" "go.opentelemetry.io/otel/metric/sdkapi" - "go.opentelemetry.io/otel/sdk/export/metric/aggregation" "go.opentelemetry.io/otel/sdk/instrumentation" metricsdk "go.opentelemetry.io/otel/sdk/metric" + "go.opentelemetry.io/otel/sdk/metric/export/aggregation" "go.opentelemetry.io/otel/sdk/metric/processor/basic" "go.opentelemetry.io/otel/sdk/metric/processor/processortest" processorTest "go.opentelemetry.io/otel/sdk/metric/processor/processortest" diff --git a/sdk/metric/sdk.go b/sdk/metric/sdk.go index 60f0f7989448..8c0438db298f 100644 --- a/sdk/metric/sdk.go +++ b/sdk/metric/sdk.go @@ -26,8 +26,8 @@ import ( internal "go.opentelemetry.io/otel/internal/metric" "go.opentelemetry.io/otel/metric/number" "go.opentelemetry.io/otel/metric/sdkapi" - export "go.opentelemetry.io/otel/sdk/export/metric" "go.opentelemetry.io/otel/sdk/metric/aggregator" + "go.opentelemetry.io/otel/sdk/metric/export" ) type ( diff --git a/sdk/metric/selector/simple/simple.go b/sdk/metric/selector/simple/simple.go index 03cd9d7312b9..4fc9395bc2bf 100644 --- a/sdk/metric/selector/simple/simple.go +++ b/sdk/metric/selector/simple/simple.go @@ -16,11 +16,11 @@ package simple // import "go.opentelemetry.io/otel/sdk/metric/selector/simple" import ( "go.opentelemetry.io/otel/metric/sdkapi" - export "go.opentelemetry.io/otel/sdk/export/metric" "go.opentelemetry.io/otel/sdk/metric/aggregator/histogram" "go.opentelemetry.io/otel/sdk/metric/aggregator/lastvalue" "go.opentelemetry.io/otel/sdk/metric/aggregator/minmaxsumcount" "go.opentelemetry.io/otel/sdk/metric/aggregator/sum" + "go.opentelemetry.io/otel/sdk/metric/export" ) type ( diff --git a/sdk/metric/selector/simple/simple_test.go b/sdk/metric/selector/simple/simple_test.go index 4f3746bb0075..0640f7d51701 100644 --- a/sdk/metric/selector/simple/simple_test.go +++ b/sdk/metric/selector/simple/simple_test.go @@ -22,11 +22,11 @@ import ( "go.opentelemetry.io/otel/metric/metrictest" "go.opentelemetry.io/otel/metric/number" "go.opentelemetry.io/otel/metric/sdkapi" - export "go.opentelemetry.io/otel/sdk/export/metric" "go.opentelemetry.io/otel/sdk/metric/aggregator/histogram" "go.opentelemetry.io/otel/sdk/metric/aggregator/lastvalue" "go.opentelemetry.io/otel/sdk/metric/aggregator/minmaxsumcount" "go.opentelemetry.io/otel/sdk/metric/aggregator/sum" + "go.opentelemetry.io/otel/sdk/metric/export" "go.opentelemetry.io/otel/sdk/metric/selector/simple" ) diff --git a/sdk/metric/stress_test.go b/sdk/metric/stress_test.go index 229b9fe7c209..f6b9eb4ba025 100644 --- a/sdk/metric/stress_test.go +++ b/sdk/metric/stress_test.go @@ -36,8 +36,8 @@ import ( "go.opentelemetry.io/otel/metric" "go.opentelemetry.io/otel/metric/number" "go.opentelemetry.io/otel/metric/sdkapi" - export "go.opentelemetry.io/otel/sdk/export/metric" - "go.opentelemetry.io/otel/sdk/export/metric/aggregation" + "go.opentelemetry.io/otel/sdk/metric/export" + "go.opentelemetry.io/otel/sdk/metric/export/aggregation" "go.opentelemetry.io/otel/sdk/metric/processor/processortest" ) diff --git a/trace/go.mod b/trace/go.mod index 8c0010075024..501599256341 100644 --- a/trace/go.mod +++ b/trace/go.mod @@ -34,8 +34,6 @@ replace go.opentelemetry.io/otel/metric => ../metric replace go.opentelemetry.io/otel/sdk => ../sdk -replace go.opentelemetry.io/otel/sdk/export/metric => ../sdk/export/metric - replace go.opentelemetry.io/otel/sdk/metric => ../sdk/metric replace go.opentelemetry.io/otel/trace => ./