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(signoz): classify exhausted read-timeouts as retryable (#80867)

Tom Owersbe9cdf3ba5e0
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/signoz/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/signoz/source.py
index 4da571124e11..06f0ac3783ef 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/signoz/source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/signoz/source.py
@@ -98,6 +98,22 @@ Create the API key in SigNoz under **Settings > Service Accounts**: create a ser
HOST_NOT_ALLOWED_ERROR: "The configured SigNoz host is not allowed. Check the host and try again.",
}
+ def get_retryable_errors(self) -> set[str]:
+ # `get_rows`'s tenacity retry already retries a 429/5xx (the "SigNoz API error
+ # (retryable)" sentinel), a dropped connection, and a read timeout up to MAX_RETRIES.
+ # The query_range telemetry fetch is a POST, which the tracked session's own urllib3
+ # retry skips (it only covers GET/HEAD/OPTIONS), so an exhausted read timeout there
+ # surfaces as the raw "Read timed out" message; a GET config fetch or a failed connect
+ # instead exhausts that adapter-level retry first and surfaces wrapped as "Max retries
+ # exceeded with url". Either way, Temporal retries the whole activity once tenacity's
+ # budget is exhausted, so the failure is self-recovering. The host is
+ # customer-controlled, so match only the stable, host-independent parts of the message.
+ return {
+ "SigNoz API error (retryable)",
+ "Read timed out",
+ "Max retries exceeded with url",
+ }
+
def get_canonical_descriptions(self) -> CanonicalDescriptions:
from products.warehouse_sources.backend.temporal.data_imports.sources.signoz.canonical_descriptions import (
CANONICAL_DESCRIPTIONS,
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/signoz/tests/test_signoz_source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/signoz/tests/test_signoz_source.py
index cf940d992858..2b65fd49deda 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/signoz/tests/test_signoz_source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/signoz/tests/test_signoz_source.py
@@ -73,6 +73,13 @@ class TestSigNozSource:
def test_non_retryable_errors(self, expected_key: str) -> None:
assert expected_key in self.source.get_non_retryable_errors()
+ @pytest.mark.parametrize(
+ "expected_pattern",
+ ["SigNoz API error (retryable)", "Read timed out", "Max retries exceeded with url"],
+ )
+ def test_retryable_errors(self, expected_pattern: str) -> None:
+ assert expected_pattern in self.source.get_retryable_errors()
+
def test_get_schemas_returns_all_endpoints(self) -> None:
schemas = self.source.get_schemas(self.config, self.team_id)
assert {s.name for s in schemas} == set(ENDPOINTS)