: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(vercel): stop tracking self-recovering Vercel API errors as bugs (#73156)
Tom Owers664db98a1281
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.pyindex 3f2823a68603..2342ee111ebd 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@@ -104,6 +104,12 @@ To sync resources owned by a team, also enter the team's ID (found under **Team"404 Client Error: Not Found for url: https://api.vercel.com/v1/billing/charges": "Vercel couldn't find billing data for the configured team. Check that the Team ID is correct and that your access token's user still belongs to that team, then reconnect.",}+ 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)"}+def get_schemas(self,config: VercelSourceConfig,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.pyindex 20126891a86d..457c52cbcdf5 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@@ -126,6 +126,18 @@ class TestVercelSource:non_retryable = self.source.get_non_retryable_errors()assert not any(key in other_error for key in non_retryable)+ @parameterized.expand(+ [+ ("server_error", "Vercel API error (retryable): status=500, url=https://api.vercel.com/v1/billing/charges"),+ ("rate_limit", "Vercel API error (retryable): status=429, url=https://api.vercel.com/v6/deployments"),+ ]+ )+ def test_retryable_errors_match_known_failures(self, _name: str, observed_error: str) -> None:+ # Matches the message `_fetch_page`/`_open_billing_stream` raise after their internal+ # retry loop exhausts; keeps this 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)