From 8ee4f4f5a5ae3d0cf0f3a031f8a8e6895be2490c Mon Sep 17 00:00:00 2001 From: Marcel Ludwig Date: Tue, 15 Mar 2022 14:12:29 +0100 Subject: [PATCH] Adapt interface changes for opentelemetry v1.4 upgrade --- telemetry/exporter.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/telemetry/exporter.go b/telemetry/exporter.go index d698e2e96..2a7efd676 100644 --- a/telemetry/exporter.go +++ b/telemetry/exporter.go @@ -17,8 +17,8 @@ import ( "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc" "go.opentelemetry.io/otel/exporters/prometheus" "go.opentelemetry.io/otel/propagation" - export "go.opentelemetry.io/otel/sdk/export/metric" 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" selector "go.opentelemetry.io/otel/sdk/metric/selector/simple" @@ -165,8 +165,8 @@ func initMetricExporter(ctx context.Context, opts *Options, log *logrus.Entry, w } pusher := controller.New( - processor.New( - simple.NewWithExactDistribution(), + processor.NewFactory( + simple.NewWithInexpensiveDistribution(), metricExp, ), controller.WithExporter(metricExp), @@ -176,7 +176,7 @@ func initMetricExporter(ctx context.Context, opts *Options, log *logrus.Entry, w return err } - provider.SetMeterProvider(pusher.MeterProvider()) + provider.SetMeterProvider(pusher) go pushOnShutdown(ctx, pusher.Stop) @@ -206,9 +206,9 @@ func newPromExporter(opts *Options) (*prometheus.Exporter, error) { ))) ctlr := controller.New( - processor.New( + processor.NewFactory( selector.NewWithHistogramDistribution(), - export.CumulativeExportKindSelector(), + aggregation.CumulativeTemporalitySelector(), processor.WithMemory(true), ), controller.WithResource(resource.NewWithAttributes(