: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
feat(warehouse_sources): support SigNoz API version v5 (#80090)
Tom Owers648f56a13f20
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/signoz/signoz.py b/products/warehouse_sources/backend/temporal/data_imports/sources/signoz/signoz.pyindex e61c29da42fb..14919a350443 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/signoz/signoz.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/signoz/signoz.py@@ -23,6 +23,14 @@ MAX_RETRIES = 5MAX_RETRY_AFTER_SECONDS = 60DEFAULT_LOOKBACK_DAYS = 30+# SigNoz's current stable telemetry API generation (Query Builder v5, GA August 2025). SigNoz+# versions this API in the endpoint path, not via a request header, and this source has always+# queried the v5 `query_range` endpoint. So the framework's legacy unversioned label and this+# explicit label resolve to the same requests — new sources are stamped "v5" while existing pins+# keep syncing byte-for-byte. The management REST endpoints (rules, dashboards, channels) are+# unversioned v1 and stay hardcoded in settings.py.+SIGNOZ_API_VERSION_V5 = "v5"+QUERY_RANGE_PATH = "/api/v5/query_range"HOST_NOT_ALLOWED_ERROR = "SigNoz host is not allowed"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.pyindex 0a1778856604..4da571124e11 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@@ -9,7 +9,11 @@ from posthog.schema import (SourceFieldInputConfigType,)-from products.warehouse_sources.backend.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from products.warehouse_sources.backend.temporal.data_imports.sources.common.base import (+ UNVERSIONED_API_VERSION,+ FieldType,+ ResumableSource,+)from products.warehouse_sources.backend.temporal.data_imports.sources.common.canonical_descriptions import (CanonicalDescriptions,)@@ -26,6 +30,7 @@ from products.warehouse_sources.backend.temporal.data_imports.sources.signoz.set)from products.warehouse_sources.backend.temporal.data_imports.sources.signoz.signoz import (HOST_NOT_ALLOWED_ERROR,+ SIGNOZ_API_VERSION_V5,SigNozResumeConfig,signoz_source,validate_credentials as validate_signoz_credentials,@@ -38,6 +43,12 @@ class SigNozSource(ResumableSource[SigNozSourceConfig, SigNozResumeConfig]):lists_tables_without_credentials = True # static endpoint catalog — safe for public docsapi_docs_url = "https://signoz.io/api-reference/"+ # SigNoz versions its telemetry API in the endpoint path (see SIGNOZ_API_VERSION_V5): this source+ # already reads the v5 query_range endpoint, so the legacy unversioned label and "v5" drive+ # identical requests. New sources default to "v5"; existing pins keep syncing byte-for-byte.+ supported_versions = (UNVERSIONED_API_VERSION, SIGNOZ_API_VERSION_V5)+ default_version = SIGNOZ_API_VERSION_V5+@propertydef source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.SIGNOZdiff --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.pyindex 7e2a007ff63c..cf940d992858 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@@ -176,3 +176,21 @@ class TestSigNozSource:_, kwargs = mock_source.call_argsassert kwargs["should_use_incremental_field"] is Trueassert kwargs["db_incremental_field_last_value"] == "2026-01-01T00:00:00Z"++ def test_new_sources_default_to_v5(self) -> None:+ # New sources (no pin) must be created on the current SigNoz query_range API version.+ assert self.source.default_version == "v5"+ assert self.source.resolve_api_version(None) == "v5"++ @pytest.mark.parametrize("version", ["v1", "v5"])+ def test_existing_pin_is_honored(self, version: str) -> None:+ # Existing instances keep their pinned version verbatim after the default bump, so their+ # syncs are unaffected.+ assert version in self.source.supported_versions+ assert self.source.resolve_api_version(version) == version++ @pytest.mark.parametrize("version", ["v1", "v5"])+ def test_no_version_is_deprecated(self, version: str) -> None:+ # This is a plain update, not a sunset: neither label is deprecated, so the in-product+ # deprecation banner must stay dark for existing v1 pins.+ assert self.source.get_version_deprecation(version) is None