Files
5f533247e1 Update docs url to env var (#38772)
* Update Supabase docs URLs to use env variable

Co-authored-by: a <a@alaisteryoung.com>

* Refactor: Use DOCS_URL constant for documentation links

This change centralizes documentation links using a new DOCS_URL constant, improving maintainability and consistency.

Co-authored-by: a <a@alaisteryoung.com>

* Refactor: Use DOCS_URL constant for all documentation links

This change replaces hardcoded documentation URLs with a centralized constant, improving maintainability and consistency.

Co-authored-by: a <a@alaisteryoung.com>

* replace more instances

* ci: Autofix updates from GitHub workflow

* remaining instances

* fix duplicate useRouter

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: alaister <10985857+alaister@users.noreply.github.com>
2025-09-26 10:16:33 +00:00

110 lines
3.3 KiB
TypeScript

import { DOCS_URL } from 'lib/constants'
export interface Attribute {
key: string
name?: string
color: 'white' | 'blue' | 'green' | 'yellow' | 'orange'
}
export interface CategoryAttribute {
anchor: string
key: string // Property from organization usage
attributes: Attribute[] // For querying against stats-daily / infra-monitoring
name: string
unit: 'bytes' | 'absolute' | 'percentage'
links: {
name: string
url: string
}[]
description: string
chartPrefix?: 'Max' | 'Average'
chartDescription: string
}
export interface CategoryMeta {
key: string
name: string
description: string
attributes: CategoryAttribute[]
}
export const INFRA_ACTIVITY_METRICS: CategoryMeta[] = [
{
key: 'infra',
name: 'Infrastructure',
description: 'Usage statistics related to your server instance',
attributes: [
{
anchor: 'cpu',
key: 'max_cpu_usage',
attributes: [{ key: 'max_cpu_usage', color: 'white' }],
name: 'CPU',
unit: 'percentage',
description: 'Max CPU usage of your server.',
chartDescription: '',
links: [
{
name: 'Compute Add-Ons',
url: `${DOCS_URL}/guides/platform/compute-add-ons`,
},
{
name: 'High CPU Usage',
url: `${DOCS_URL}/guides/troubleshooting/high-cpu-usage`,
},
{
name: 'Metrics',
url: `${DOCS_URL}/guides/platform/metrics`,
},
],
},
{
anchor: 'ram',
key: 'ram_usage',
attributes: [{ key: 'ram_usage', color: 'white' }],
name: 'Memory',
unit: 'percentage',
description:
'Memory usage of your server.\nYou might observe elevated memory usage, even with little to no load. Besides Postgres, a wide range of services are running under the hood resulting in an elevated base memory usage.',
chartDescription: '',
links: [
{
name: 'Compute Add-Ons',
url: `${DOCS_URL}/guides/platform/compute-add-ons`,
},
{
name: 'High RAM Usage',
url: `${DOCS_URL}/guides/troubleshooting/exhaust-ram`,
},
{
name: 'Metrics',
url: `${DOCS_URL}/guides/platform/metrics`,
},
],
},
{
anchor: 'disk_io',
key: 'disk_io_consumption',
attributes: [{ key: 'disk_io_consumption', color: 'white' }],
name: 'Disk IO Bandwidth',
unit: 'percentage',
links: [
{
name: 'Disk Throughput and IOPS',
url: `${DOCS_URL}/guides/platform/compute-add-ons#disk-throughput-and-iops`,
},
{
name: 'High Disk I/O',
url: `${DOCS_URL}/guides/troubleshooting/exhaust-disk-io`,
},
{
name: 'Metrics',
url: `${DOCS_URL}/guides/platform/metrics`,
},
],
description:
'The disk performance of your workload is determined by the Disk IO bandwidth.\nSmaller compute instances (below 4XL) can burst above their baseline disk throughput and IOPS for short periods of time. Beyond that, the performance reverts to the baseline.',
chartDescription: '',
},
],
},
]