: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(data-warehouse): add metorial session, integration and version tables (#115044)
Tom Owerse53982f6c040
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 06fd5f899b78..0035cf9439d6 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@@ -5577,14 +5577,14 @@ Note: The public API reference lists only four read-oriented collections — con## Metorial — **thin**-Today (7): `provider_deployments`, `provider_runs`, `providers`, `session_errors`, `session_messages`, `sessions`, `tool_calls`+Today (10): `integration_instances`, `provider_deployments`, `provider_runs`, `provider_versions`, `providers`, `session_errors`, `session_messages`, `session_providers`, `sessions`, `tool_calls`Diffed against: <https://metorial.com/api>-- [ ] `provider-tools` — lookup table resolving the tool IDs on synced tool_calls (high)-- [ ] `session-providers` — join table linking synced sessions to the providers they used (high)-- [ ] `integration-instances` — the per-customer installed integration records that sessions run against (high)-- [ ] `provider-versions` — lookup resolving the version IDs on provider_deployments and provider_runs (high)+- [ ] `provider-tools` — lookup table resolving the tool IDs on synced tool_calls (high). Skipped: the list call requires `provider_version_id`, so it needs a per-version fan-out over the whole global provider catalog, and `tool_calls` rows already embed the full `tool` object.+- [x] `session-providers` — join table linking synced sessions to the providers they used (high). Added as `session_providers`.+- [x] `integration-instances` — the per-customer installed integration records that sessions run against (high). Added as `integration_instances`.+- [x] `provider-versions` — lookup resolving the version IDs on provider_deployments and provider_runs (high). Added as `provider_versions` (off by default, like `providers`).- [ ] `integrations` — integration catalog lookup that integration-instances point at (medium)- [ ] `session-participants` — membership table of who/what took part in each session (medium)- [ ] `session-connections` — per-session connection records for connectivity and failure analysis (medium)diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/metorial/canonical_descriptions.py b/products/warehouse_sources/backend/temporal/data_imports/sources/metorial/canonical_descriptions.pyindex 258f17285eca..72fb235eea98 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/metorial/canonical_descriptions.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/metorial/canonical_descriptions.py@@ -112,6 +112,60 @@ CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {"updated_at": "Timestamp when the deployment was last updated.",},},+ "session_providers": {+ "description": "Providers actively connected to a session. Providers can be added or removed during the session.",+ "docs_url": "https://metorial.com/api/session-providers",+ "columns": {+ "id": "Unique session provider identifier (prefixed `spr_`).",+ "status": "Session provider status: active, archived, or deleted.",+ "usage": "Productive client and provider message counts for this provider in the session.",+ "tool_filter": "Filter controlling which of the provider's tools the session exposes.",+ "provider_id": "Provider connected to the session.",+ "session_id": "Session the provider is connected to.",+ "from_template_id": "Session template the provider came from, if any.",+ "from_template_provider_id": "Session template provider the provider came from, if any.",+ "deployment": "Provider deployment used in the session.",+ "config": "Provider config used in the session.",+ "auth_config": "Provider auth config used in the session, if any.",+ "created_at": "Timestamp when the provider was added to the session.",+ "updated_at": "Timestamp when the session provider was last updated.",+ },+ },+ "integration_instances": {+ "description": "Integrations materialized for a specific actor, identity, or runtime configuration.",+ "docs_url": "https://metorial.com/api/integration-instances",+ "columns": {+ "id": "Unique integration instance identifier.",+ "status": "Instance status: draft, active, archived, or deleted.",+ "name": "Human-readable name for the instance.",+ "description": "Description of the instance.",+ "metadata": "Arbitrary key/value metadata attached to the instance.",+ "integration_id": "Integration this instance materializes.",+ "identity_actor_id": "Identity actor the instance belongs to, if any.",+ "identity_id": "Identity the instance belongs to, if any.",+ "implementation": "How the instance is implemented (e.g. a magic MCP server).",+ "providers": "The effective providers of the instance, with their configs and auth configs.",+ "created_at": "Timestamp when the instance was created.",+ "updated_at": "Timestamp when the instance was last updated.",+ "archived_at": "Timestamp when the instance was archived (null if not archived).",+ },+ },+ "provider_versions": {+ "description": "Specific releases of a provider. Each version has its own tools, auth methods, and config schema.",+ "docs_url": "https://metorial.com/api/provider-versions",+ "columns": {+ "id": "Unique provider version identifier (prefixed `prv_`).",+ "version": "Version label (e.g. 1.0.0).",+ "provider_id": "Provider this version belongs to.",+ "is_current": "Whether this is the provider's current version.",+ "name": "Display name of the version.",+ "description": "Description of the version.",+ "metadata": "Arbitrary key/value metadata attached to the version.",+ "specification_id": "Specification that defines what this version can do.",+ "created_at": "Timestamp when the version was created.",+ "updated_at": "Timestamp when the version was last updated.",+ },+ },"providers": {"description": "Read-only catalog of MCP server integration templates available on Metorial.","docs_url": "https://metorial.com/api/providers",diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/metorial/settings.py b/products/warehouse_sources/backend/temporal/data_imports/sources/metorial/settings.pyindex 770002874087..e8b5a964394c 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/metorial/settings.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/metorial/settings.py@@ -85,6 +85,28 @@ METORIAL_ENDPOINTS: dict[str, MetorialEndpointConfig] = {default_incremental_field="updated_at",incremental_fields=[_incremental_field("updated_at"), _incremental_field("created_at")],),+ # Providers attached to a session. `status` and `usage` change over the session's lifetime.+ "session_providers": MetorialEndpointConfig(+ name="session_providers",+ path="/session-providers",+ default_incremental_field="updated_at",+ incremental_fields=[_incremental_field("updated_at"), _incremental_field("created_at")],+ ),+ # Mutable per-actor/identity materializations of an integration (status, providers, archived_at).+ "integration_instances": MetorialEndpointConfig(+ name="integration_instances",+ path="/integration-instances",+ default_incremental_field="updated_at",+ incremental_fields=[_incremental_field("updated_at"), _incremental_field("created_at")],+ ),+ # Versions of the global provider catalog, so off by default like `providers`.+ "provider_versions": MetorialEndpointConfig(+ name="provider_versions",+ path="/provider-versions",+ default_incremental_field="updated_at",+ incremental_fields=[_incremental_field("updated_at"), _incremental_field("created_at")],+ should_sync_default=False,+ ),# The provider catalog exposes no server-side timestamp filter, so it can only be full-refreshed.# It's a global reference catalog (not project-specific), so it's off by default."providers": MetorialEndpointConfig(diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/metorial/tests/test_metorial.py b/products/warehouse_sources/backend/temporal/data_imports/sources/metorial/tests/test_metorial.pyindex 6c81e4427f6b..8dcea3c1fbfe 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/metorial/tests/test_metorial.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/metorial/tests/test_metorial.py@@ -193,6 +193,9 @@ class TestSourceResponse:("sessions_default_updated_at", "sessions", None, "desc"),("provider_runs_default_updated_at", "provider_runs", None, "desc"),("provider_deployments_default_updated_at", "provider_deployments", None, "desc"),+ ("session_providers_default_updated_at", "session_providers", None, "desc"),+ ("integration_instances_default_updated_at", "integration_instances", None, "desc"),+ ("provider_versions_default_updated_at", "provider_versions", None, "desc"),# A user overriding sessions onto created_at makes per-batch checkpointing safe again.("sessions_user_picks_created_at", "sessions", "created_at", "asc"),# created_at tracks id order, so append-only streams checkpoint safely per batch.