Skip to content

Reduce metrics sent to Datadog from the UI fedev-3993#2638

Open
timgmxio wants to merge 1 commit into
releasefrom
datadog-log-volume-optimization
Open

Reduce metrics sent to Datadog from the UI fedev-3993#2638
timgmxio wants to merge 1 commit into
releasefrom
datadog-log-volume-optimization

Conversation

@timgmxio

Copy link
Copy Markdown
Contributor

Datadog log volume optimization

Identical infra-event storms (broken RPC × every open tab × fleet) dominate our Datadog log volume. This PR cuts the noise without losing signal.

Changes

  • Coalesce storm events (multicall.timeout, multicall.error, worker.multicall.error, rpcTracker.endpoint.updated, error): first occurrence is sent as-is, identical repeats within a 60s window are folded into one summary event with repeatCount / firstSuppressedAt / lastSuppressedAt. Hidden tabs (the main storm source) hold even the first event until the tab becomes visible or unloads.
  • Drop non-actionable errors: AbortError, "user aborted a request", "operation was aborted", Firefox "dead object", and transport blips in the Gelato gas-tank poll.
  • Stop double-reporting RPC timeouts: a timeout already reports itself (multicall.timeout + timeout counter), it is no longer also reported as multicall.error + error counter.
  • Bucket callsCountcallsCountBucket ("1-10" … "500+") in multicall.batched.* to cap server-side metric-key cardinality.
  • Distinguishable timeout aborts: SDK HttpClient and createTimeoutSignal now abort with HttpTimeoutError / TimeoutError instead of a plain AbortError, so the new abort filter can't swallow real backend timeouts.
  • Add account (connected wallet) to global metric fields — lets support match a user's report to their event timeline.
  • Fix: multicall.request.error counter now sends requestType: "retry" for fallback requests (was hardcoded "initial").
  • Tests: Metrics.spec.ts covering coalescing and the ignored-error filter.

⚠️ Breaking for Datadog dashboards / monitors

  • callsCount field is gone → use callsCountBucket (string). Facets/filters on callsCount will be empty.
  • multicall.request.error counter: timeouts are no longer counted (use multicall.request.timeout); requestType:"retry" appears for the first time.
  • multicall.error event count drops — RPC timeouts are no longer duplicated into it.
  • Coalesced events: true frequency = count + sum(repeatCount), not count. Summaries arrive up to 60s late (from hidden tabs — only when the tab returns to visibility).
  • error event baseline drops — aborts/browser noise and Gelato transport blips are filtered out.
  • Timeout errors renamed: AbortError ("The user aborted a request") → HttpTimeoutError / TimeoutError. Saved searches on the old messages won't match.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying gmx-interface-home with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9260eda
Status: ✅  Deploy successful!
Preview URL: https://cc169f68.gmx-interface-home.pages.dev
Branch Preview URL: https://datadog-log-volume-optimizat.gmx-interface-home.pages.dev

View logs

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying gmx-interface with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9260eda
Status: ✅  Deploy successful!
Preview URL: https://4282f310.gmx-interface.pages.dev
Branch Preview URL: https://datadog-log-volume-optimizat.gmx-interface.pages.dev

View logs

@github-actions

Copy link
Copy Markdown

Playwright Component Test Report

All tests passed.

View Report

Commit 9260eda

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.

1 participant