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(data-warehouse): keep bing webmaster tools rate limits out of error tracking (#119951)

Tom Owers626516a6d369
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/bing_webmaster_tools/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/bing_webmaster_tools/source.py
index fb198d8b0af4..6df936af2973 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/bing_webmaster_tools/source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/bing_webmaster_tools/source.py
@@ -61,6 +61,14 @@ class BingWebmasterToolsSource(SimpleSource[BingWebmasterToolsSourceConfig]):
"not verified sites on the connected account": None,
}
+ def get_retryable_errors(self) -> set[str]:
+ return {
+ # Bing's rate-limit fault, raised as `BingWebmasterToolsError` by `_request_payload`.
+ # The key is per API user rather than per request, so a Temporal retry with backoff
+ # normally clears it once the window rolls over; it must not page as a bug.
+ "ERROR!!! ThrottleUser",
+ }
+
def get_canonical_descriptions(self) -> CanonicalDescriptions:
from products.warehouse_sources.backend.temporal.data_imports.sources.bing_webmaster_tools.canonical_descriptions import ( # noqa: PLC0415 (keeps the descriptions dict off the registry import path; only the enrichment activity reads it)
CANONICAL_DESCRIPTIONS,
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/bing_webmaster_tools/tests/test_bing_webmaster_tools_source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/bing_webmaster_tools/tests/test_bing_webmaster_tools_source.py
index c62056706323..3a063ad1d3fb 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/bing_webmaster_tools/tests/test_bing_webmaster_tools_source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/bing_webmaster_tools/tests/test_bing_webmaster_tools_source.py
@@ -9,6 +9,7 @@ from products.warehouse_sources.backend.temporal.data_imports.sources.bing_webma
from products.warehouse_sources.backend.temporal.data_imports.sources.bing_webmaster_tools.source import (
BingWebmasterToolsSource,
)
+from products.warehouse_sources.backend.temporal.data_imports.sources.common.base import error_message_matches
from products.warehouse_sources.backend.temporal.data_imports.sources.common.typings import SourceInputs
from products.warehouse_sources.backend.temporal.data_imports.sources.generated_configs.bingwebmastertools import (
BingWebmasterToolsSourceConfig,
@@ -42,6 +43,14 @@ class TestBingWebmasterToolsSource:
# Static endpoint catalog with no I/O; must opt in so public docs render the table list.
assert self.source.lists_tables_without_credentials is True
+ def test_throttle_fault_is_retryable_not_disabling(self):
+ # A rate-limit fault must keep Temporal retrying the activity (it is not a permanent
+ # account/credential problem) and must stay out of error tracking as noise.
+ error_message = "Bing Webmaster Tools GetUserSites failed with status 400: ERROR!!! ThrottleUser"
+
+ assert error_message_matches(error_message, self.source.get_retryable_errors())
+ assert not error_message_matches(error_message, self.source.get_non_retryable_errors())
+
@pytest.mark.parametrize("endpoint", list(ENDPOINTS))
def test_source_for_pipeline_plumbs_schema_name(self, endpoint):
response = self.source.source_for_pipeline(self.config, _make_inputs(endpoint))