Repository navigation
feat: make captured traffic and monitoring signals trustworthy - #24
Merged
Merged
Conversation
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.
Netkit's first UX-roadmap deliverable makes captured traffic safe to inspect and its signals meaningful enough to support monitoring. Previously, history could retain credentials, a failed refresh could look like an empty capture, HTTP status was hidden behind a generic Error label, and
/metricsreturned a constant request count of zero.This change sanitizes records before retention, separates transfer outcome from upstream/proxy status, defines timing and capture scope, and exports process-lifetime counters and histograms that survive history eviction and clearing. Dashboard fetch failures preserve the last good results with a stale-data warning. Drafts are tab-local and legacy persisted drafts are discarded without hydration.
Included
--redact-fields, URL credential/query masking, bounded inspection capture, and explicit omission for opaque, incomplete or >64 KiB bodies. Forwarded traffic is unchanged.Validation
go test -race -tags=unit ./...go test -count=1 -race -tags=e2e ./test/e2e(fresh race-enabled binary built for each suite; Makefile disables result caching)golangci-lint runnpm run test:unit(6 tests),npx tsc --noEmit,npx eslint src,npm run buildCompatibility and limits
Captured non-JSON/partial/oversized bodies are now omitted; structured JSON is normalized and sensitive fields masked. The field/pattern policy is not a general secret detector: custom credentials need explicit fields/policy changes. No raw-capture reveal/export is provided. Original network forwarding is unchanged.
The constant
netkit_proxy_statusmetric is removed; use the scraper'supsignal for reachability. Existingsuccessmeans transfer completion, including HTTP errors, and the legacyproxy_overhead_usfield is explicitly described as other elapsed time (including body transfer), not CPU overhead. CONNECT measures establishment only; pre-inner-request inspection handshake failures are not individual exchange records. Metrics reset on process restart and do not yet provide host/route dimensions or alert rules.Policy and API semantics are documented in
docs/trustworthy-capture.md. This PR does not deploy or change the live instance.