# Monitor a database > Read metrics and query performance for an Orchard managed database on the Observe tab. Source: https://docs.orchard.hackclub.com/data/monitoring/ The **Observe** tab of a database shows metrics and query statistics, so you can find slow queries and decide whether the database needs more resources before users notice. Metrics and query statistics are available only for dedicated databases. ## View metrics **Dashboard** 1. Open the database. 2. Go to **Observe** > **Metrics**. 3. Select a time range. **CLI** ```sh orchard db metrics ``` The **Metrics** view has the following panels: | Section | Panels | | ------------------------- | -------------------------------------------------------------------------- | | **Activity** | **Connections**, **Transactions**, **Cache hit** | | **Replication & storage** | **Replication lag**, **Database size**, **Disk used** | | **Resources** | **CPU**, **Memory**, **Network in**, **Network out** | | **Health** | **Deadlocks**. This panel appears only when the range contains a deadlock. | The **Disk used** panel marks 80% full and 92% full. Writes pause at 92%, so [grow the storage](/data/storage/) before the line reaches that mark. ## Turn on query statistics Query statistics use the `pg_stat_statements` [extension](/data/extensions/). Turning on the extension restarts the database once. 1. Open the database. 2. Go to **Observe** > **Queries**. 3. Select **Enable**. ## Find slow queries 1. Open the database. 2. Go to **Observe** > **Queries**. 3. In **Rank queries by**, select one of these options: - **Most time:** Total time across all calls. - **Most frequent:** Number of calls. - **Slowest:** Mean time for each call. 4. (Optional) In **Filter queries**, enter text to search for. 5. Select a row to read the full query. To clear the collected statistics, select **Reset**. ## Read logs and restart history The **Overview** tab of a database includes a [console](/run/logs/#database-logs). In the console, **Logs** shows Postgres logs and **Killed** shows the output of containers that were killed. To read this data from the CLI, run the following commands: ```sh orchard db logs orchard db killed list ``` To print a summary of database health, run the following command: ```sh orchard db diagnose ``` ## Related resources - [Change Postgres parameters](/data/parameters/) - Tune timeouts, memory, and slow query logging. - [Read logs and open a shell](/run/logs/) - Use the database console from the dashboard. - [`orchard db` reference](/reference/cli/#db) - Review the `metrics`, `logs`, `killed`, and `diagnose` commands.