: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): add axiom users and groups tables (#118529)
Tom Owersa6b2d685c598
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md b/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.mdindex fabdf1c30bd2..5a517bb81b07 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md@@ -1366,14 +1366,14 @@ Note: The WAF SDK model was compared with the four existing list and get pairs,## Axiom — **thin**-Today (5): `annotations`, `dashboards`, `datasets`, `monitors`, `saved_queries`+Today (7): `annotations`, `dashboards`, `datasets`, `groups`, `monitors`, `saved_queries`, `users`Diffed against: <https://raw.githubusercontent.com/axiomhq/docs/main/content/docs/(api-reference)/restapi/versions/v2.json>-- [ ] `Users (GET /v2/users)` — resolve createdBy on synced monitors to people and analyze ownership across monitoring resources (high)-- [ ] `Dataset events (Run query, POST /v1/datasets/_apl; edge deployments use POST /v1/query/_apl)` — analyze actual logs, traces, and events instead of only dataset and dashboard metadata (high)-- [ ] `Monitor notification history (GET /v2/monitors/{id}/history)` — measure alert frequency, notification outcomes, and changes in monitor behavior over time (medium)-- [ ] `Groups (GET /v2/rbac/groups)` — analyze organization membership and connect users to operational teams (medium)+- [x] `Users (GET /v2/users)` — resolve createdBy on synced monitors to people and analyze ownership across monitoring resources (high). Added as `users`.+- [ ] `Dataset events (Run query, POST /v1/datasets/_apl; edge deployments use POST /v1/query/_apl)` — analyze actual logs, traces, and events instead of only dataset and dashboard metadata (high); skipped, it is an APL query endpoint on the v1 API rather than a list endpoint: each dataset has its own user-defined schema, so it needs per-dataset table discovery, time windowing and regional endpoint routing that a static endpoint catalog cannot express+- [ ] `Monitor notification history (GET /v2/monitors/{id}/history)` — measure alert frequency, notification outcomes, and changes in monitor behavior over time (medium); skipped, rows carry no identifier and repeat once per notifier and email recipient, so no primary key is unique, and the endpoint requires a `startTime`/`endTime` window with no documented retention bound+- [x] `Groups (GET /v2/rbac/groups)` — analyze organization membership and connect users to operational teams (medium). Added as `groups`.Note: The official documentation repository provides the v2, v1, and v1-edge-query OpenAPI files used for this comparison. The v1 specs confirm that dataset event queries are read operations sent by POST; the source currently imports metadata only. Event imports require dataset selection, time windows, pagination, and the correct regional query endpoint; history requires requests for each monitor. Tokens, notifiers, field settings, views, ingestion writes, and other configuration operations are excluded.diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/axiom/canonical_descriptions.py b/products/warehouse_sources/backend/temporal/data_imports/sources/axiom/canonical_descriptions.pyindex 7312af17ab15..e261c55abdf3 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/axiom/canonical_descriptions.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/axiom/canonical_descriptions.py@@ -69,4 +69,26 @@ CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {"who": "User who saved the query.",},},+ "users": {+ "description": "Members of the Axiom organization and their roles.",+ "docs_url": "https://axiom.co/docs/restapi/endpoints/getUsers",+ "columns": {+ "id": "Unique user identifier. Matches createdBy on monitors.",+ "name": "User's full name.",+ "email": "User's email address.",+ "role": "Role assigned to the user, with its ID and name.",+ },+ },+ "groups": {+ "description": "Groups in the Axiom organization, with their members and assigned roles.",+ "docs_url": "https://axiom.co/docs/restapi/endpoints/listGroups",+ "columns": {+ "id": "Unique group identifier.",+ "name": "Unique group name.",+ "description": "Purpose and scope of the group.",+ "members": "IDs of the users in the group.",+ "roles": "IDs of the roles assigned to the group.",+ "isManaged": "Whether the group is synced from the identity provider.",+ },+ },}diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/axiom/settings.py b/products/warehouse_sources/backend/temporal/data_imports/sources/axiom/settings.pyindex a4eca00556f7..b820b4e71926 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/axiom/settings.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/axiom/settings.py@@ -18,6 +18,8 @@ ENDPOINTS: dict[str, Endpoint] = {"params": {"who": "all"},"paginator": {"type": "offset", "limit": PAGE_SIZE, "total_path": None},},+ "users": {"path": "users", "paginator": "single_page"},+ "groups": {"path": "rbac/groups", "paginator": "single_page"},}AUTH_ERRORS = {diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/axiom/tests/test_axiom.py b/products/warehouse_sources/backend/temporal/data_imports/sources/axiom/tests/test_axiom.pyindex 7eb9bd10c3cd..523abad5fa88 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/axiom/tests/test_axiom.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/axiom/tests/test_axiom.py@@ -49,17 +49,26 @@ def make_inputs(table: str) -> SourceInputs:)[email protected]("table", ["datasets", "monitors", "annotations"])+ "table,path",+ [+ ("datasets", "datasets"),+ ("monitors", "monitors"),+ ("annotations", "annotations"),+ ("users", "users"),+ ("groups", "rbac/groups"),+ ],+)@pytest.mark.parametrize("rows", [[], [{"id": "record-1"}, {"id": "record-2"}]])@pytest.mark.parametrize("org_id", [None, "example-org"])-def test_single_page_full_refresh(table: str, rows: list[dict[str, str]], org_id: str | None) -> None:+def test_single_page_full_refresh(table: str, path: str, rows: list[dict[str, str]], org_id: str | None) -> None:result = SourceDriver(AxiomSource(), AxiomSourceConfig(api_token="test-token", org_id=org_id)).run(table, [ScriptedResponse(json=rows)])assert result.raised is Noneassert result.rows == rows- assert result.paths == [f"/v2/{table}"]+ assert result.paths == [f"/v2/{path}"]request = result.requests[0]assert request.headers["authorization"] == "Bearer test-token"assert request.headers.get("x-axiom-org-id") == org_id