Repository navigation
Log preload outcomes and PageSpeed failure reasons - #255
Merged
Merged
Conversation
A Grafana alert should fire only when a site keeps failing, not on a single failed preload. That needs successes in the logs too, so each fulfilled preload now logs "preload ok: <strategy> <url>". Failures logged only "Failed to fetch data", with PageSpeed's actual reason in a separate multi-line dump. The thrown error now carries PageSpeed's error.message (e.g. FAILED_DOCUMENT_REQUEST ... ERR_TIMED_OUT), so the "preload failed" line says why on its own. Claude-Session: https://claude.ai/code/session_0113RYCb5vdxZQeeQvq5q4Cd
|
🧹 Preview environment for this PR has been torn down. |
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
The success logs let Grafana distinguish repeated failures from occasional failures. A review found that database write errors were previously swallowed, which could produce a false success log. Those errors now reach the preload job.
Evidence
preload okand count towardpreloaded.After: The insert rejects, so the job logs
preload failedand excludes it frompreloaded.bun run lintpassed.bunx tsc --noEmitpassed.git diff --checkpassed.Merge Danger
Door: Two-way
Blast Radius: Preload and live PageSpeed requests
A database write failure now fails the request instead of returning an unsaved result.