diff --git a/frontend/__snapshots__/components-playerinspector-itemevent--web-vitals-event--dark.png b/frontend/__snapshots__/components-playerinspector-itemevent--web-vitals-event--dark.png index 38a99e796fa43..aa5214280b876 100644 Binary files a/frontend/__snapshots__/components-playerinspector-itemevent--web-vitals-event--dark.png and b/frontend/__snapshots__/components-playerinspector-itemevent--web-vitals-event--dark.png differ diff --git a/frontend/__snapshots__/components-playerinspector-itemevent--web-vitals-event--light.png b/frontend/__snapshots__/components-playerinspector-itemevent--web-vitals-event--light.png index c39cb56172b54..6b53658079318 100644 Binary files a/frontend/__snapshots__/components-playerinspector-itemevent--web-vitals-event--light.png and b/frontend/__snapshots__/components-playerinspector-itemevent--web-vitals-event--light.png differ diff --git a/frontend/src/lib/utils/eventUsageLogic.ts b/frontend/src/lib/utils/eventUsageLogic.ts index 86761366dc3e5..e798813d59c03 100644 --- a/frontend/src/lib/utils/eventUsageLogic.ts +++ b/frontend/src/lib/utils/eventUsageLogic.ts @@ -246,6 +246,7 @@ function sanitizeQuery(query: Node | null): Record isEventsNode(e)).length payload.action_entity_count = getSeries(querySource)?.filter((e) => isActionsNode(e)).length payload.data_warehouse_entity_count = getSeries(querySource)?.filter((e) => isDataWarehouseNode(e)).length + payload.has_data_warehouse_series = !!getSeries(querySource)?.find((e) => isDataWarehouseNode(e)) // properties payload.has_properties = !!properties diff --git a/frontend/src/scenes/data-warehouse/external/dataWarehouseSceneLogic.ts b/frontend/src/scenes/data-warehouse/external/dataWarehouseSceneLogic.ts index 886927f704110..0543bda63c392 100644 --- a/frontend/src/scenes/data-warehouse/external/dataWarehouseSceneLogic.ts +++ b/frontend/src/scenes/data-warehouse/external/dataWarehouseSceneLogic.ts @@ -1,6 +1,7 @@ import { lemonToast } from '@posthog/lemon-ui' import { actions, connect, kea, listeners, path, reducers, selectors } from 'kea' import api from 'lib/api' +import posthog from 'posthog-js' import { databaseTableListLogic } from 'scenes/data-management/database/databaseTableListLogic' import { DatabaseSchemaTable, DatabaseSerializedFieldType } from '~/queries/schema' @@ -189,6 +190,13 @@ export const dataWarehouseSceneLogic = kea([ try { await api.dataWarehouseTables.updateSchema(tableId, schemaUpdates) actions.loadDatabase() + + if (values.selectedRow) { + posthog.capture('source schema saved', { + name: values.selectedRow.name, + tableType: values.selectedRow.type, + }) + } } catch (e: any) { lemonToast.error(e.message) actions.setEditSchemaIsLoading(false) @@ -212,5 +220,13 @@ export const dataWarehouseSceneLogic = kea([ actions.selectRow(null) lemonToast.success('Table successfully deleted') }, + toggleSchemaModal: () => { + if (values.schemaModalIsOpen && values.selectedRow) { + posthog.capture('source schema viewed', { + name: values.selectedRow.name, + tableType: values.selectedRow.type, + }) + } + }, })), ]) diff --git a/frontend/src/scenes/data-warehouse/new/sourceWizardLogic.tsx b/frontend/src/scenes/data-warehouse/new/sourceWizardLogic.tsx index bbbed3d43a777..2354faf4cdb18 100644 --- a/frontend/src/scenes/data-warehouse/new/sourceWizardLogic.tsx +++ b/frontend/src/scenes/data-warehouse/new/sourceWizardLogic.tsx @@ -3,6 +3,7 @@ import { actions, connect, kea, listeners, path, reducers, selectors } from 'kea import { forms } from 'kea-forms' import { router, urlToAction } from 'kea-router' import api from 'lib/api' +import posthog from 'posthog-js' import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic' import { Scene } from 'scenes/sceneTypes' import { urls } from 'scenes/urls' @@ -666,6 +667,7 @@ export const sourceWizardLogic = kea([ actions.submitSourceConnectionDetails() } else if (values.currentStep === 2 && values.isManualLinkFormVisible) { dataWarehouseTableLogic.actions.submitTable() + posthog.capture('source created', { sourceType: 'Manual' }) } if (values.currentStep === 3 && values.selectedConnector?.name) { @@ -682,6 +684,7 @@ export const sourceWizardLogic = kea([ }) actions.setIsLoading(true) actions.createSource() + posthog.capture('source created', { sourceType: values.selectedConnector.name }) } if (values.currentStep === 4) { diff --git a/frontend/src/scenes/data-warehouse/settings/dataWarehouseSettingsLogic.ts b/frontend/src/scenes/data-warehouse/settings/dataWarehouseSettingsLogic.ts index 312c23bb582bc..d34ff71b94041 100644 --- a/frontend/src/scenes/data-warehouse/settings/dataWarehouseSettingsLogic.ts +++ b/frontend/src/scenes/data-warehouse/settings/dataWarehouseSettingsLogic.ts @@ -3,6 +3,7 @@ import { loaders } from 'kea-loaders' import { actionToUrl, urlToAction } from 'kea-router' import api, { ApiMethodOptions, PaginatedResponse } from 'lib/api' import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast' +import posthog from 'posthog-js' import { databaseTableListLogic } from 'scenes/data-management/database/databaseTableListLogic' import { Scene } from 'scenes/sceneTypes' import { urls } from 'scenes/urls' @@ -194,6 +195,8 @@ export const dataWarehouseSettingsLogic = kea([ await api.externalDataSources.delete(source.id) actions.loadSources(null) actions.sourceLoadingFinished(source) + + posthog.capture('source deleted', { sourceType: source.source_type }) }, reloadSource: async ({ source }) => { // Optimistic UI updates before sending updates to the backend @@ -221,6 +224,8 @@ export const dataWarehouseSettingsLogic = kea([ try { await api.externalDataSources.reload(source.id) actions.loadSources(null) + + posthog.capture('source reloaded', { sourceType: source.source_type }) } catch (e: any) { if (e.message) { lemonToast.error(e.message) @@ -249,6 +254,8 @@ export const dataWarehouseSettingsLogic = kea([ await api.externalDataSchemas.reload(schema.id) actions.schemaLoadingFinished(schema) actions.loadSources(null) + + posthog.capture('schema reloaded', { sourceType: clonedSources[sourceIndex].source_type }) } catch (e: any) { if (e.message) { lemonToast.error(e.message) @@ -276,6 +283,8 @@ export const dataWarehouseSettingsLogic = kea([ await api.externalDataSchemas.resync(schema.id) actions.schemaLoadingFinished(schema) actions.loadSources(null) + + posthog.capture('schema resynced', { sourceType: clonedSources[sourceIndex].source_type }) } catch (e: any) { if (e.message) { lemonToast.error(e.message) @@ -290,6 +299,9 @@ export const dataWarehouseSettingsLogic = kea([ cache.abortController = null } }, + updateSchema: (schema) => { + posthog.capture('schema updated', { shouldSync: schema.should_sync, syncType: schema.sync_type }) + }, })), afterMount(({ actions }) => { actions.loadSources(null) diff --git a/frontend/src/scenes/data-warehouse/viewLinkLogic.tsx b/frontend/src/scenes/data-warehouse/viewLinkLogic.tsx index 728df0e07150e..b55875358c7ed 100644 --- a/frontend/src/scenes/data-warehouse/viewLinkLogic.tsx +++ b/frontend/src/scenes/data-warehouse/viewLinkLogic.tsx @@ -2,6 +2,7 @@ import { actions, connect, kea, listeners, path, reducers, selectors } from 'kea import { forms } from 'kea-forms' import { subscriptions } from 'kea-subscriptions' import api from 'lib/api' +import posthog from 'posthog-js' import { databaseTableListLogic } from 'scenes/data-management/database/databaseTableListLogic' import { DataWarehouseViewLink } from '~/types' @@ -141,6 +142,8 @@ export const viewLinkLogic = kea([ actions.loadJoins() actions.loadDatabase() + + posthog.capture('join updated') } catch (error: any) { actions.setError(error.detail) } @@ -159,6 +162,8 @@ export const viewLinkLogic = kea([ actions.loadJoins() actions.loadDatabase() + + posthog.capture('join created') } catch (error: any) { actions.setError(error.detail) }