diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/BillingBreakdown.constants.ts b/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/BillingBreakdown.constants.ts
index 5bd920c7e5..b4e6309f82 100644
--- a/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/BillingBreakdown.constants.ts
+++ b/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/BillingBreakdown.constants.ts
@@ -95,10 +95,11 @@ export const BILLING_BREAKDOWN_METRICS: Metric[] = [
{
key: PricingMetric.DISK_SIZE_GB_HOURS_GP3,
name: 'Disk Size',
+ anchor: 'diskSize',
units: 'absolute',
unitName: 'GB-Hrs',
category: 'Database',
- tip: 'Each project gets provisioned with 8 GB of GP3 disk for free. When you get close to the disk size limit, we autoscale your disk by 1.5x. Each GB of provisioned disk size beyond 8 GB incurs a GB-Hr every hour. Each extra GB is billed at $0.125/month, prorated down to the hour.',
+ tip: 'Each project gets provisioned with 8 GB of GP3 disk for free. When you get close to the disk size limit, we autoscale your disk by 1.5x. Each GB of provisioned disk size beyond 8 GB incurs a GB-Hr every hour. Each extra GB is billed at $0.125/month ($0.000171/GB-Hr), prorated down to the hour.',
docLink: {
title: 'Read more',
url: 'https://supabase.com/docs/guides/platform/org-based-billing#disk-size',
@@ -107,6 +108,7 @@ export const BILLING_BREAKDOWN_METRICS: Metric[] = [
{
key: PricingMetric.DISK_SIZE_GB_HOURS_IO2,
name: 'Disk Size IO2',
+ anchor: 'diskSize',
units: 'absolute',
unitName: 'GB-Hrs',
category: 'Database',
diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/BillingMetric.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/BillingMetric.tsx
index 449012f73b..476370e1f9 100644
--- a/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/BillingMetric.tsx
+++ b/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/BillingMetric.tsx
@@ -174,7 +174,7 @@ const BillingMetric = ({
{subscription.usage_billing_enabled === false &&
relativeToSubscription &&
(isApproachingLimit || isExceededLimit) && (
-
+
Exceeding your plans included usage will lead to restrictions to your project.
Upgrade to a usage-based plan or disable the spend cap to avoid restrictions.
diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/Restriction.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/Restriction.tsx
index fa29bb8eaf..4d5dd46d63 100644
--- a/apps/studio/components/interfaces/Organization/BillingSettings/Restriction.tsx
+++ b/apps/studio/components/interfaces/Organization/BillingSettings/Restriction.tsx
@@ -7,6 +7,7 @@ import { useOrgUsageQuery } from 'data/usage/org-usage-query'
import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization'
import { AlertDescription_Shadcn_, AlertTitle_Shadcn_, Alert_Shadcn_, Button } from 'ui'
import { CriticalIcon, WarningIcon } from 'ui'
+import { PricingMetric } from 'data/analytics/org-daily-stats-query'
export const Restriction = () => {
const org = useSelectedOrganization()
@@ -18,7 +19,10 @@ export const Restriction = () => {
const hasExceededAnyLimits = Boolean(
usage?.usages.find(
(metric) =>
- !metric.unlimited && metric.capped && metric.usage > (metric?.pricing_free_units ?? 0)
+ metric.metric !== PricingMetric.DISK_SIZE_GB_HOURS_GP3 &&
+ !metric.unlimited &&
+ metric.capped &&
+ metric.usage > (metric?.pricing_free_units ?? 0)
)
)
diff --git a/apps/studio/components/interfaces/Organization/Usage/Usage.constants.tsx b/apps/studio/components/interfaces/Organization/Usage/Usage.constants.tsx
index 3cfb495614..aebafdd48a 100644
--- a/apps/studio/components/interfaces/Organization/Usage/Usage.constants.tsx
+++ b/apps/studio/components/interfaces/Organization/Usage/Usage.constants.tsx
@@ -100,73 +100,93 @@ export const USAGE_CATEGORIES: (subscription?: OrgSubscription) => CategoryMeta[
name: 'Database & Storage Size',
description: 'Amount of resources your project is consuming',
attributes: [
- {
- anchor: 'dbSize',
- key: PricingMetric.DATABASE_SIZE,
- attributes: [{ key: PricingMetric.DATABASE_SIZE.toLowerCase(), color: 'white' }],
- name: 'Database size',
- chartPrefix: 'Average',
- unit: 'bytes',
- description:
- subscription?.usage_based_billing_project_addons === true
- ? 'Database size refers to the monthly average database space usage, as reported by Postgres. Paid Plans use auto-scaling disks and are billed based on provisioned disk size, rather than database space used.'
- : 'Database size refers to the monthly average database space usage, as reported by Postgres. Paid Plans use auto-scaling disks.\nBilling is based on the average daily database size used in GB throughout the billing period. Billing is independent of the provisioned disk size.',
- links: [
- {
- name: 'Documentation',
- url: 'https://supabase.com/docs/guides/platform/database-size',
+ subscription?.plan.id === 'free' || subscription?.usage_based_billing_project_addons !== true
+ ? {
+ anchor: 'dbSize',
+ key: PricingMetric.DATABASE_SIZE,
+ attributes: [{ key: PricingMetric.DATABASE_SIZE.toLowerCase(), color: 'white' }],
+ name: 'Database size',
+ chartPrefix: 'Average',
+ unit: 'bytes',
+ description:
+ 'Database size refers to the monthly average database space usage, as reported by Postgres. Paid Plans use auto-scaling disks.\nBilling is based on the average daily database size used in GB throughout the billing period. Billing is independent of the provisioned disk size.',
+ links: [
+ {
+ name: 'Documentation',
+ url: 'https://supabase.com/docs/guides/platform/database-size',
+ },
+ ...(subscription?.usage_based_billing_project_addons === true
+ ? [
+ {
+ name: 'Disk Management',
+ url: 'https://supabase.com/docs/guides/platform/database-size#disk-management',
+ },
+ ]
+ : []),
+ ],
+ chartDescription: 'The data refreshes every 24 hours.',
+ additionalInfo: (usage?: OrgUsageResponse) => {
+ const usageMeta = usage?.usages.find((x) => x.metric === PricingMetric.DATABASE_SIZE)
+ const usageRatio =
+ typeof usageMeta !== 'number'
+ ? (usageMeta?.usage ?? 0) / (usageMeta?.pricing_free_units ?? 0)
+ : 0
+ const hasLimit = usageMeta && (usageMeta?.pricing_free_units ?? 0) > 0
+
+ const isApproachingLimit = hasLimit && usageRatio >= USAGE_APPROACHING_THRESHOLD
+ const isExceededLimit = hasLimit && usageRatio >= 1
+ const isCapped = usageMeta?.capped
+
+ const onFreePlan = subscription?.plan?.name === 'Free'
+
+ return (
+
+ When you reach your database size limit, your project can go into
+ read-only mode.{' '}
+ {onFreePlan
+ ? 'Please upgrade your Plan.'
+ : "Disable your spend cap to scale seamlessly, and pay for over-usage beyond your Plan's quota."}
+
+
+
+ )}
+
+ )
+ },
+ }
+ : {
+ anchor: 'diskSize',
+ key: 'diskSize',
+ attributes: [],
+ name: 'Disk size',
+ chartPrefix: 'Average',
+ unit: 'bytes',
+ description:
+ "Each Supabase project comes with a dedicated disk. Each project gets 8 GB of disk for free. Billing is based on the provisioned disk size. Disk automatically scales up when you get close to it's size.\nEach hour your project is using more than 8 GB of GP3 disk, it incurs the overages in GB-Hrs, i.e. a 16 GB disk incurs 8 GB-Hrs every hour. Extra disk size costs $0.125/GB/month ($0.000171/GB-Hr).",
+ links: [
+ {
+ name: 'Documentation',
+ url: 'https://supabase.com/docs/guides/platform/org-based-billing#disk-size',
+ },
+ {
+ name: 'Disk Management',
+ url: 'https://supabase.com/docs/guides/platform/database-size#disk-management',
+ },
+ ],
+ chartDescription: '',
},
- ...(subscription?.usage_based_billing_project_addons === true
- ? [
- {
- name: 'Disk Management',
- url: 'https://supabase.com/docs/guides/platform/database-size#disk-management',
- },
- ]
- : []),
- ],
- chartDescription: 'The data refreshes every 24 hours.',
- additionalInfo: (usage?: OrgUsageResponse) => {
- const usageMeta = usage?.usages.find((x) => x.metric === PricingMetric.DATABASE_SIZE)
- const usageRatio =
- typeof usageMeta !== 'number'
- ? (usageMeta?.usage ?? 0) / (usageMeta?.pricing_free_units ?? 0)
- : 0
- const hasLimit = usageMeta && (usageMeta?.pricing_free_units ?? 0) > 0
-
- const isApproachingLimit = hasLimit && usageRatio >= USAGE_APPROACHING_THRESHOLD
- const isExceededLimit = hasLimit && usageRatio >= 1
- const isCapped = usageMeta?.capped
-
- const onFreePlan = subscription?.plan?.name === 'Free'
-
- return (
-
- When you reach your database size limit, your project can go into read-only
- mode.{' '}
- {onFreePlan
- ? 'Please upgrade your Plan.'
- : 'Disable your spend cap to scale seamlessly and pay for over-usage beyond your Plans quota.'}
-
+ {currentBillingCycleSelected &&
+ subscription?.usage_billing_enabled === false &&
+ hasProjectsExceedingDiskSize && (
+
+
+ Projects exceeding quota
+
+ You have projects that are exceeding 8 GB of provisioned disk size, but do not
+ allow any overages with the Spend Cap on. Reduce the disk size or disable the
+ spend cap.
+
+
+ )}
+
+