Skip to content

feat(proxy): add gzip delivery compression metrics - #5783

Merged
achettyiitr merged 6 commits into
developfrom
harness/INT-6923-feat-proxy-add-gzip-delivery-co-881a15ec
Nov 16, 2026
Merged

achettyiitr merged 6 commits into
developfrom
harness/INT-6923-feat-proxy-add-gzip-delivery-co-881a15ec

Conversation

@rudder-devbox

@rudder-devbox rudder-devbox Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

What are the changes introduced in this PR?

Add three GZIP proxy-delivery metrics: compressed wire bytes, compression duration, and an unlabeled per-process in-flight gauge. The wire-size and duration histograms use destType, endpointPath, and workspaceId.

What is the related Linear task?

Resolves INT-6923

Please explain the objectives of your changes below

Measure GZIP wire size and compression pressure per workspace. Aggregate compression ratio and net byte savings can be calculated from the existing delivery_payload_size_bytes{compressed="true"} histogram and the new delivery_compressed_payload_size_bytes histogram, grouped by their shared labels. This includes small bodies that expand under GZIP.

Any changes to existing capabilities/behaviour, mention the reason & what are the changes?

Delivery behavior is unchanged. The Phase 0 fireDeliveryPayloadSizeStats function and call, and the existing delivery_payload_size_bytes declaration, remain unchanged. The new metrics are emitted only by GZIP proxy deliveries; direct prepareProxyRequest calls used by /proxyTest emit none. Proxy delivery still disables the transformer's outgoing-request metrics; delivery latency and vendor status remain available from rudder-server.

Any new dependencies introduced with this change?

None.

Any new generic utility introduced or modified? Please explain the changes.

None. The existing stats.gauge and stats.histogram methods publish these metrics.

Any technical or performance related pointers to consider with the change?

Duration is measured around GZIP request preparation, including failed preparation. The in-flight count is incremented before preparation and decremented in finally. The new histograms have explicit labels and buckets; compressed wire bytes use the same bucket values as the existing size histogram.

Validation

  • Network and Prometheus focused suites: 56 tests passed.
  • Amplitude and Mixpanel destination unit suites: 112 tests passed.
  • Amplitude component suite: 112 tests passed; Mixpanel component suite: 81 tests passed.
  • npm run lint, npm run build:ci, and PR diff check: passed.

Developer checklist

  • My code follows the style guidelines of this project
  • No breaking changes are being introduced.
  • All related docs linked with the PR?
  • All changes manually tested?
  • Any documentation changes needed with this change? No.
  • Is the PR limited to 10 file changes?
  • Is the PR limited to one linear task?
  • Are relevant unit and component test-cases added in new readability format?

Reviewer checklist

  • Is the type of change in the PR title appropriate as per the changes?
  • Verified that there are no credentials or confidential data exposed with the changes.

@rudder-devbox

rudder-devbox Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

👋 I'm rudder-devbox. I opened this PR from task INT-6923.

Mention @devbox or @rudder-devbox and I'll act on it — on a top-level PR comment,
in a review summary, or on an inline comment on the diff. Without a mention I won't see it.

@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5a20be75-0dbf-4673-a5ee-ddf336afc175

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@rudder-devbox

rudder-devbox Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

The Code Coverage log showed two MetricsAggregator failures at metricsAggregator.js:107: TypeError: this.prometheusInstance.resetMetrics is not a function. The tests had mocked resetMetrics on the nested registry, but the production method is on its Prometheus wrapper; that also prevented one error response and caused a timeout. I corrected the mocks and added assertions for the reset and error-response paths. The focused suite (18 tests) and full JavaScript coverage suite (101 suites, 2,081 tests) pass. The local TypeScript coverage run reported 137 passing suites but did not finish.

bd3e82e

@rudder-devbox

rudder-devbox Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

Knowledge distillation completed

@rudder-devbox

rudder-devbox Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

Both arm64 image jobs failed in the JavaScript test step, not the Docker build: test/__tests__/metricsAggregator.test.js reports two failures with TypeError: this.prometheusInstance.resetMetrics is not a function. The tests mocked resetMetrics on the nested registry instead of the Prometheus wrapper. I already corrected those mocks and pushed the fix; the full JavaScript coverage suite then passed (101 suites, 2,081 tests). No additional change was needed for these jobs.

bd3e82e

@achettyiitr
achettyiitr marked this pull request as ready for review November 16, 2026 10:06
@achettyiitr
achettyiitr requested review from a team as code owners November 16, 2026 10:06
@sonarqubecloud

Copy link
Copy Markdown

@achettyiitr
achettyiitr merged commit da43065 into develop Nov 16, 2026
48 checks passed
@achettyiitr
achettyiitr deleted the harness/INT-6923-feat-proxy-add-gzip-delivery-co-881a15ec branch November 16, 2026 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants