Count all observed network failures by bounded error code - #395
Open
hiroTamada wants to merge 1 commit into
Open
hiroTamada wants to merge 1 commit into
hiroTamada wants to merge 1 commit into
Conversation
hiroTamada
marked this pull request as ready for review
September 18, 2026 13:23
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Count every accepted, deduplicated
Network.loadingFailedoutcome in the existing always-on in-memory monitor, independently of customer telemetry. Addkernel_chromium_network_failures_total{error_code,canceled}to the existing/metricscollector without another CDP connection or changes to ChromeCollector, capture domains, body/script capture, or lifecycle machinery.ERR_CONNECTION_TIMED_OUTandERR_TIMED_OUT, connection/DNS/SSL/certificate/proxy/tunnel/HTTP2/QUIC/blocked/abort errors. Missing/empty text becomesunknown; everything else becomesother. Never label with raw error text.canceledboolean separately so cancellations with missing/unrecognized text remain distinguishable. Blocked outcomes still count without adding a blockedReason dimension.Related collector change: https://github.com/kernel/infra/pull/1336. Builds on the merged always-on monitor foundation in #387, using a fresh branch from current main.
Rollout and compatibility
Apply collector label preservation first, image second. The generic
kernel_filter already passes the name, but the old collector's keep_keys would erase its dimensions. The paired collector retains only this family's bounded labels alongside metro/platform and normalizes unsupported codes. Old images have no failure family; existing metrics remain compatible during mixed-version rollout. Future taxonomy additions need coordinated image/collector updates. Per-target first-scrape baselines and existing CDP coverage/dedup limitations still apply; these are observed terminal outcomes, not lossless socket counts.No control-plane/metro-api change, HTTP-status metrics, request-type/top-level dimension, dashboard, alert, deployment, or Chromium patch is included.
Validation
With Chromium 152.0.7977.82 installed locally:
GOCACHE=/tmp/go-build KERNEL_CDPMONITOR_CHROME_E2E=1 go test -count=1 -race -v ./lib/cdpmonitor ./lib/metrics ./cmd/api/apipassed. No CDP monitor opt-in tests skipped.go test -count=1 -race -v $(go list ./... | grep -v /e2e$). 574 top-level tests passed; 62 unrelated REPL/recording tests skipped because esbuild/ffmpeg are absent. An earlier broader run reproduced the existingTestUpstreamManagerDetectsChromiumAndRestartTempDir cleanup race; unchanged, passed on rerun.GOCACHE=/tmp/go-build go vet ./...passed.net::ERR_TIMED_OUTafter Chromium's 30s SSL handshake deadline, with exactly one timeout failure. These are browser-produced failures, not injected CDP outcomes.No full Docker image, production, suspend/resume, or snapshot-fork validation was performed. Known unrelated same-process-iframe telemetry re-enable behavior is unchanged.
Note
Medium Risk
Expands the public Prometheus surface with 170 new labeled series and requires coordinated collector rollout; core request handling is unchanged but mis-timed deploy could drop label dimensions in downstream metrics.
Overview
Adds labeled failure breakdown to the always-on CDP network monitor and
/metrics, without changing telemetry capture or the existing reset/completed/up counters.Network.loadingFailedis now classified with an explicit terminal kind soloadingFinishednever increments failure buckets. Failures are bucketed by a boundederror_code(83 allowlisted Chromiumnet::ERR_*values plusunknown/other) and CDP’scanceledflag.kernel_chromium_network_failures_total{error_code,canceled}is exported with all 170 series pre-emitted at zero on first scrape; legacyERR_CONNECTION_RESETtotals still align withkernel_chromium_connection_resets_total.NetworkMetrics/NetworkSnapshotnow include a detachedFailuresmap;ApiService.NetworkMetricspasses it through tometrics.NetworkCollector. Docs call for rolling out the paired infra collector label preservation before this image so dimensions are not stripped.Reviewed by Cursor Bugbot for commit 859a089. Bugbot is set up for automated code reviews on this repo. Configure here.