MongoScope

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

  1. Start MongoScope:
mongoscope
  1. On the Welcome screen, select a log from /var/log/mongodb or from the --log-dir list (default .).
  2. 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.log

Invalid 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.sample

Use the dashboard

GoalAction
Switch tabsPress 1–5, or Tab / Shift+Tab
Open helpPress ?
Open the command palettePress Ctrl+K
Manage live connectionsPress c where DbSelector is shown, or Ctrl+K → Manage connections
Toggle Static vs Live on Slow Queries / LogsPress 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

KeyAction
?Help
Ctrl+KCommand palette
mToggle light / dark
tCycle theme
qQuit

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.

StateMessage shown
Empty (readable, no MongoDB-like logs)No log files found
Directory missingDirectory 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 failureThe 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

  1. Focus the Welcome section that needs elevation (tab, or follow the on-screen hint).
  2. Press r (footer: sudo).
  3. 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.

SituationMessageWhat to do
Wrong password / sudo policy denyIncorrect password or sudo denied.Press r again, or fix sudoers / use a readable --log-dir
Esc / cancel before or during elevateElevated access cancelled.Press r when ready to try again
sudo not on PATHsudo is not available on this system.Install sudo, or copy logs into a user-readable --log-dir
No response within ~90sTimed out waiting for sudo. Try again.Press r and complete the password prompt promptly
Other elevate failureElevated 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

On this page