BillingBreakdown.constants.ts181 lines · main
1import { PricingMetric } from '@/data/analytics/org-daily-stats-query'
2import { DOCS_URL } from '@/lib/constants'
3
4export const USAGE_APPROACHING_THRESHOLD = 0.8
5
6export interface Metric {
7 key: string
8 name: string
9 units: string
10 anchor?: string
11 category: string
12 unitName?: string
13 tip?: string
14 docLink?: {
15 title: string
16 url: string
17 }
18}
19
20export const BILLING_BREAKDOWN_METRICS: Metric[] = [
21 {
22 key: PricingMetric.DATABASE_SIZE,
23 name: 'Database Size',
24 units: 'bytes',
25 anchor: 'dbSize',
26 category: 'Database',
27 unitName: 'GB',
28 tip: 'Database size refers to the actual amount of space used by all your database objects, as reported by Postgres. This measurement reflects your current database size at this moment. Free Plan projects are limited to 0.5 GB Database Size each and are monitored across the entire billing period.',
29 },
30 {
31 key: PricingMetric.EGRESS,
32 name: 'Egress',
33 units: 'bytes',
34 anchor: 'egress',
35 category: 'Database',
36 unitName: 'GB',
37 },
38 {
39 key: PricingMetric.CACHED_EGRESS,
40 name: 'Cached Egress',
41 units: 'bytes',
42 anchor: 'cachedEgress',
43 category: 'Database',
44 unitName: 'GB',
45 },
46 {
47 key: PricingMetric.MONTHLY_ACTIVE_USERS,
48 name: 'Monthly Active Users',
49 units: 'absolute',
50 anchor: 'mau',
51 category: 'Authentication',
52 unitName: 'MAU',
53 },
54 {
55 key: PricingMetric.MONTHLY_ACTIVE_SSO_USERS,
56 name: 'Monthly Active SSO Users',
57 units: 'absolute',
58 anchor: 'mauSso',
59 category: 'Authentication',
60 unitName: 'MAU',
61 },
62 {
63 key: PricingMetric.MONTHLY_ACTIVE_THIRD_PARTY_USERS,
64 name: 'Monthly Active Third-Party Users',
65 units: 'absolute',
66 category: 'Authentication',
67 unitName: 'MAU',
68 },
69 {
70 key: PricingMetric.STORAGE_SIZE,
71 name: 'Storage Size',
72 units: 'bytes',
73 anchor: 'storageSize',
74 category: 'Storage',
75 unitName: 'GB',
76 },
77 {
78 key: PricingMetric.STORAGE_IMAGES_TRANSFORMED,
79 name: 'Storage Image Transformations',
80 units: 'absolute',
81 anchor: 'storageImageTransformations',
82 category: 'Storage',
83 },
84 {
85 key: PricingMetric.REALTIME_PEAK_CONNECTIONS,
86 name: 'Realtime Concurrent Peak Connections',
87 units: 'absolute',
88 anchor: 'realtimePeakConnections',
89 category: 'Realtime',
90 },
91 {
92 key: PricingMetric.REALTIME_MESSAGE_COUNT,
93 name: 'Realtime Messages',
94 units: 'absolute',
95 anchor: 'realtimeMessageCount',
96 category: 'Realtime',
97 },
98 {
99 key: PricingMetric.FUNCTION_INVOCATIONS,
100 name: 'Edge Function Invocations',
101 units: 'absolute',
102 anchor: 'funcInvocations',
103 category: 'Edge Functions',
104 },
105 {
106 key: PricingMetric.DISK_SIZE_GB_HOURS_GP3,
107 name: 'Disk Size',
108 anchor: 'diskSize',
109 units: 'absolute',
110 unitName: 'GB-Hrs',
111 category: 'Database',
112 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.',
113 docLink: {
114 title: 'Read more',
115 url: `${DOCS_URL}/guides/platform/manage-your-usage/disk-size`,
116 },
117 },
118 {
119 key: PricingMetric.DISK_SIZE_GB_HOURS_IO2,
120 name: 'Disk Size IO2',
121 anchor: 'diskSize',
122 units: 'absolute',
123 unitName: 'GB-Hrs',
124 category: 'Database',
125 },
126 {
127 key: PricingMetric.DISK_IOPS_IO2,
128 name: 'Disk IOPS IO2',
129 units: 'absolute',
130 unitName: 'IOPS-Hrs',
131 category: 'Database',
132 },
133 {
134 key: PricingMetric.DISK_IOPS_GP3,
135 name: 'Disk IOPS GP3',
136 units: 'absolute',
137 unitName: 'IOPS-Hrs',
138 category: 'Database',
139 },
140 {
141 key: PricingMetric.DISK_THROUGHPUT_GP3,
142 name: 'Disk Throughput',
143 units: 'absolute',
144 unitName: 'IOPS-Hrs',
145 category: 'Database',
146 },
147 {
148 key: PricingMetric.LOG_DRAIN_EVENTS,
149 name: 'Log Drain Events',
150 units: 'absolute',
151 category: 'Database',
152 },
153 {
154 key: PricingMetric.LOG_INGESTION,
155 name: 'Log Ingestion',
156 units: 'bytes',
157 category: 'Logs',
158 anchor: 'logIngestion',
159 },
160 {
161 key: PricingMetric.LOG_QUERYING,
162 name: 'Log Query',
163 units: 'bytes',
164 category: 'Logs',
165 anchor: 'logQuery',
166 },
167 {
168 key: PricingMetric.LOG_STORAGE,
169 name: 'Log Storage',
170 units: 'bytes',
171 category: 'Logs',
172 anchor: 'logStorage',
173 },
174 {
175 key: PricingMetric.ACTIVE_COMPUTE_HOURS,
176 name: 'Active Compute Hours',
177 units: 'absolute',
178 category: 'compute',
179 anchor: 'active-compute',
180 },
181]