Skip to content

Commit

Permalink
Use NewClient instead of deprecated DialContext
Browse files Browse the repository at this point in the history
  • Loading branch information
loafoe committed Oct 21, 2024
1 parent d6482ab commit 36d1531
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.20.1-buster as builder
FROM golang:1.23.2 as builder
WORKDIR /loki-cf-logdrain
COPY go.mod .
COPY go.sum .
Expand Down
3 changes: 1 addition & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,9 @@ func initProvider() (func(context.Context) error, error) {

ctx, cancel := context.WithTimeout(ctx, time.Second)
defer cancel()
conn, err := grpc.DialContext(ctx, os.Getenv("OTLP_ADDRESS"),
conn, err := grpc.NewClient(os.Getenv("OTLP_ADDRESS"),
// Note the use of insecure transport here. TLS is recommended in production.
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithBlock(),
)
if err != nil {
return nil, fmt.Errorf("failed to create gRPC connection to collector: %w", err)
Expand Down

0 comments on commit 36d1531

Please sign in to comment.