fix(vercel): log drains_unavailable provisioning failures at WARN not ERROR #SUPERLOG - #449
Open
superlog-app[bot] wants to merge 1 commit into
Open
fix(vercel): log drains_unavailable provisioning failures at WARN not ERROR #SUPERLOG#449superlog-app[bot] wants to merge 1 commit into
superlog-app[bot] wants to merge 1 commit into
Conversation
… ERROR #SUPERLOG Delivery-Id: 1e749afb902bf4ce7bf34e9359095ed0c49805fe806bf56d6c011acf0d793be9 Delivery-Base: main
| // drains_unavailable is a known Vercel plan restriction — per-signal WARN | ||
| // logs already capture the API message; escalating to ERROR creates | ||
| // incidents for a condition operators cannot act on. | ||
| if (outcome === "drains_unavailable") { |
Contributor
Author
There was a problem hiding this comment.
logs · blocking — Use log.info, not log.warn, for the drains_unavailable branch
Replace log.warn with log.info: drains_unavailable is expected control flow (a Vercel plan gate the operator cannot act on), and the rubric reserves warn for nothing — info is the correct level for expected, non-actionable outcomes. Using warn still risks alert rules that key on severity ≥ warn, defeating the purpose of this fix.
Suggested change
| if (outcome === "drains_unavailable") { | |
| log.info({ err: e, project_id: decoded.projectId }, "vercel provisioning failed"); |
Useful? React with 👍 / 👎.
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
Every user whose Vercel team plan doesn't include drains (Vercel's log/OTLP drain feature is a paid-plan gate) triggers a production incident via a
log.errorcall in the OAuth callback handler. The provisioning correctly detects and handles this asdrains_unavailable— rolling back the configuration, redirecting the user to a clear error page — but then logs at ERROR, which fires Superlog incidents that operators cannot act on.Root Cause
In
apps/api/src/vercel.ts, the provisioningcatchblock calledlog.errorunconditionally before computing the outcome:When Vercel rejects both
POST /v1/drainscalls with403 "Drains are not available for team '...'",classifyDrainProvisioningFailurecorrectly producesoutcome: "drains_unavailable". The per-signal WARN logs already record the Vercel API message. But the catch block's unconditionallog.errorthen fires on top of them, creating the incident.Telemetry confirmed 7 occurrences across 4 distinct Vercel teams since 2026-07-03, every one carrying
outcome: "drains_unavailable"; nooutcome: "error"events have ever been observed in production.Remediation
This PR computes the outcome before logging and downgrades to
log.warnwhen the outcome isdrains_unavailable(an expected external API condition), while preservinglog.errorfor unexpected failures.All 19 Vercel-service unit tests pass. The 75 pre-existing test failures in the repo are unrelated to this change (confirmed by baseline before/after comparison).
Related incident: frosted-quokka (0582f35d-b982-4506-ab89-7501409d9fda)
Was this PR helpful? Leave feedback — goes straight to the Superlog team.
Summary by cubic
Downgrade logging of Vercel
drains_unavailableprovisioning failures from ERROR to WARN to prevent false Superlog incidents, while keeping unexpected failures as errors.warnfordrains_unavailable; keeperrorfor other outcomes.Written for commit a3da0b8. Summary will update on new commits.