Skip to content

stats: add optional gzip compression to OTLP/HTTP stats sink#46246

Open
prashanthjos wants to merge 1 commit into
envoyproxy:mainfrom
prashanthjos:stats_compress
Open

stats: add optional gzip compression to OTLP/HTTP stats sink#46246
prashanthjos wants to merge 1 commit into
envoyproxy:mainfrom
prashanthjos:stats_compress

Conversation

@prashanthjos

Copy link
Copy Markdown
Contributor

Adds a field (NONE default, GZIP) to the OpenTelemetry sink that gzip-compresses
the OTLP/HTTP export body and sets (~14x smaller payloads). Defaults to
NONE for backward compatibility; HTTP path only. Includes unit tests for both paths.

Commit Message: stats: add optional gzip compression to OTLP/HTTP stats sink
Additional Description: Adds a compression enum field (NONE default, GZIP) to the OpenTelemetry stat sink's SinkConfig. When set to GZIP on the http_service (OTLP/HTTP) export path, the serialized ExportMetricsServiceRequest payload is gzip-compressed and Content-Encoding: gzip is set on the outbound request, reducing export bandwidth (~14x smaller on a representative 500-metric batch: 98,178 -> 6,800 bytes). Reuses the existing gzip compressor extension rather than hand-rolling zlib. Only honored for the HTTP path; the gRPC path continues to configure compression via the GrpcService. The OTLP/HTTP collector must support gzip decoding, per the OTLP/HTTP specification.
Risk Level: Low
Testing: Unit tests added covering the uncompressed path (no Content-Encoding, raw body) and the gzip path (Content-Encoding: gzip, gzip magic bytes, round-trip decompresses to the original proto). Existing sink tests pass.
Docs Changes: Proto field documentation (SinkConfig.compression + Compression enum).
Release Notes: Added a changelog fragment under changelogs/current/new_features/.
Platform Specific Features: None
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]

  Adds a  field (NONE default, GZIP) to the OpenTelemetry sink that gzip-compresses
  the OTLP/HTTP export body and sets  (~14x smaller payloads). Defaults to
  NONE for backward compatibility; HTTP path only. Includes unit tests for both paths.

Signed-off-by: Prashanth Josyula <prashanth.16@gmail.com>
@repokitteh-read-only

Copy link
Copy Markdown

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @markdroth
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).

🐱

Caused by: #46246 was opened by prashanthjos.

see: more, trace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants