: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(google_ads): stop reporting call-deadline timeouts as error tracking noise (#113018)
Tom Owers1a15c3148cd8
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/google_ads/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/google_ads/source.pyindex 40b146bee833..da560a5d868f 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/google_ads/source.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/google_ads/source.py@@ -176,7 +176,16 @@ class GoogleAdsSource(# budget has hit a longer-lived quota window than a few seconds of backoff can clear,# but Temporal's activity retry recovers once it does — self-recovering, not a bug, so# keep it out of error tracking as noise.- return {"Resource has been exhausted (e.g. check quota)"}+ #+ # `GoogleAdsCallDeadlineExceeded` (see google_ads.py) is raised deliberately when a single+ # call runs past the generous per-call timeout — normal for a full page of a wide resource+ # or a very large account. It is retryable by design: Temporal's activity retry builds a+ # fresh channel and resumes from the saved page token. Matched without the timeout value,+ # which is a tunable constant rather than a stable identifier.+ return {+ "Resource has been exhausted (e.g. check quota)",+ "Google Ads call did not finish within",+ }# TODO: clean up google ads source to not have two auth config optionsdef parse_config(self, job_inputs: dict) -> GoogleAdsSourceConfig | GoogleAdsServiceAccountSourceConfig:diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/google_ads/tests/test_google_ads_source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/google_ads/tests/test_google_ads_source.pyindex ab9ea965e935..11e5719e4e42 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/google_ads/tests/test_google_ads_source.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/google_ads/tests/test_google_ads_source.py@@ -342,12 +342,14 @@ class TestGoogleAdsRetryableErrors:# `_call_with_transient_retry`'s in-process retry budget (see google_ads.py) is# exhausted on a quota/rate-limit RESOURCE_EXHAUSTED."Resource has been exhausted (e.g. check quota).",+ # str(GoogleAdsCallDeadlineExceeded) raised when a single call runs past+ # GOOGLE_ADS_CALL_TIMEOUT_SECONDS (see google_ads.py).+ f"Google Ads call did not finish within {GOOGLE_ADS_CALL_TIMEOUT_SECONDS} seconds",],)- def test_quota_exhausted_is_retryable(self, error_msg):- # If this pattern drops out of get_retryable_errors(), a quota window that outlasts the- # in-process retry budget starts polluting error tracking even though Temporal's activity- # retry still recovers once the quota clears.+ def test_known_self_recovering_errors_are_retryable(self, error_msg):+ # If either pattern drops out of get_retryable_errors(), a condition Temporal's activity+ # retry already recovers from on its own starts polluting error tracking as noise.assert any(pattern in error_msg for pattern in self.retryable)def test_receive_limit_exhausted_is_not_retryable(self):