## Problem
The Primary Database card in the project homepage diagram showed region
and instance size, but no live health data. Users had no quick way to
spot a high-disk or high-CPU situation without navigating to the
database report.
## Fix
Added a clickable metrics row at the bottom of the Primary Database card
showing CPU, Disk, and RAM as percentages, plus active/max connections
when available. Each metric is color-coded (warning at 80%, destructive
at 90%). Clicking the row navigates to the database observability
report.
The metrics are powered by a new \`useComputeMetrics\` hook that wraps
the existing \`useInfraMonitoringAttributesQuery\` and
\`useMaxConnectionsQuery\`, reusing the parse utilities already used by
the database infrastructure section. The \`metricColor\` threshold logic
is extracted into a separate util with unit tests.
## How to test
- Open the project homepage for a running project
- The Primary Database card should show a new bottom row: "CPU X% · Disk
X% · RAM X% · Y/Z conns"
- Values above 80% should appear in amber, above 90% in red
- Click the metrics row and confirm it navigates to
\`/project/<ref>/observability/database\`
- While metrics are loading, a spinner should appear in the row
- If the infra monitoring API is unavailable, the row should show
"Metrics unavailable" instead of zeroes
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
## Release Notes
* **New Features**
* Infrastructure configuration page now displays real-time compute
metrics (CPU, disk, memory usage) with color-coded usage indicators
based on thresholds.
* Connection information is displayed when available.
* Includes loading states and error handling for metric retrieval.
* **Tests**
* Added test coverage for metric color-coding logic.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* **Chores**
* Updated internal module import paths across hook files to use
standardized path aliases for improved code consistency and
maintainability.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Safer error rendering across analytics and reporting with a fallback
"Unknown error".
* **Tests**
* Added unit tests covering timeseries sorting and timestamp validation.
* **Refactor**
* Standardized timeseries hook and all callers to accept a single
options object and improved nullish handling.
* **New Features**
* Exposed timeseries utilities and explicit options/result types;
exported chart data type.
* **Chores**
* Relaxed index signatures to allow dynamic metric keys.
<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
* Bump the deps, refactor deprecated code.
* Migrate keepPreviousData usage.
* Migrate all uses of InfiniteQuery.
* Fix refetchInterval in queries.
* Migrate all use of isLoading to isPending in mutations.
* Fix accessing location in claim-project.
* Fix a bug in duplicate query keys.
* Migrate all queries to use isPending.
* Revert "Fix accessing location in claim-project."
This reverts commit 2a07df64b5.
* Revert the rss.xml file to master.
* Migrate all uses of invalidateQueries to use object syntax.
* Migrate the remainder of useInfiniteQuery.
* Migrate all setQueriesData.
* Migrate all fetchQuery uses.
* Migrate some leftover functions from RQ.
* Fix issues found by Charis.
* 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>
* Replace all usage of useProjectContext with useSelectedProjectQuery
* Replace all usage of useSelectedProject with useSelectedProjectQuery
* Replace all usage of useProjectByRef with useProjectByRefQuery
* Replace all usage of useSelectedOrganization with useSelectedOrganizationQuery
* Deprecate useSelectedProject, useSelectedOrganization, and useProjectByRef hooks
* Deprecate ProjecContext
* make create button go directly to log explorer if warehouse is disabled
* fix limit clause in uppercase not caught by warnings
* make warning tooltip improve spacing
* fix date not updated on log explorer
* init
* hovercard
* adds button to install index advisor
* hover card now now insert indexes
* update
* moved hook
* align alert dialog to design syste,
* Update index-advisor.utils.ts
* shows all index statements now
* Update query-performance.tsx
* Some refactors
* Clean up
* Fix
* One last nit refactor
---------
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
* add more date range options to log previewer
* new ui for logs datepickers
* update logsquerypanel
* update previewfilterpanel
* fix some bugs and add copypasting date range support
* handle updating times in copypaste events
* add handlepaste to timesplitinput
* update warehouse datepicker
* update reports datepicker
* rm consolelog
* update logsquerypanel
* update tests
* fix reportsfilterbar
* update api-overview report
* rm consolelogs
* update storage report
* add large range wraning
* update large range max const
* fix default values and label
* fix tests
* add default value to logs previewer
* disable helpers fix
* rm last 7 days helper
* add test for disabled helpers
* add label test
* add helper label test
* reset state when closing without saving
* undo rm
* fm datefns, fix test class
* fix year format
* rm disabled from label
* fix type err in test
* fix test
* fix tests
* max 2 days for warning
* fix refresh not using latest timestamp end
* refactor log explorer to use new logs datepicker state hook
* Remove round to hour/day in helpers
* Use now instead of end of day for datepicker TO
* fix types
* update global timeout for e2e tests
* update test with new default
* fix test
* analytics container taking too long to return data so adding more timeout
* force ci
* fix first render issues
* Smol refactor
* Do not reset timestamp end when refreshing in LogsPreviewer
---------
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
* Redo cron ui to use a data table
* Add component for form header
* Add next run column
* add cron jobs page
* Load jobs from url, add runs footer, link to logs
* Type issue
* Fix height of tab area
* Use nuqs with history
* improve pgcron logs, add severity filters
* Check for v1.5 to see if seconds are supported
* fix cron jobs logs table name
* Add type to the table
* Move expression warning to own function
* Fit to new layout
* Types
* Fix long code blocks
* Revert some of the changes.
* Use job name as a tab name. Other minor fixes.
* Use Infinite query for the cron runs.
* Revert some extra changes. Will be added to another PR.
* Rename pg functions
---------
Co-authored-by: Terry Sutton <saltcod@gmail.com>
Co-authored-by: Jordi Enric <jordi.err@gmail.com>
* Support checking API reports by replicas
* Fix API report for replica and add error handling
* Fix tests
* Add load balancer as an option for API reports
* Scaffold for API reports
* Add support for filtering database reports by replicas
* midway adding read replica support for custom reports
* Refactor reports page to use react query and deprecate project content mobxstore
* Reports add chart labels if metric is read replica specific
* Give an easier way to remove charts from reports
* make reports layout non-blocking
* Update apps/studio/components/interfaces/Reports/Reports.tsx
Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
---------
Co-authored-by: Alaister Young <a@alaisteryoung.com>
Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
* very wip
* add expandable rows
* fix table layout, collapsible row, spacing issues
* use new query with filters everywhere
* rm unused queries
* rm unused fn
* improve loading state
* fix text overflowing in role
* rm padding so that table doesn't always need scroll
* fix icon in search input
* add latency to table row heading to clarify what col youre sorting with
* rm unused imports
* run prettier
* align sql with row content
* add syntax highlighting and sort icons
* rm copy btn
* move tailwind dep to correct package, rm unused syntax highlighting, rm unused component
* Move all studio files from /studio to /apps/studio.
* Move studio specific prettier ignores.
* Fix the ui references from studio.
* Fix the css imports.
* Fix all package.json issues.
* Fix the prettier setup for the studio app.
* Add .turbo folder to prettierignore.
* Fix the github workflows.