11import { numberFormatter } from 'components/ui/Charts/Charts.utils'
22import { formatBytes } from 'lib/helpers'
3- import { Organization } from '../../ types'
3+ import { Organization } from 'types'
44import { Project } from '../projects/project-detail-query'
5+ import { ReportAttributes } from 'components/ui/Charts/ComposedChart.utils'
56
67export const getReportAttributes = ( isFreePlan : boolean ) => [
78 { id : 'ram_usage' , label : 'Memory usage' , hide : false } ,
@@ -26,7 +27,10 @@ export const getReportAttributes = (isFreePlan: boolean) => [
2627 } ,
2728]
2829
29- export const getReportAttributesV2 = ( org : Organization , project : Project ) => {
30+ export const getReportAttributesV2 : ( org : Organization , project : Project ) => ReportAttributes [ ] = (
31+ org ,
32+ project
33+ ) => {
3034 const isFreePlan = org ?. plan ?. id === 'free'
3135 const computeSize = project ?. infra_compute_size || 'medium'
3236 const isSpendCapEnabled =
@@ -46,7 +50,7 @@ export const getReportAttributesV2 = (org: Organization, project: Project) => {
4650 syncId : 'database-reports' ,
4751 valuePrecision : 2 ,
4852 YAxisProps : {
49- width : 60 ,
53+ width : 75 ,
5054 tickFormatter : ( value : any ) => formatBytes ( value , 2 ) ,
5155 } ,
5256 attributes : [
@@ -226,8 +230,8 @@ export const getReportAttributesV2 = (org: Organization, project: Project) => {
226230 ] ,
227231 } ,
228232 {
229- id : 'db -size' ,
230- label : 'Database Size' ,
233+ id : 'disk -size' ,
234+ label : 'Disk Size' ,
231235 syncId : 'database-reports' ,
232236 valuePrecision : 2 ,
233237 hide : false ,
@@ -243,19 +247,36 @@ export const getReportAttributesV2 = (org: Organization, project: Project) => {
243247 defaultChartStyle : 'line' ,
244248 docsUrl : 'https://supabase.com/docs/guides/platform/database-size' ,
245249 attributes : [
250+ {
251+ attribute : 'disk_fs_used_system' ,
252+ provider : 'infra-monitoring' ,
253+ format : 'bytes' ,
254+ label : 'System' ,
255+ tooltip : 'Reserved space for the system to ensure your database runs smoothly.' ,
256+ } ,
257+ {
258+ attribute : 'disk_fs_used_wal' ,
259+ provider : 'infra-monitoring' ,
260+ format : 'bytes' ,
261+ label : 'WAL' ,
262+ tooltip :
263+ 'Disk usage by the write-ahead log. The usage depends on your WAL settings and the amount of data being written to the database.' ,
264+ } ,
265+
246266 {
247267 attribute : 'pg_database_size' ,
248268 provider : 'infra-monitoring' ,
269+ format : 'bytes' ,
249270 label : 'Database' ,
250- tooltip : 'Total space on disk used by your database (tables, indexes, data, ...).' ,
271+ tooltip : 'Disk usage by your database (tables, indexes, data, ...).' ,
251272 } ,
252273 {
253- attribute : 'max_pg_database_size' ,
254- provider : 'reference-line' ,
255- label : 'Disk size' ,
256- value : ( project ?. volumeSizeGb || getRecommendedDbSize ( computeSize ) ) * 1024 * 1024 * 1024 ,
257- tooltip : 'Disk Size refers to the total space your project occupies on disk' ,
274+ attribute : 'disk_fs_size' ,
275+ provider : 'infra-monitoring' ,
258276 isMaxValue : true ,
277+ format : 'bytes' ,
278+ label : 'Disk Size' ,
279+ tooltip : 'Disk Size refers to the total space your project occupies on disk' ,
259280 } ,
260281 ! isFreePlan &&
261282 ( isSpendCapEnabled
@@ -304,20 +325,21 @@ export const getReportAttributesV2 = (org: Organization, project: Project) => {
304325 showTotal : false ,
305326 attributes : [
306327 {
307- attribute : 'network_transmit_bytes ' ,
328+ attribute : 'network_receive_bytes ' ,
308329 provider : 'infra-monitoring' ,
309- label : 'Transmit' ,
330+ label : 'Ingress' ,
331+ manipulateValue : ( value : number ) => value * - 1 ,
310332 tooltip :
311- 'Data sent from your database to clients. High values may indicate large query results or numerous outgoing connections.' ,
312- stackId : '2 ' ,
333+ 'Data received by your database from clients. High values may indicate frequent queries, large data inserts, or many incoming connections.' ,
334+ stackId : '1 ' ,
313335 } ,
314336 {
315- attribute : 'network_receive_bytes ' ,
337+ attribute : 'network_transmit_bytes ' ,
316338 provider : 'infra-monitoring' ,
317- label : 'Receive ' ,
339+ label : 'Egress ' ,
318340 tooltip :
319- 'Data received by your database from clients. High values may indicate frequent queries, large data inserts, or many incoming connections.' ,
320- stackId : '1 ' ,
341+ 'Data sent from your database to clients. High values may indicate large query results or numerous outgoing connections.' ,
342+ stackId : '2 ' ,
321343 } ,
322344 ] ,
323345 } ,
@@ -335,44 +357,49 @@ export const getReportAttributesV2 = (org: Organization, project: Project) => {
335357 {
336358 attribute : 'client_connections_postgres' ,
337359 provider : 'infra-monitoring' ,
338- label : 'postgres' ,
339- tooltip : 'Active connections' ,
360+ label : 'Postgres' ,
361+ tooltip :
362+ 'Direct connections to the Postgres database from your application and external clients.' ,
340363 } ,
341364 {
342365 attribute : 'client_connections_authenticator' ,
343366 provider : 'infra-monitoring' ,
344- label : 'postgrest ' ,
345- tooltip : 'Active connections ' ,
367+ label : 'PostgREST ' ,
368+ tooltip : 'Connections magaged by PostgREST to auto-generate RESTful API. ' ,
346369 } ,
347370 {
348- attribute : 'client_connections_supabase_auth_admin ' ,
371+ attribute : 'client_connections_supabase_admin ' ,
349372 provider : 'infra-monitoring' ,
350- label : 'auth' ,
351- tooltip : 'Active connections' ,
373+ label : 'Admin' ,
374+ tooltip :
375+ 'Administrative connections used by various Supabase services for internal operations and maintenance tasks.' ,
352376 } ,
353377 {
354- attribute : 'client_connections_supabase_storage_admin ' ,
378+ attribute : 'client_connections_supabase_auth_admin ' ,
355379 provider : 'infra-monitoring' ,
356- label : 'storage' ,
357- tooltip : 'Active connections' ,
380+ label : 'Auth' ,
381+ tooltip :
382+ 'Administrative connections used by Supabase Auth service for user management and authentication operations.' ,
358383 } ,
359384 {
360- attribute : 'client_connections_supabase_admin ' ,
385+ attribute : 'client_connections_supabase_storage_admin ' ,
361386 provider : 'infra-monitoring' ,
362- label : 'supabase-admin' ,
363- tooltip : 'Active connections' ,
387+ label : 'Storage' ,
388+ tooltip :
389+ 'Administrative connections used by Supabase Storage service for file operations and bucket management.' ,
364390 } ,
365391 {
366392 attribute : 'client_connections_other' ,
367393 provider : 'infra-monitoring' ,
368- label : 'other ' ,
369- tooltip : 'Active connections' ,
394+ label : 'Other ' ,
395+ tooltip : "Miscellaneous database connections that don't fall into other categories." ,
370396 } ,
371397 {
372398 attribute : 'max_db_connections' ,
373- provider : 'infra-monitoring' ,
374- label : 'Maximum connections allowed' ,
375- tooltip : 'Maximum connections for instance size' ,
399+ provider : 'reference-line' ,
400+ label : 'Max connections' ,
401+ value : getConnectionLimits ( computeSize ) . direct ,
402+ tooltip : 'Max available connections for your current compute size' ,
376403 isMaxValue : true ,
377404 } ,
378405 ] ,
0 commit comments