File tree 2 files changed +18
-0
lines changed
receiver/prometheusreceiver
2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ require (
27
27
go.opentelemetry.io/collector/semconv v0.96.1-0.20240306115632-b2693620eff6
28
28
go.opentelemetry.io/otel/metric v1.24.0
29
29
go.opentelemetry.io/otel/trace v1.24.0
30
+ go.uber.org/goleak v1.3.0
30
31
go.uber.org/zap v1.27.0
31
32
google.golang.org/protobuf v1.33.0
32
33
gopkg.in/yaml.v2 v2.4.0
Original file line number Diff line number Diff line change
1
+ // Copyright The OpenTelemetry Authors
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ package prometheusreceiver
5
+
6
+ import (
7
+ "testing"
8
+
9
+ "go.uber.org/goleak"
10
+ )
11
+
12
+ // The IgnoreTopFunction call prevents catching the leak generated by opencensus
13
+ // defaultWorker.Start which at this time is part of the package's init call.
14
+ // See https://github.com/census-instrumentation/opencensus-go/issues/1191 for more information.
15
+ func TestMain (m * testing.M ) {
16
+ goleak .VerifyTestMain (m , goleak .IgnoreTopFunction ("go.opencensus.io/stats/view.(*worker).start" ))
17
+ }
You can’t perform that action at this time.
0 commit comments