Skip to content

Commit

Permalink
cancel otel controller context (#26)
Browse files Browse the repository at this point in the history
Signed-off-by: Benedikt Bongartz <[email protected]>
  • Loading branch information
frzifus authored Jul 31, 2022
1 parent ee3973c commit 4755ac2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/opentelemetry/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ func NewController() (*Controller, error) {
}

log.Logger.V(0).Info("Establishing connection to OpenTelemetry collector ...")
timeoutContext, _ := context.WithTimeout(ctx, time.Second*10)
timeoutContext, cancel := context.WithTimeout(ctx, time.Second*10)
defer cancel()
conn, err := grpc.DialContext(timeoutContext, endpoint, grpc.WithInsecure(), grpc.WithBlock())
if err != nil {
log.Logger.Error(err, "unable to connect to OpenTelemetry collector", "addr", endpoint)
Expand Down

0 comments on commit 4755ac2

Please sign in to comment.