:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(help-menu): silence noisy network errors from status-page poll (#62314)
posthog[bot]4db8e3fdc1b3
diff --git a/frontend/src/lib/components/HelpMenu/incidentStatusLogic.tsx b/frontend/src/lib/components/HelpMenu/incidentStatusLogic.tsxindex bc206fa385c6..a999db5a43b2 100644--- a/frontend/src/lib/components/HelpMenu/incidentStatusLogic.tsx+++ b/frontend/src/lib/components/HelpMenu/incidentStatusLogic.tsx@@ -61,6 +61,15 @@ const REFRESH_INTERVAL = 60 * 1000 * 5 // 5 minutesconst DEFAULT_STATUS: NormalizedStatus = 'operational'+// A failed `fetch` to an external host throws a `TypeError` ("Failed to fetch", "NetworkError when+// attempting to fetch resource", "Load failed", ...). These are expected and outside our control —+// ad blockers, tracking-protection extensions, DNS hiccups, brief status-page outages — so they're+// noise in error tracking rather than real defects. A genuine bug here would surface as a different+// error type (e.g. a `SyntaxError` from `response.json()`), which we still want to capture.+function isNetworkError(error: unknown): boolean {+ return error instanceof TypeError+}+let currentStatus: NormalizedStatus = DEFAULT_STATUSexport function setIncidentStatus(status: NormalizedStatus): void {@@ -171,7 +180,9 @@ export const incidentStatusLogic = kea<incidentStatusLogicType>([// The incident.io status page is external (posthogstatus.com), so the fetch can fail// for reasons outside our control: ad blockers, tracking-protection extensions, DNS// hiccups, brief status-page outages. Swallow the failure (degrading to 'operational'- // via the rawStatus selector) but still report to error tracking so we keep visibility.+ // via the rawStatus selector). We report a reachable-but-erroring status page (non-2xx)+ // and unexpected errors, but skip the expected network-level failures so they don't+ // pollute error tracking as a recurring issue.try {const response = await fetch(`${STATUS_PAGE_BASE}/api/v1/summary`)if (!response.ok) {@@ -184,7 +195,9 @@ export const incidentStatusLogic = kea<incidentStatusLogicType>([const data: Summary = await response.json()return data} catch (error) {- posthog.captureException(error)+ if (!isNetworkError(error)) {+ posthog.captureException(error)+ }return null}},