Skip to content

Commit

Permalink
fix: add back gzip support for grpc otlp endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
kruskall committed Aug 20, 2023
1 parent 0bcd6f0 commit 7eb0713
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions internal/beater/beater.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import (
"golang.org/x/sync/errgroup"
"golang.org/x/sync/semaphore"
"google.golang.org/grpc"
_ "google.golang.org/grpc/encoding/gzip"

"github.com/elastic/beats/v7/libbeat/beat"
"github.com/elastic/beats/v7/libbeat/esleg/eslegclient"
Expand Down
4 changes: 2 additions & 2 deletions systemtest/otlp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ func TestOTLPGRPCMetrics(t *testing.T) {

// opentelemetry-go does not support sending Summary metrics,
// so we send them using the lower level OTLP/gRPC client.
conn, err := grpc.Dial(serverAddr(srv), grpc.WithInsecure(), grpc.WithBlock())
conn, err := grpc.Dial(serverAddr(srv), grpc.WithInsecure(), grpc.WithBlock(), grpc.WithDefaultCallOptions(grpc.UseCompressor("gzip")))
require.NoError(t, err)
defer conn.Close()
metricsClient := pmetricotlp.NewGRPCClient(conn)
Expand Down Expand Up @@ -238,7 +238,7 @@ func TestOTLPGRPCLogs(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()

conn, err := grpc.Dial(serverAddr(srv), grpc.WithInsecure(), grpc.WithBlock())
conn, err := grpc.Dial(serverAddr(srv), grpc.WithInsecure(), grpc.WithBlock(), grpc.WithDefaultCallOptions(grpc.UseCompressor("gzip")))
require.NoError(t, err)
defer conn.Close()

Expand Down

0 comments on commit 7eb0713

Please sign in to comment.