Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore][cmd/telemetrygen] Fix deprecated method usage #32300

Merged
merged 2 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cmd/telemetrygen/internal/logs/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type exporter interface {
export(plog.Logs) error
}

func newExporter(ctx context.Context, cfg *Config) (exporter, error) {
func newExporter(cfg *Config) (exporter, error) {

// Exporter with HTTP
if cfg.UseHTTP {
Expand All @@ -46,7 +46,7 @@ func newExporter(ctx context.Context, cfg *Config) (exporter, error) {
var err error
var clientConn *grpc.ClientConn
if cfg.Insecure {
clientConn, err = grpc.DialContext(ctx, cfg.Endpoint(), grpc.WithTransportCredentials(insecure.NewCredentials()))
clientConn, err = grpc.NewClient(cfg.Endpoint(), grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
return nil, err
}
Expand All @@ -55,7 +55,7 @@ func newExporter(ctx context.Context, cfg *Config) (exporter, error) {
if err != nil {
return nil, fmt.Errorf("failed to get TLS credentials: %w", err)
}
clientConn, err = grpc.DialContext(ctx, cfg.Endpoint(), grpc.WithTransportCredentials(creds))
clientConn, err = grpc.NewClient(cfg.Endpoint(), grpc.WithTransportCredentials(creds))
if err != nil {
return nil, err
}
Expand Down
3 changes: 1 addition & 2 deletions cmd/telemetrygen/internal/logs/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
package logs

import (
"context"
"fmt"
"sync"
"sync/atomic"
Expand All @@ -26,7 +25,7 @@ func Start(cfg *Config) error {
return err
}

e, err := newExporter(context.Background(), cfg)
e, err := newExporter(cfg)
if err != nil {
return err
}
Expand Down
Loading