diff --git a/developers/mcp-tools.mdx b/developers/mcp-tools.mdx index 1b67b5d..95334fa 100644 --- a/developers/mcp-tools.mdx +++ b/developers/mcp-tools.mdx @@ -215,9 +215,9 @@ On Redis the three actions are `MULTI`, `EXEC` and `DISCARD`. Every command betw | `list_grants` | `connection_id`, `principal` (`host`) | `principal`, `grants[]` (`privilege`, `scope`, `is_grantable`). `scope` is a dotted path, `*` for a server-wide grant | | `list_session_contexts` | `connection_id` | `is_supported`, `contexts[]` (`id`, `label`, `value`, `options[]`) | -`get_server_dashboard` reads the live panels TablePro shows, and runs on PostgreSQL, MySQL, SQL Server, ClickHouse and Typesense. Name the panels in `panels[]` or omit it for all three. A session carries `id` (the process id `stop_server_session` takes), `user`, `database`, `state`, `duration_seconds`, `query`, `can_kill` and `can_cancel`; a metric carries `id`, `label`, `value`, `unit`; a slow query carries `duration`, `query`, `user`, `database`. A panel the server could not answer is left out, and `errors` names it: one fixed sentence per panel, keyed by panel name. The server's own message is not sent to the client; it goes to the app's log, where the user can read it. When every requested panel fails, the call fails. +`get_server_dashboard` reads the live panels TablePro shows, and runs on every engine with a [Server Dashboard](/features/server-dashboard#what-each-engine-reports). Name the panels in `panels[]` or omit it for all three. A session carries `id` (the process id `stop_server_session` takes), `user`, `database`, `state`, `duration_seconds`, `query`, `can_kill` and `can_cancel`; a metric carries `id`, `label`, `value`, `unit`; a slow query carries `duration`, `query`, `user`, `database`. A panel the server could not answer is left out, and `errors` names it: one fixed sentence per panel, keyed by panel name. The server's own message is not sent to the client; it goes to the app's log, where the user can read it. When every requested panel fails, the call fails. -`stop_server_session` takes `mode` as `cancel` (default) to stop the running query or `kill` to end the session. SQL Server, ClickHouse and MySQL before 5.0 take only `kill`: their sessions report `can_cancel` false, and `cancel` fails with `invalid_argument`. The user always approves this one, whatever Safe Mode says. +`stop_server_session` takes `mode` as `cancel` (default) to stop the running query or `kill` to end the session. SQL Server, ClickHouse, MySQL before 5.0 and Oracle before 18c take only `kill`: their sessions report `can_cancel` false, and `cancel` fails with `invalid_argument`. MongoDB takes only `cancel`, and `kill` fails the same way. The user always approves this one, whatever Safe Mode says. `list_session_contexts` reports session-level contexts the engine exposes, such as a Snowflake warehouse or role, with the value the session currently holds. diff --git a/features/server-dashboard.mdx b/features/server-dashboard.mdx index c9743ac..1b63c74 100644 --- a/features/server-dashboard.mdx +++ b/features/server-dashboard.mdx @@ -3,7 +3,15 @@ title: Server Dashboard description: Monitor active sessions, server metrics, and slow queries in real time --- -What this screen shows is what your account is allowed to see. A MySQL user without the `PROCESS` privilege gets only its own connections in the session list. A PostgreSQL role that is neither a superuser nor a member of `pg_monitor` gets everyone's backends with the Query column blank. An empty or half-blank dashboard is nearly always a privilege, not a fault. +What this screen shows is what your account is allowed to see. An empty or half-blank dashboard is nearly always a privilege, not a fault: + +| Database | Without it | Grant | +|---|---|---| +| MySQL / MariaDB | Only your own connections | `PROCESS` | +| PostgreSQL | Everyone's backends with the Query column blank | superuser, or membership in `pg_monitor` | +| Oracle | Every panel fails with `ORA-00942` on `"SYS"."V_$SESSION"` | `SELECT_CATALOG_ROLE` or `SELECT ANY DICTIONARY` to read, `ALTER SYSTEM` to cancel or terminate | +| MongoDB | Only your own operations; metrics and slow queries fail | `clusterMonitor`, `dbAdmin` on the database you browse for its profiler, and `hostManager` to cancel another user's operation | +| Redis | A panel fails with `NOPERM` naming the command | `+client\|list`, `+client\|id`, `+info` and `+slowlog\|get` in the user's ACL, plus `+client\|kill` and `+client\|unblock` to act on a client | Open it from **Database > Server Dashboard**, or from **Server Dashboard** under **Actions** in the toolbar. @@ -28,7 +36,7 @@ Every connection to the server except this one, sortable, one row each. | Column | Holds | |---|---| -| PID | Process or session ID | +| PID | Process or session ID: `SID,SERIAL#` on Oracle, the operation ID on MongoDB, the client ID on Redis | | User, Database | Who is connected, and to what | | State | active, idle or sleeping, in the engine's own wording | | Duration | How long the current operation has been running | @@ -36,13 +44,21 @@ Every connection to the server except this one, sortable, one row each. On PostgreSQL 9.1 an idle session shows an empty Query: that server keeps only the running statement, not the last one. -Two buttons sit on each row. **Cancel Query** stops the running statement and leaves the connection up: `pg_cancel_backend` on PostgreSQL, `KILL QUERY` on MySQL. MySQL before 5.0 has no `KILL QUERY`, so those rows offer only **Terminate Session**. **Terminate Session** ends the connection itself with `pg_terminate_backend` or `KILL`, and the server rolls back any transaction that session had open. Both confirm first, and a refusal from the server comes back as an **Action Failed** alert. +Two buttons sit on each row. **Cancel Query** stops the running statement and leaves the connection up: `pg_cancel_backend` on PostgreSQL, `KILL QUERY` on MySQL, `ALTER SYSTEM CANCEL SQL` on Oracle, `killOp` on MongoDB, `CLIENT UNBLOCK … ERROR` on Redis. **Terminate Session** ends the connection itself with `pg_terminate_backend`, `KILL`, `ALTER SYSTEM KILL SESSION … IMMEDIATE` or `CLIENT KILL ID`, and the server rolls back any transaction that session had open. Both confirm first, and a refusal from the server comes back as an **Action Failed** alert. + +MySQL before 5.0 and Oracle before 18c have no way to cancel a statement, so their rows offer only **Terminate Session**. MongoDB has no command that closes another client's connection, and an idle MongoDB connection has no operation to cancel. On Redis only a blocked client, one waiting in `BLPOP`, `XREAD` or the like, has a command to cancel, from Redis 5.0: its wait ends with an error. + +On MongoDB, State is `active` or `idle`. On Redis, Duration is how long the client has been idle, Query is its last command, and State names a blocked, `MULTI`, Pub/Sub, replica or master client. ## Slow Queries Queries still running after 1 second, longest first, with elapsed time, SQL, user, and database. -ClickHouse is the exception: its list comes from `system.query_log`, so it holds the 20 most recent *finished* queries that took over a second, newest first, and no database. +ClickHouse, MongoDB and Redis list finished queries instead, newest first, up to 20: + +- **ClickHouse** reads `system.query_log`: queries that took over a second, with no database. +- **MongoDB** reads the profiler of the database you are browsing. Turn it on with `db.setProfilingLevel(1)`, which records operations slower than `slowms`, 100 ms unless changed. What it recorded stays listed after you turn it off. +- **Redis** reads `SLOWLOG GET`: commands over `slowlog-log-slower-than`, 10 ms unless changed, with the client address in the User column. ## Refreshing @@ -57,5 +73,11 @@ The interval menu offers 1s, 2s, 5s (the default), 10s, 30s, and Off. **Pause** | MySQL / MariaDB | Yes | Connected threads, running threads, uptime, total queries, slow queries, max connections, bytes received, bytes sent | Yes | Yes | Yes | | SQL Server | Yes | User sessions, uptime, database size | Yes | - | Yes | | ClickHouse | Yes | Active queries, active merges, part mutations, disk usage | Yes | - | Yes | +| Oracle | Yes | User sessions, database CPU, logical reads per second, uptime | Yes | 18c and later | Yes | +| MongoDB | Yes | Connections, uptime, resident memory, query, insert, update, delete and command counters | Profiler | Yes | - | +| Redis | Yes | Connected clients, used memory, operations per second, keyspace hit ratio, uptime | Slow log | Blocked clients, 5.0 and later | Yes | +| Typesense | - | System and process memory, memory fragmentation, disk, requests per second, search and write latency, pending write batches, cache hit ratio | - | - | - | + +On Oracle, a pluggable database shows its own sessions and metrics, and the root container shows every container's. On a Redis Cluster, the sessions and metrics come from one primary, the node TablePro sends commands without a key to, and the slow log comes from every node. While a `MULTI` block is open on a Redis connection, the panels say so and send nothing into it until it ends. Every other engine, SQLite and DuckDB included, has no dashboard. The menu item dims and **Actions** leaves the entry out.