Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Add compute and spend related telemetry

Pamela Chia0a4744255abd
diff --git a/studio/components/interfaces/BillingV2/Subscription/AddOns/ComputeInstanceSidePanel.tsx b/studio/components/interfaces/BillingV2/Subscription/AddOns/ComputeInstanceSidePanel.tsx
index 35a3241b55c..81f20e7deb6 100644
--- a/studio/components/interfaces/BillingV2/Subscription/AddOns/ComputeInstanceSidePanel.tsx
+++ b/studio/components/interfaces/BillingV2/Subscription/AddOns/ComputeInstanceSidePanel.tsx
@@ -12,6 +12,7 @@ import { useRouter } from 'next/router'
import { useEffect, useState } from 'react'
import { useSubscriptionPageStateSnapshot } from 'state/subscription-page'
import { Alert, Button, IconExternalLink, Modal, Radio, SidePanel } from 'ui'
+import Telemetry from 'lib/telemetry'
const COMPUTE_CATEGORY_OPTIONS: {
id: 'micro' | 'optimized'
@@ -79,6 +80,17 @@ const ComputeInstanceSidePanel = () => {
setSelectedCategory('micro')
setSelectedOption('ci_micro')
}
+ Telemetry.sendActivity(
+ {
+ activity: 'Side Panel Viewed',
+ source: 'Dashboard',
+ data: {
+ title: 'Change project compute size',
+ section: 'Add ons',
+ },
+ },
+ router
+ )
}
}, [visible, isLoading])
@@ -169,6 +181,18 @@ const ComputeInstanceSidePanel = () => {
onClick={() => {
setSelectedCategory(option.id)
if (option.id === 'micro') setSelectedOption('ci_micro')
+ Telemetry.sendActivity(
+ {
+ activity: 'Option Selected',
+ source: 'Dashboard',
+ data: {
+ title: 'Change project compute size',
+ section: 'Add ons',
+ option: option.name,
+ },
+ },
+ router
+ )
}}
>
<img
diff --git a/studio/components/interfaces/BillingV2/Subscription/CostControl/SpendCapSidePanel.tsx b/studio/components/interfaces/BillingV2/Subscription/CostControl/SpendCapSidePanel.tsx
index 74fccb42c8d..952fb29bb8e 100644
--- a/studio/components/interfaces/BillingV2/Subscription/CostControl/SpendCapSidePanel.tsx
+++ b/studio/components/interfaces/BillingV2/Subscription/CostControl/SpendCapSidePanel.tsx
@@ -11,6 +11,8 @@ import { useSubscriptionPageStateSnapshot } from 'state/subscription-page'
import { Alert, Button, Collapsible, IconChevronRight, IconExternalLink, SidePanel } from 'ui'
import { PermissionAction } from '@supabase/shared-types/out/constants'
import { pricing } from 'shared-data/pricing'
+import Telemetry from 'lib/telemetry'
+import { useRouter } from 'next/router'
const SPEND_CAP_OPTIONS: {
name: string
@@ -34,6 +36,7 @@ const SPEND_CAP_OPTIONS: {
const SpendCapSidePanel = () => {
const { ui } = useStore()
+ const router = useRouter()
const { ref: projectRef } = useParams()
const { isDarkMode } = useTheme()
@@ -58,6 +61,17 @@ const SpendCapSidePanel = () => {
useEffect(() => {
if (visible && subscription !== undefined) {
setSelectedOption(isSpendCapOn ? 'on' : 'off')
+ Telemetry.sendActivity(
+ {
+ activity: 'Side Panel Viewed',
+ source: 'Dashboard',
+ data: {
+ title: 'Spend cap',
+ section: 'Cost Control',
+ },
+ },
+ router
+ )
}
}, [visible, isLoading, subscription, isSpendCapOn])
diff --git a/studio/components/interfaces/BillingV2/Subscription/Tier/TierUpdateSidePanel.tsx b/studio/components/interfaces/BillingV2/Subscription/Tier/TierUpdateSidePanel.tsx
index 0c2c105f876..aaec6fc3fec 100644
--- a/studio/components/interfaces/BillingV2/Subscription/Tier/TierUpdateSidePanel.tsx
+++ b/studio/components/interfaces/BillingV2/Subscription/Tier/TierUpdateSidePanel.tsx
@@ -66,7 +66,8 @@ const TierUpdateSidePanel = () => {
activity: 'Side Panel Viewed',
source: 'Dashboard',
data: {
- side_panel_title: 'Change Subscription Plan',
+ title: 'Change Subscription Plan',
+ section: 'Subscription plan',
},
},
router
@@ -205,7 +206,22 @@ const TierUpdateSidePanel = () => {
!canUpdateSubscription
}
type={isDowngradeOption ? 'default' : 'primary'}
- onClick={() => setSelectedTier(plan.id as any)}
+ onClick={() => {
+ setSelectedTier(plan.id as any)
+ Telemetry.sendActivity(
+ {
+ activity: 'Popup Viewed',
+ source: 'Dashboard',
+ data: {
+ title: isDowngradeOption
+ ? 'Downgrade'
+ : 'Upgrade' + ' to ' + plan.name,
+ section: 'Subscription plan',
+ },
+ },
+ router
+ )
+ }}
>
{isDowngradeOption ? 'Downgrade' : 'Upgrade'} to {plan.name}
</Button>