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(desktop): gate cloud compute billing details (#80818)

Adam Bowkerd191a1a69151
diff --git a/products/desktop/packages/shared/src/flags.ts b/products/desktop/packages/shared/src/flags.ts
index c644bd5bd140..226d1191274b 100644
--- a/products/desktop/packages/shared/src/flags.ts
+++ b/products/desktop/packages/shared/src/flags.ts
@@ -1,4 +1,6 @@
export const BILLING_FLAG = "posthog-code-billing";
+export const CLOUD_COMPUTE_BILLING_FLAG =
+ "posthog-desktop-cloud-compute-billing";
export const SPEND_ANALYSIS_FLAG = "posthog-code-spend-analysis";
export const EXPERIMENT_SUGGESTIONS_FLAG =
"posthog-code-experiment-suggestions";
diff --git a/products/desktop/packages/ui/src/features/settings/sections/PlanUsageSettings.stories.tsx b/products/desktop/packages/ui/src/features/settings/sections/PlanUsageSettings.stories.tsx
index 132890798c85..53501a879d94 100644
--- a/products/desktop/packages/ui/src/features/settings/sections/PlanUsageSettings.stories.tsx
+++ b/products/desktop/packages/ui/src/features/settings/sections/PlanUsageSettings.stories.tsx
@@ -44,6 +44,7 @@ const meta: Meta<typeof PlanUsageContent> = {
],
args: {
billingEnabled: true,
+ cloudComputeEnabled: true,
spendAnalysisEnabled: true,
billingUrl: "https://app.posthog.com/organization/billing",
usage,
@@ -56,6 +57,13 @@ type Story = StoryObj<typeof PlanUsageContent>;
export const WithComponentBreakdown: Story = {};
+export const CloudComputeDisabled: Story = {
+ args: {
+ cloudComputeEnabled: false,
+ spendAnalysisEnabled: false,
+ },
+};
+
export const BreakdownAwaitingData: Story = {
args: {
spendAnalysisEnabled: false,
diff --git a/products/desktop/packages/ui/src/features/settings/sections/PlanUsageSettings.tsx b/products/desktop/packages/ui/src/features/settings/sections/PlanUsageSettings.tsx
index ca4c812b1520..61f016618773 100644
--- a/products/desktop/packages/ui/src/features/settings/sections/PlanUsageSettings.tsx
+++ b/products/desktop/packages/ui/src/features/settings/sections/PlanUsageSettings.tsx
@@ -21,7 +21,7 @@ import {
EmptyMedia,
EmptyTitle,
} from "@posthog/quill";
-import { BILLING_FLAG } from "@posthog/shared";
+import { BILLING_FLAG, CLOUD_COMPUTE_BILLING_FLAG } from "@posthog/shared";
import { ANALYTICS_EVENTS } from "@posthog/shared/analytics-events";
import { useAuthStateValue } from "@posthog/ui/features/auth/store";
import { UsageMeter } from "@posthog/ui/features/billing/UsageMeter";
@@ -38,6 +38,7 @@ import { type ReactNode, useEffect, useState } from "react";
export function PlanUsageSettings() {
const billingEnabled = useFeatureFlag(BILLING_FLAG);
+ const cloudComputeEnabled = useFeatureFlag(CLOUD_COMPUTE_BILLING_FLAG);
const spendAnalysisEnabled = useSpendAnalysisEnabled();
const cloudRegion = useAuthStateValue((state) => state.cloudRegion);
const billingUrl = getBillingUrl(cloudRegion);
@@ -64,6 +65,7 @@ export function PlanUsageSettings() {
return (
<PlanUsageContent
billingEnabled={billingEnabled}
+ cloudComputeEnabled={cloudComputeEnabled}
spendAnalysisEnabled={spendAnalysisEnabled}
billingUrl={billingUrl}
usage={usage}
@@ -75,6 +77,7 @@ export function PlanUsageSettings() {
interface PlanUsageContentProps {
billingEnabled: boolean;
+ cloudComputeEnabled: boolean;
spendAnalysisEnabled: boolean;
billingUrl: string | null | undefined;
usage: UsageOutput | null | undefined;
@@ -84,6 +87,7 @@ interface PlanUsageContentProps {
export function PlanUsageContent({
billingEnabled,
+ cloudComputeEnabled,
spendAnalysisEnabled,
billingUrl,
usage,
@@ -227,7 +231,9 @@ export function PlanUsageContent({
)}
{!usageLoading && (
<Flex direction="column" gap="3">
- {hasUsageMix && <UsageMix components={components} />}
+ {cloudComputeEnabled && hasUsageMix && (
+ <UsageMix components={components} />
+ )}
<Text className="text-[12px] text-gray-10">
Usage reporting may be delayed by 15–20 minutes.
</Text>