Skip to content

: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.

fix(vercel): stop tracking self-recovering connection timeouts as bugs (#73179)

Tom Owers51efaf589deb
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/vercel/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/vercel/source.py
index 2342ee111ebd..0573e81a2323 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/vercel/source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/vercel/source.py
@@ -105,10 +105,16 @@ To sync resources owned by a team, also enter the team's ID (found under **Team
}
def get_retryable_errors(self) -> set[str]:
- # A 429 or 5xx is retried internally by `_fetch_page`/`_open_billing_stream`; if those
- # retries still exhaust, the failure is transient and self-recovering, so let Temporal
- # retry the activity without surfacing it as tracked exception noise.
- return {"Vercel API error (retryable)"}
+ # `_fetch_page`/`_open_billing_stream` already retry these in-process (a 429/5xx surfaces as
+ # the "Vercel API error (retryable)" sentinel; connection failures and read timeouts surface
+ # as the urllib3 pool error). Once those retries exhaust, Temporal retries the whole activity
+ # and the failure is transient and self-recovering, so don't surface it as tracked exception
+ # noise. The host is a constant, not user input, so matching on it doesn't risk swallowing an
+ # unrelated failure.
+ return {
+ "Vercel API error (retryable)",
+ "HTTPSConnectionPool(host='api.vercel.com', port=443)",
+ }
def get_schemas(
self,
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/vercel/tests/test_vercel_source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/vercel/tests/test_vercel_source.py
index 457c52cbcdf5..331346d62bf8 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/vercel/tests/test_vercel_source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/vercel/tests/test_vercel_source.py
@@ -138,6 +138,26 @@ class TestVercelSource:
retryable_errors = self.source.get_retryable_errors()
assert any(key in observed_error for key in retryable_errors)
+ @parameterized.expand(
+ [
+ (
+ "connection_error",
+ "HTTPSConnectionPool(host='api.vercel.com', port=443): Max retries exceeded with url: "
+ '/v1/billing/charges?teamId=team_abc (Caused by ReadTimeoutError("HTTPSConnectionPool'
+ "(host='api.vercel.com', port=443): Read timed out. (read timeout=120)\"))",
+ ),
+ (
+ "read_timeout",
+ "HTTPSConnectionPool(host='api.vercel.com', port=443): Read timed out. (read timeout=120)",
+ ),
+ ]
+ )
+ def test_retryable_errors_match_transient_network_failures(self, _name: str, observed_error: str) -> None:
+ # `_fetch_page`/`_open_billing_stream` already retry these in-process; once exhausted, this
+ # keeps the benign, self-recovering failure out of error tracking.
+ retryable_errors = self.source.get_retryable_errors()
+ assert any(key in observed_error for key in retryable_errors)
+
def test_get_resumable_source_manager_binds_data_class(self) -> None:
manager = self.source.get_resumable_source_manager(_source_inputs("deployments"))
assert isinstance(manager, ResumableSourceManager)