Skip to content

Commit

Permalink
Adapt interface changes for opentelemetry v1.4 upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcel Ludwig committed Mar 15, 2022
1 parent 2648f3c commit 8ee4f4f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions telemetry/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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),
Expand All @@ -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)

Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 8ee4f4f

Please sign in to comment.