You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
👋 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.
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.
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, andworkspaceId.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 newdelivery_compressed_payload_size_byteshistogram, 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
fireDeliveryPayloadSizeStatsfunction and call, and the existingdelivery_payload_size_bytesdeclaration, remain unchanged. The new metrics are emitted only by GZIP proxy deliveries; directprepareProxyRequestcalls used by/proxyTestemit 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.gaugeandstats.histogrammethods 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
npm run lint,npm run build:ci, and PR diff check: passed.Developer checklist
Reviewer checklist