[miniflare] Hide favicon and DevTools noise from dev logs and Observability - #14956
[miniflare] Hide favicon and DevTools noise from dev logs and Observability#14956nickpatt wants to merge 8 commits into
Conversation
…bility Stop logging the requests browsers make on their own (/favicon.ico and the Chrome DevTools probe) in dev, and apply the same filtering in the Local Explorer's Observability views. Vite's internal module-runner plumbing is now hidden by default there too, instead of behind a toggle.
🦋 Changeset detectedLatest commit: 721b162 The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Codeowners approval required for this PR:
Show detailed file reviewers
|
@cloudflare/autoconfig
@cloudflare/build-output-utils
@cloudflare/config
create-cloudflare
@cloudflare/deploy-helpers
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-functions
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-auth
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
…ter in SQL The executeCallback shape rule was applied unconditionally, so a plain `wrangler dev` user with their own RPC method of that name would have had their logs silently dropped. It now only applies to traces that also contain a Vite wrapper span, matching the safety rule in stripDevRunnerSpans. Both predicates moved into the SQL WHERE clause so LIMIT counts only rows the user will see, instead of filtering a full page down to far fewer rows.
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
|
||
| `wrangler dev` and the Vite plugin no longer log requests the browser makes on its own — `/favicon.ico` and Chrome DevTools' `/.well-known/appspecific/com.chrome.devtools.json` probe — so the request log reflects your app's traffic. | ||
|
|
||
| The Local Explorer's Observability views apply the same filtering: favicon and DevTools-probe traces/logs are always hidden, and Vite's internal module-runner plumbing (its router/asset wrapper workers and RPC dispatch) is hidden by default rather than behind a toggle. Set `VITE_LOCAL_EXPLORER_SHOW_VITE_INTERNALS=true` when building the UI to reveal it for debugging. |
There was a problem hiding this comment.
🟡 Changelog entry tells users to rebuild an internal UI, which they cannot do
The changelog entry instructs readers to set a build-time UI variable (VITE_LOCAL_EXPLORER_SHOW_VITE_INTERNALS=true at .changeset/hide-internal-dev-noise.md:10) even though the Local Explorer UI ships prebuilt inside miniflare, so the advice only applies to repository maintainers, not the tool's users.
Impact: Released changelog contains an instruction that end users cannot act on.
Repository changeset rule
REVIEW.md states: "Changesets should target users of the tools (e.g. Wrangler users) rather than maintainers. Avoid including implementation details." The escape hatch is a Vite build-time env var read at packages/local-explorer-ui/src/utils/observability.ts:179-180; the UI is built and bundled during release, so a Wrangler/miniflare consumer has no way to rebuild it with that flag.
Prompt for agents
The changeset's last sentence documents a maintainer-only build-time escape hatch (VITE_LOCAL_EXPLORER_SHOW_VITE_INTERNALS) that users of wrangler/miniflare cannot use, since the Local Explorer UI is shipped prebuilt. REVIEW.md requires changesets to target users of the tools rather than maintainers. Reword the changeset to describe only the user-facing effect (favicon/DevTools noise and Vite internals are hidden from dev logs and the Observability views) and drop the build-flag instruction.
Was this helpful? React with 👍 or 👎 to provide feedback.
| // Requests the browser makes on its own (favicon, Chrome DevTools probe), not | ||
| // the developer. Kept out of the request log to cut noise. | ||
| const LOG_NOISE_PATHS = new Set([ | ||
| "/favicon.ico", | ||
| "/.well-known/appspecific/com.chrome.devtools.json", | ||
| ]); |
There was a problem hiding this comment.
🟡 The same list of browser-noise request paths is now hardcoded in two packages
The favicon and Chrome DevTools probe paths are duplicated as a new constant (LOG_NOISE_PATHS at packages/miniflare/src/workers/core/entry.worker.ts:400-403) instead of being shared with the identical list used by the Observability views, so the two copies can silently drift apart.
Impact: A future change to one list will filter noise in the request log but not in the Observability views (or vice versa).
Where the duplicate lives and the repo rule
AGENTS.md lists "Duplicating types/constants across packages → export from the owning package and import where needed" as an explicit anti-pattern. The same two paths are declared as HIDDEN_NOISE_PATHS in packages/local-explorer-ui/src/utils/observability.ts:357-360, and both copies are meant to describe the same set of browser-generated requests.
Prompt for agents
The list of browser-generated "noise" request paths (/favicon.ico and /.well-known/appspecific/com.chrome.devtools.json) now exists twice: LOG_NOISE_PATHS in packages/miniflare/src/workers/core/entry.worker.ts and HIDDEN_NOISE_PATHS in packages/local-explorer-ui/src/utils/observability.ts. AGENTS.md forbids duplicating constants across packages. Consider defining the list once in a module both can import (e.g. a shared constants file in miniflare that the local-explorer UI can import, similar to how other shared markers are handled) so the two filters cannot drift.
Was this helpful? React with 👍 or 👎 to provide feedback.
…oot request The trailing-wildcard LIKE matched any URL ending in the path, so an app's own /static/favicon.ico and remote CDN favicons were treated as browser noise, and it disagreed with miniflare's exact url.pathname rule. Extract and compare the path instead. The logs view tested whichever span emitted the log, so a user's outbound fetch to a CDN favicon would have lost its logs. It now tests the trace's root span, so noise is judged on the incoming request.
… list A vite dev session's trace list was almost entirely plumbing: the module runner's __vite_plugin_cloudflare_init__ and _get_export_types__ requests accounted for 8 of 11 traces. They're matched by request path rather than by the wrapper-service marker, because Vite routes every request through its router worker — marker-matching a root span would have hidden the user's real traffic too. Also corrects the changeset, which advertised a build-time flag that only applies to maintainers (the UI ships prebuilt) and credited the Vite plugin with a request-log change it doesn't get (vite dev runs with logRequests off), and cross-references the noise-path list that miniflare and the UI each need their own copy of.
Dev output is noisy with requests you never made and internals you don't own. This trims that down in three places:
wrangler devno longer logs the requests a browser fires on its own:/favicon.icoand Chrome DevTools'/.well-known/appspecific/com.chrome.devtools.jsonprobe. (Vite dev runs miniflare with request logging off, so this is awrangler devchange only.)__vite_plugin_cloudflare_init__/_get_export_types__). In a real Vite session those accounted for 8 of 11 rows in the list.[vite] hot updatedHMR log), which is now hidden by default instead of sitting behind a UI toggle.Notes on the filtering rules
Getting this right matters more than getting it aggressive — hiding a user's real request or log line is far worse than leaving some noise on screen. So:
url.pathnamecheck. A suffix match would also have caught an app's own/static/favicon.icoand remote CDN favicons./favicon.icodoesn't lose its logs.executeCallbackshape rule only applies inside a confirmed Vite trace (one that also contains a wrapper span), mirroring the existing safety rule instripDevRunnerSpans— awrangler devuser may legitimately have their own RPC method by that name.WHEREclause, soLIMITcounts only rows that will actually be shown.Verified against real capture stores from both a
vite devand awrangler devsession: the Vite trace list drops 11 → 3 (exactly the three real requests), and thewrangler devlist is unaffected by the Vite rules.