Skip to content

Commit

Permalink
[8.9] fix: add back gzip support for grpc otlp endpoint (backport #11434
Browse files Browse the repository at this point in the history
) (#11435)

* fix: add back gzip support for grpc otlp endpoint (#11434)

* fix: add back gzip support for grpc otlp endpoint

* changelog: add changelog entry

(cherry picked from commit cfce80b)

# Conflicts:
#	changelogs/head.asciidoc

* changelog: delete head changelog

---------

Co-authored-by: kruskall <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
mergify[bot] and kruskall authored Aug 22, 2023
1 parent 4990ac2 commit 50fcc8a
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 @@ -36,6 +36,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 @@ -209,7 +209,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.NewClient(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 50fcc8a

Please sign in to comment.