Repository navigation
Avoid duplicate PageSpeed API error logs - #256
Merged
Merged
Conversation
A failed Google PageSpeed response was printed as multi-line JSON and then logged again by the preload caller. Grafana counted several lines from one failed request as separate app errors. Keep the parsed error reason and the caller log, and drop the raw response dump.
|
🧹 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
if (!res.ok) { const body = await res.text(); - console.error("res data", body); // Parse PageSpeed's reason and throw it to the caller. }Keep the per-page preload failure line, which includes strategy, URL, and the parsed PageSpeed reason. Remove the raw multi-line API response that Grafana counted as several errors for one request.
Evidence
"error"and"message"lines from one Google API response, pluspreload failedlines for the same request.bun run lintandbunx tsc --noEmitpass. API failures still throw the parsed reason to the caller.Merge Danger
Door: Two-way. Revert the single line to restore raw response logging.
Blast Radius: PageSpeed diagnostics only. Request and retry behavior are unchanged.