From fe6e8f233789e0e69ce3f229ae72b3f207e1e8fd Mon Sep 17 00:00:00 2001 From: Christos Kalkanis Date: Thu, 26 Jun 2025 19:14:15 -0400 Subject: [PATCH] Enable gzip compression for Export RPC (otlp_reporter) --- reporter/otlp_reporter.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/reporter/otlp_reporter.go b/reporter/otlp_reporter.go index 774cfb6ef..c7079c9f0 100644 --- a/reporter/otlp_reporter.go +++ b/reporter/otlp_reporter.go @@ -14,6 +14,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials/insecure" + "google.golang.org/grpc/encoding/gzip" "go.opentelemetry.io/ebpf-profiler/libpf" "go.opentelemetry.io/ebpf-profiler/libpf/xsync" @@ -24,6 +25,8 @@ import ( // Assert that we implement the full Reporter interface. var _ Reporter = (*OTLPReporter)(nil) +var gzipOption = grpc.UseCompressor(gzip.Name) + // OTLPReporter receives and transforms information to be OTLP/profiles compliant. type OTLPReporter struct { *baseReporter @@ -149,7 +152,7 @@ func (r *OTLPReporter) reportOTLPProfile(ctx context.Context) error { reqCtx, ctxCancel := context.WithTimeout(ctx, r.pkgGRPCOperationTimeout) defer ctxCancel() - _, err = r.client.Export(reqCtx, req) + _, err = r.client.Export(reqCtx, req, gzipOption) return err }