Getting started
Open MongoScope, pick a log, reach the dashboard, and learn the global keys
Get from an installed binary to a useful dashboard view as quickly as possible.
Prerequisites
- MongoScope installed — see Installation
- A real interactive TTY (do not pipe stdout)
- Optional: a readable MongoDB log file, or a live MongoDB URI for later tabs
Open the dashboard from a log file
- Start MongoScope:
mongoscope- On the Welcome screen, select a log from
/var/log/mongodbor from the--log-dirlist (default.). - Press Enter to parse the most recent lines and open the dashboard.
Only the tail of the file is read, so large production logs open quickly. Default tab: Slow Queries with a static (log-derived) source.
Expected result: the dashboard with tabs Slow Queries · Live Ops · Replication · Indexes · Logs.
Skip the picker
Parse a known file on startup:
mongoscope --log-path /path/to/mongod.logInvalid paths exit with status 1. See CLI flags.
Try a sample log
No MongoDB log handy? The repository ships a synthetic one-hour mongod log with collection scans, an index-plus-sort plan, and a slow delete:
curl -fsSLO https://raw.githubusercontent.com/prodioslabs/mongoscope/main/examples/mongod.log.sample
mongoscope --log-path mongod.log.sampleUse the dashboard
| Goal | Action |
|---|---|
| Switch tabs | Press 1–5, or Tab / Shift+Tab |
| Open help | Press ? |
| Open the command palette | Press Ctrl+K |
| Manage live connections | Press c where DbSelector is shown, or Ctrl+K → Manage connections |
| Toggle Static vs Live on Slow Queries / Logs | Press l when a connection is selected |
With no saved profiles, Live Ops, Replication, and Indexes show an inline add form. After you select a connection, Slow Queries and Logs can switch between Static (log file) and Live (server) with l.
Details: Connections.
Global keys
| Key | Action |
|---|---|
? | Help |
Ctrl+K | Command palette |
m | Toggle light / dark |
t | Cycle theme |
q | Quit |
Full reference: Keyboard shortcuts.
Permissions and elevated access
MongoDB’s default log directory (/var/log/mongodb) is often root-owned. Welcome lists each directory with an ordinary (non-root) process.
| State | Message shown |
|---|---|
| Empty (readable, no MongoDB-like logs) | No log files found |
| Directory missing | Directory does not exist — pick a different path or confirm MongoDB's log location on this system |
| Permission denied (directory) | Permission denied — cannot read this directory |
| Other I/O failure | The underlying error message from the filesystem |
When a selected file is unreadable, Welcome shows:
Permission denied reading this log file — press r to retry with sudo
Retry with sudo
- Focus the Welcome section that needs elevation (
tab, or follow the on-screen hint). - Press
r(footer:sudo). - Confirm the dialog, or press Esc to cancel.
Confirm dialog (exact copy):
- Title:
Read with elevated permissions? - The directory path
- List:
Will run a short-lived sudo command to list this directory. - Read:
Will run a short-lived sudo command to read a log file from this directory. Your password may be requested.The app itself will not run as root.- Prompt:
enter confirm · esc cancel(while waiting:waiting for sudo…)
Confirming suspends the TUI briefly, runs sudo -- ls … or sudo -- tail … with an interactive password prompt, then resumes. Approval is session-scoped per directory: after a successful elevate for that directory, further list/read retries in the same process skip the confirm dialog (sudo may still prompt if the OS credential cache expired).
Elevation applies only to Welcome’s log-directory listing and log-file read path. Live connect, credential storage, kill-op, profiler, and config do not request elevation.
| Situation | Message | What to do |
|---|---|---|
| Wrong password / sudo policy deny | Incorrect password or sudo denied. | Press r again, or fix sudoers / use a readable --log-dir |
| Esc / cancel before or during elevate | Elevated access cancelled. | Press r when ready to try again |
sudo not on PATH | sudo is not available on this system. | Install sudo, or copy logs into a user-readable --log-dir |
| No response within ~90s | Timed out waiting for sudo. Try again. | Press r and complete the password prompt promptly |
| Other elevate failure | Elevated access failed. (or a more specific error when available) | Retry, or use an accessible log path |
sudo is optional. MongoScope runs without it; protected directories stay unreadable.
Next steps
- Connections — save a profile and use live tabs
- Slow Queries — patterns, profiling, and export
- CLI flags — skip Welcome or open with an ephemeral live URI