Skip to content

: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.

fix(billing): align limit threshold UI (#86932)

Pawel Cebula583d1d3e339a
diff --git a/ee/hogai/tools/read_billing_tool/prompts.py b/ee/hogai/tools/read_billing_tool/prompts.py
index e446d7d6b54e..865c7590b380 100644
--- a/ee/hogai/tools/read_billing_tool/prompts.py
+++ b/ee/hogai/tools/read_billing_tool/prompts.py
@@ -58,7 +58,7 @@ The user's current project is {{current_team_name}} (ID: {{current_team_id}}).
{{/description}}
- Current usage: {{current_usage}}{{#usage_limit}} of {{usage_limit}} limit{{/usage_limit}} ({{percentage_usage}}% of limit)
{{#has_exceeded_limit}}
-- ⚠️ Usage limit exceeded
+- ⚠️ Usage limit reached
{{/has_exceeded_limit}}
{{#custom_limit_usd}}
- Custom spending limit: ${{custom_limit_usd}}
diff --git a/ee/hogai/tools/read_billing_tool/test/test_nodes.py b/ee/hogai/tools/read_billing_tool/test/test_nodes.py
index f478d1e90584..b45d7391ad25 100644
--- a/ee/hogai/tools/read_billing_tool/test/test_nodes.py
+++ b/ee/hogai/tools/read_billing_tool/test/test_nodes.py
@@ -395,8 +395,8 @@ class TestBillingNode(ClickhouseTestMixin, NonAtomicBaseTest):
# Check None values are handled - when current_usage is None, it shows empty
self.assertIn("Current usage: (1.5% of limit)", formatted_string)
- # Check exceeded limit warning
- self.assertIn("⚠️ Usage limit exceeded", formatted_string)
+ # Check at/over limit warning
+ self.assertIn("⚠️ Usage limit reached", formatted_string)
async def test_format_billing_context_complete_template_coverage(self):
"""Test all possible template variables are covered"""
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index a8dedd063047..be9cb7dac0b5 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -5553,9 +5553,9 @@ snapshots:
replay-tabs-home-failure--not-found--light:
hash: v1.k794b7964.68ea14164788313df082ab6a0376077a82369dbdb3365ce8427640ad453aa9d6.laeHUCIfmZ8CHubdHCTK_PaLsSGS3XkBTsQRSma6qoE
replay-tabs-home-filters-banner--product-analytics-over-limit--dark:
- hash: v1.k794b7964.3382cb9fbf56647bce20e824f37190da01c7e832174672c646a328301637e1fa.ZpMkQP_H9a6yc7qYnEIHtAxfN4jHWRPD4virSf2vGIA
+ hash: v1.k794b7964.6419b76d333a64f252a9fe748e5126f24a45c5ef281ee5f244bee651d8732d5b.uq-8FJ0MflN3hPv_ZAsPCd6wVw2NpRKB_UZUBKyLOb8
replay-tabs-home-filters-banner--product-analytics-over-limit--light:
- hash: v1.k794b7964.e823d52c061aef0eab23e4b0571a4984943c45287c8ba261120cdf04e250e159.mkuxfj4jLQSeTxcvoBtZsyh1m_7-3pWLo39IaakQcGo
+ hash: v1.k794b7964.0119a627014451bb9c8930ca63913f0f92dfe56fc31415b84c815508dcde9b7a.P68BvqI6ZaeBJA3VqL_eybiB4wfcC0rA9Z8UXH3uXDw
replay-tabs-home-filters-banner--product-analytics-under-limit--dark:
hash: v1.k794b7964.9621e94ace22f6b0c839d8f7890e3cdf4aa9951c7bfee8f2a089e46a5f7f977a.dZbjaDtE-CMiMTkhTxV1u5NVSvEugAeaZ5oBS64HcH4
replay-tabs-home-filters-banner--product-analytics-under-limit--light:
diff --git a/frontend/src/layout/navigation/projectNoticeLogic.test.tsx b/frontend/src/layout/navigation/projectNoticeLogic.test.tsx
index 913c543e3176..c6150c8b2bb9 100644
--- a/frontend/src/layout/navigation/projectNoticeLogic.test.tsx
+++ b/frontend/src/layout/navigation/projectNoticeLogic.test.tsx
@@ -379,5 +379,84 @@ describe('projectNoticeLogic', () => {
logic.unmount()
billingLogic.unmount()
})
+
+ it.each([
+ ['billing root', urls.organizationBilling()],
+ ['billing overview', urls.organizationBillingSection('overview')],
+ ])('hides generic billing alert CTAs on the %s page with checkout query params', (_, billingPath) => {
+ router.actions.push(billingPath, { success: 'true' })
+ billingLogic.mount()
+ const logic = projectNoticeLogic()
+ logic.mount()
+
+ billingLogic.actions.setBillingAlert({
+ status: 'error',
+ title: 'Usage limit reached',
+ message: 'You have reached a usage limit.',
+ })
+
+ expect(logic.values.projectNoticeVariant).toBe('billing_alert')
+ expect(logic.values.projectNotice?.action).toBeUndefined()
+
+ logic.unmount()
+ billingLogic.unmount()
+ })
+
+ it.each([
+ ['billing root', urls.organizationBilling()],
+ ['billing overview', urls.organizationBillingSection('overview')],
+ ])('hides single-product billing alert CTAs when the current %s URL targets that product', (_, billingPath) => {
+ router.actions.push(billingPath, {
+ products: ProductKey.PRODUCT_ANALYTICS,
+ success: 'true',
+ })
+ billingLogic.mount()
+ const logic = projectNoticeLogic()
+ logic.mount()
+
+ billingLogic.actions.setBillingAlert({
+ status: 'error',
+ title: 'Usage limit reached',
+ message: 'You have reached the usage limit for Product analytics.',
+ productKey: ProductKey.PRODUCT_ANALYTICS,
+ })
+
+ expect(logic.values.projectNoticeVariant).toBe('billing_alert')
+ expect(logic.values.projectNotice?.action).toBeUndefined()
+
+ logic.unmount()
+ billingLogic.unmount()
+ })
+
+ it.each([
+ ['billing root', urls.organizationBilling()],
+ ['billing overview', urls.organizationBillingSection('overview')],
+ ])(
+ 'keeps single-product billing alert CTAs when the current %s URL does not target that product',
+ (_, billingPath) => {
+ router.actions.push(billingPath, { success: 'true' })
+ billingLogic.mount()
+ const logic = projectNoticeLogic()
+ logic.mount()
+
+ billingLogic.actions.setBillingAlert({
+ status: 'error',
+ title: 'Usage limit reached',
+ message: 'You have reached the usage limit for Product analytics.',
+ productKey: ProductKey.PRODUCT_ANALYTICS,
+ })
+
+ expect(logic.values.projectNoticeVariant).toBe('billing_alert')
+ expect(logic.values.projectNotice?.action).toEqual(
+ expect.objectContaining({
+ to: urls.organizationBilling([ProductKey.PRODUCT_ANALYTICS]),
+ children: 'Manage billing',
+ })
+ )
+
+ logic.unmount()
+ billingLogic.unmount()
+ }
+ )
})
})
diff --git a/frontend/src/layout/navigation/projectNoticeLogic.tsx b/frontend/src/layout/navigation/projectNoticeLogic.tsx
index f78c584e3ab2..6b1ab94bee9a 100644
--- a/frontend/src/layout/navigation/projectNoticeLogic.tsx
+++ b/frontend/src/layout/navigation/projectNoticeLogic.tsx
@@ -157,14 +157,43 @@ function getBillingAlertBillingUrl(billingAlert: BillingAlertConfig): string {
return urls.organizationBilling(billingAlert.productKey ? [billingAlert.productKey] : undefined)
}
+function isBillingPathname(pathname: string): boolean {
+ const billingPathname = urls.organizationBilling()
+
+ return pathname === billingPathname || pathname.startsWith(`${billingPathname}/`)
+}
+
+function isCurrentBillingAlertBillingUrl(
+ billingAlert: BillingAlertConfig,
+ currentLocation: { pathname: string; searchParams: Record<string, any> }
+): boolean {
+ if (!isBillingPathname(currentLocation.pathname)) {
+ return false
+ }
+
+ if (!billingAlert.productKey) {
+ return true
+ }
+
+ const productsParam = currentLocation.searchParams.products
+ const productKeys = Array.isArray(productsParam)
+ ? productsParam
+ : typeof productsParam === 'string'
+ ? productsParam.split(',')
+ : []
+
+ return productKeys.includes(billingAlert.productKey)
+}
+
function buildBillingAlertNotice(
billingAlert: BillingAlertConfig,
canAccessBilling: boolean,
- currentLocation: { pathname: string; search: string }
+ currentLocation: { pathname: string; searchParams: Record<string, any> }
): ProjectNoticeBlueprint {
- const currentUrl = `${currentLocation.pathname}${currentLocation.search}`
const showButton =
- billingAlert.action || billingAlert.contactSupport || currentUrl !== getBillingAlertBillingUrl(billingAlert)
+ billingAlert.action ||
+ billingAlert.contactSupport ||
+ !isCurrentBillingAlertBillingUrl(billingAlert, currentLocation)
const action = buildBillingAlertAction(billingAlert, canAccessBilling)
return {
diff --git a/frontend/src/scenes/billing/BillingGauge.tsx b/frontend/src/scenes/billing/BillingGauge.tsx
index 06461b665b64..adaee8c30893 100644
--- a/frontend/src/scenes/billing/BillingGauge.tsx
+++ b/frontend/src/scenes/billing/BillingGauge.tsx
@@ -7,7 +7,12 @@ import { Tooltip } from 'lib/lemon-ui/Tooltip'
import { BillingProductV2AddonType, BillingProductV2Type } from '~/types'
-import { createProductValueFormatter, formatDisplayUsage, hasDisplayFormatting } from './billing-utils'
+import {
+ createProductValueFormatter,
+ formatDisplayUsage,
+ hasDisplayFormatting,
+ isUsageAtOrOverLimit,
+} from './billing-utils'
import { BillingGaugeItemType } from './types'
/*
@@ -74,7 +79,7 @@ export function BillingGauge({ items, product }: BillingGaugeProps): JSX.Element
const maxValue = useMemo(() => {
return Math.max(100, ...items.map((item) => item.value)) * 1.3
}, [items])
- const isWithinUsageLimit = (product.percentage_usage ?? 0) <= 1
+ const isWithinUsageLimit = !isUsageAtOrOverLimit(product.percentage_usage)
const sortedItems = useMemo(() => {
return [...items].sort((a, b) => a.value - b.value)
diff --git a/frontend/src/scenes/billing/BillingProduct.tsx b/frontend/src/scenes/billing/BillingProduct.tsx
index 522fd6de8352..6817a07689f2 100644
--- a/frontend/src/scenes/billing/BillingProduct.tsx
+++ b/frontend/src/scenes/billing/BillingProduct.tsx
@@ -24,6 +24,7 @@ import {
createGaugeItems,
createProductValueFormatter,
getProductUnitLabel,
+ isUsageAtOrOverLimit,
isProductVariantPrimary,
} from './billing-utils'
import { BillingGauge } from './BillingGauge'
@@ -225,10 +226,10 @@ export const BillingProduct = ({ product }: { product: BillingProductV2Type }):
</div>
</div>
<div className="px-8 pb-8 sm:pb-0">
- {/* Exceeded limit notice */}
- {product.percentage_usage > 1 && (
+ {/* Reached limit notice */}
+ {isUsageAtOrOverLimit(product.percentage_usage) && (
<LemonBanner className="mt-6" type="error">
- You have exceeded the {hasCustomLimitSet ? 'billing limit' : 'free tier limit'} for this
+ You have reached the {hasCustomLimitSet ? 'billing limit' : 'free tier limit'} for this
product.
</LemonBanner>
)}
diff --git a/frontend/src/scenes/billing/billing-utils.spec.ts b/frontend/src/scenes/billing/billing-utils.spec.ts
index b7816b9afdef..d1e36ac19805 100644
--- a/frontend/src/scenes/billing/billing-utils.spec.ts
+++ b/frontend/src/scenes/billing/billing-utils.spec.ts
@@ -23,6 +23,8 @@ import {
getProration,
getUsageLimitConsequence,
isMemberUsageSpendReadAccessEnabled,
+ isUsageApproachingLimit,
+ isUsageAtOrOverLimit,
projectUsage,
summarizeUsage,
} from './billing-utils'
@@ -40,6 +42,23 @@ describe('summarizeUsage', () => {
})
})
+describe('usage limit thresholds', () => {
+ it('treats exactly 100% usage as at the limit', () => {
+ expect(isUsageAtOrOverLimit(null)).toBe(false)
+ expect(isUsageAtOrOverLimit(undefined)).toBe(false)
+ expect(isUsageAtOrOverLimit(0.99)).toBe(false)
+ expect(isUsageAtOrOverLimit(1)).toBe(true)
+ expect(isUsageAtOrOverLimit(1.01)).toBe(true)
+ })
+
+ it('only treats usage below 100% as approaching the limit', () => {
+ expect(isUsageApproachingLimit(0.8, 0.8)).toBe(false)
+ expect(isUsageApproachingLimit(0.81, 0.8)).toBe(true)
+ expect(isUsageApproachingLimit(1, 0.8)).toBe(false)
+ expect(isUsageApproachingLimit(1.01, 0.8)).toBe(false)
+ })
+})
+
describe('projectUsage', () => {
beforeEach(() => {
tk.freeze(new Date('2022-01-01'))
diff --git a/frontend/src/scenes/billing/billing-utils.ts b/frontend/src/scenes/billing/billing-utils.ts
index 13bb4736c464..69d74b3451b2 100644
--- a/frontend/src/scenes/billing/billing-utils.ts
+++ b/frontend/src/scenes/billing/billing-utils.ts
@@ -97,6 +97,14 @@ export const summarizeUsage = (usage: number | null): string => {
return compactNumber(usage)
}
+export const isUsageAtOrOverLimit = (percentageUsage: number | null | undefined): boolean => {
+ return (percentageUsage ?? 0) >= 1
+}
+
+export const isUsageApproachingLimit = (percentageUsage: number | null | undefined, threshold: number): boolean => {
+ return (percentageUsage ?? 0) > threshold && !isUsageAtOrOverLimit(percentageUsage)
+}
+
/**
* Check if a product has display formatting configured.
*/
diff --git a/frontend/src/scenes/billing/billingLogic.test.ts b/frontend/src/scenes/billing/billingLogic.test.ts
index ce001fcb8266..184035f85fb2 100644
--- a/frontend/src/scenes/billing/billingLogic.test.ts
+++ b/frontend/src/scenes/billing/billingLogic.test.ts
@@ -136,6 +136,19 @@ describe('billingLogic', () => {
message: expect.stringContaining('You have reached the usage limit for Product analytics.'),
productKey: ProductKey.PRODUCT_ANALYTICS,
})
+ expect(billingLogic.values.isProductAtOrOverUsageLimit(ProductKey.PRODUCT_ANALYTICS)).toBe(true)
+ })
+
+ it('does not treat usage below 100% as at the product limit', async () => {
+ billingState = billingWithProducts([productWithUsage(0.99)])
+ billingLogic.mount()
+ await expectLogic(preflightLogic).toFinishAllListeners()
+
+ await expectLogic(billingLogic, () => {
+ billingLogic.actions.loadBilling()
+ }).toFinishAllListeners()
+
+ expect(billingLogic.values.isProductAtOrOverUsageLimit(ProductKey.PRODUCT_ANALYTICS)).toBe(false)
})
it('clears a stale usage limit alert when refreshed billing data no longer qualifies', async () => {
diff --git a/frontend/src/scenes/billing/billingLogic.tsx b/frontend/src/scenes/billing/billingLogic.tsx
index 43f21e82e14f..d5f9c5ada7af 100644
--- a/frontend/src/scenes/billing/billingLogic.tsx
+++ b/frontend/src/scenes/billing/billingLogic.tsx
@@ -41,6 +41,8 @@ import {
canViewUsageAndSpend as canViewUsageAndSpendUtil,
getMinimumBillingAccessLevel,
getMinimumUsageSpendReadAccessLevel,
+ isUsageApproachingLimit,
+ isUsageAtOrOverLimit,
isMemberUsageSpendReadAccessEnabled,
} from './billing-utils'
import { DEFAULT_ESTIMATED_MONTHLY_CREDIT_AMOUNT_USD } from './CreditCTAHero'
@@ -262,7 +264,7 @@ export interface billingLogicValues {
isCreditFormValid: boolean
isManagedAccount: boolean
isOnboarding: boolean
- isProductOverUsageLimit: (productKey: ProductKey) => boolean
+ isProductAtOrOverUsageLimit: (productKey: ProductKey) => boolean
isPurchaseCreditsModalOpen: boolean
isUnlicensedDebug: boolean
minimumBillingAccessLevel: OrganizationMembershipLevel
@@ -650,7 +652,7 @@ export interface billingLogicMeta {
startupProgramLabelCurrent: (billing: BillingType | null) => StartupProgramLabel | null
startupProgramLabelPrevious: (billing: BillingType | null) => StartupProgramLabel | null
isAnnualPlanCustomer: (billing: BillingType | null) => boolean
- isProductOverUsageLimit: (billing: BillingType | null) => (productKey: ProductKey) => boolean
+ isProductAtOrOverUsageLimit: (billing: BillingType | null) => (productKey: ProductKey) => boolean
billingPeriodUTC: (billing: BillingType | null) => BillingPeriod
showBillingSummary: (billing: BillingType | null, isOnboarding: boolean) => boolean
showCreditCTAHero: (creditOverview: {
@@ -1204,12 +1206,12 @@ export const billingLogic = kea<billingLogicType>([
(s) => [s.billing],
(billing: BillingType | null): boolean => billing?.is_annual_plan_customer || false,
],
- isProductOverUsageLimit: [
+ isProductAtOrOverUsageLimit: [
(s) => [s.billing],
(billing: BillingType | null): ((productKey: ProductKey) => boolean) =>
(productKey: ProductKey): boolean => {
const product = billing?.products?.find((p) => p.type === productKey)
- return (product?.percentage_usage ?? 0) > 1
+ return isUsageAtOrOverLimit(product?.percentage_usage)
},
],
billingPeriodUTC: [
@@ -1495,7 +1497,7 @@ export const billingLogic = kea<billingLogicType>([
const productsAtOrOverLimit =
values.billing.products?.filter((x: BillingProductV2Type) => {
- if (x.percentage_usage < 1 || !x.usage_key) {
+ if (!isUsageAtOrOverLimit(x.percentage_usage) || !x.usage_key) {
return false
}
const hideProductFlag = `billing_hide_product_${x.type}`
@@ -1540,7 +1542,7 @@ export const billingLogic = kea<billingLogicType>([
const productsApproachingLimit =
values.billing.products?.filter((x: BillingProductV2Type) => {
- if (x.percentage_usage <= ALLOCATION_THRESHOLD_ALERT || x.percentage_usage >= 1) {
+ if (!isUsageApproachingLimit(x.percentage_usage, ALLOCATION_THRESHOLD_ALERT)) {
return false
}
const hideProductFlag = `billing_hide_product_${x.type}`
diff --git a/frontend/src/scenes/max/maxBillingContextLogic.test.ts b/frontend/src/scenes/max/maxBillingContextLogic.test.ts
index 90f278450b45..f21a104c5811 100644
--- a/frontend/src/scenes/max/maxBillingContextLogic.test.ts
+++ b/frontend/src/scenes/max/maxBillingContextLogic.test.ts
@@ -353,7 +353,7 @@ describe('maxBillingContextLogic', () => {
name: 'Product Analytics',
description: 'Analyze user behavior',
is_used: true,
- has_exceeded_limit: false, // percentage_usage = 1.0 means at limit, not exceeded
+ has_exceeded_limit: true, // billing treats percentage_usage = 1.0 as at the limit
current_usage: 1000000,
usage_limit: 1000000,
percentage_usage: 1.0,
@@ -383,7 +383,7 @@ describe('maxBillingContextLogic', () => {
name: 'Session Replay',
description: 'Record user sessions',
is_used: true,
- has_exceeded_limit: false, // percentage_usage = 1.0 means at limit, not exceeded
+ has_exceeded_limit: true, // billing treats percentage_usage = 1.0 as at the limit
current_usage: 5000,
usage_limit: 15000, // From first tier
percentage_usage: 1.0,
diff --git a/frontend/src/scenes/max/maxBillingContextLogic.tsx b/frontend/src/scenes/max/maxBillingContextLogic.tsx
index 8d668333a93f..b924556b1e99 100644
--- a/frontend/src/scenes/max/maxBillingContextLogic.tsx
+++ b/frontend/src/scenes/max/maxBillingContextLogic.tsx
@@ -3,7 +3,7 @@ import { objectsEqual } from 'kea-test-utils'
import { dayjs } from 'lib/dayjs'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
-import { isAddonVisible } from 'scenes/billing/billing-utils'
+import { isAddonVisible, isUsageAtOrOverLimit } from 'scenes/billing/billing-utils'
import { billingLogic } from 'scenes/billing/billingLogic'
import { BillingSpendResponse, billingSpendLogic } from 'scenes/billing/billingSpendLogic'
import { BillingUsageResponse, billingUsageLogic } from 'scenes/billing/billingUsageLogic'
@@ -181,7 +181,7 @@ export const billingToMaxContext = (
name: addon.name,
description: addon.description || '',
is_used: (addon.current_usage || 0) > 0,
- has_exceeded_limit: (addon.percentage_usage || 0) > 1,
+ has_exceeded_limit: isUsageAtOrOverLimit(addon.percentage_usage),
current_usage: addon.current_usage || 0,
usage_limit: addon.usage_limit,
percentage_usage: addon.percentage_usage,
@@ -194,7 +194,7 @@ export const billingToMaxContext = (
name: product.name,
description: product.description || '',
is_used: (product.current_usage || 0) > 0,
- has_exceeded_limit: product.percentage_usage > 1,
+ has_exceeded_limit: isUsageAtOrOverLimit(product.percentage_usage),
current_usage: product.current_usage,
usage_limit: product.usage_limit,
percentage_usage: product.percentage_usage || 0,
diff --git a/frontend/src/scenes/session-recordings/filters/ProductAnalyticsOverLimitBanner.tsx b/frontend/src/scenes/session-recordings/filters/ProductAnalyticsOverLimitBanner.tsx
index d00745e467cd..df5f6d29270d 100644
--- a/frontend/src/scenes/session-recordings/filters/ProductAnalyticsOverLimitBanner.tsx
+++ b/frontend/src/scenes/session-recordings/filters/ProductAnalyticsOverLimitBanner.tsx
@@ -9,9 +9,9 @@ import { urls } from 'scenes/urls'
import { ProductKey } from '~/queries/schema/schema-general'
export function ProductAnalyticsOverLimitBanner(): JSX.Element | null {
- const { isProductOverUsageLimit } = useValues(billingLogic)
+ const { isProductAtOrOverUsageLimit } = useValues(billingLogic)
- if (!isProductOverUsageLimit(ProductKey.PRODUCT_ANALYTICS)) {
+ if (!isProductAtOrOverUsageLimit(ProductKey.PRODUCT_ANALYTICS)) {
return null
}
@@ -26,8 +26,8 @@ export function ProductAnalyticsOverLimitBanner(): JSX.Element | null {
'data-attr': 'replay-filters-pa-over-limit-banner-cta',
}}
>
- Session recordings are filtered using your events. While you're over the Product analytics limit, new
- events aren't processed — so recent recordings may not show up when you filter.{' '}
+ Session recordings are filtered using your events. While you've reached the Product analytics limit, new
+ events aren't processed, so recent recordings may not show up when you filter.{' '}
<Link
to="https://posthog.com/docs/session-replay/troubleshooting#unable-to-filter-by-user-or-page-properties"
target="_blank"
diff --git a/products/replay_vision/frontend/components/IngestionLimitBanner.tsx b/products/replay_vision/frontend/components/IngestionLimitBanner.tsx
index 32e58ea918ac..17cfb9157a20 100644
--- a/products/replay_vision/frontend/components/IngestionLimitBanner.tsx
+++ b/products/replay_vision/frontend/components/IngestionLimitBanner.tsx
@@ -12,19 +12,19 @@ import { visionQuotaLogic } from '../logics/visionQuotaLogic'
export function IngestionLimitBanner(): JSX.Element | null {
// visionQuotaLogic triggers the billing load; billingLogic doesn't self-load on mount.
useMountedLogic(visionQuotaLogic)
- const { isProductOverUsageLimit } = useValues(billingLogic)
+ const { isProductAtOrOverUsageLimit } = useValues(billingLogic)
- const eventsLimited = isProductOverUsageLimit(ProductKey.PRODUCT_ANALYTICS)
- const recordingsLimited = isProductOverUsageLimit(ProductKey.SESSION_REPLAY)
+ const eventsLimited = isProductAtOrOverUsageLimit(ProductKey.PRODUCT_ANALYTICS)
+ const recordingsLimited = isProductAtOrOverUsageLimit(ProductKey.SESSION_REPLAY)
if (!eventsLimited && !recordingsLimited) {
return null
}
const message =
eventsLimited && recordingsLimited
- ? 'Your organization is over its Product analytics and Session replay limits, so new events and recordings may not be captured. Scanners may have nothing new to scan until the limits are raised.'
+ ? 'Your organization has reached its Product analytics and Session replay limits, so new events and recordings may not be captured. Scanners may have nothing new to scan until the limits are raised.'
: eventsLimited
- ? 'Your organization is over its Product analytics limit, so new events may not be captured. Sessions without event data are marked ineligible when scanned.'
- : 'Your organization is over its Session replay limit, so new recordings may not be captured. Scanners may have nothing new to scan until the limit is raised.'
+ ? 'Your organization has reached its Product analytics limit, so new events may not be captured. Sessions without event data are marked ineligible when scanned.'
+ : 'Your organization has reached its Session replay limit, so new recordings may not be captured. Scanners may have nothing new to scan until the limit is raised.'
return (
<LemonBanner type="warning">
{message} <Link to={urls.organizationBilling()}>Manage billing limits</Link>