MongoDB monitoring · read-only, with clusterMonitor

MongoDB monitoring on one page, with the cause first.

WatchLog reads MongoDB’s own statistics with a clusterMonitor user. One scroll says what the server waits on, which operation is responsible, which service sends it and what changed, on Kubernetes and on Linux servers.

One clusterMonitor user. Never a document. Open source.

WatchLog’s MongoDB page while one query reads a whole collection: Right now says analytics scans shop.events and the scans fill the cache, over the Busy with chart with the deploy as a pill.(opens the picture larger)
Right now

The answer first.

The top of the page is one sentence: reads are three times slower than usual, one query reads a whole collection, the replica set has no primary. Under it, who sends it and what changed just before. When nothing is wrong, it says that.

  • Four numbers: operations a second, the p95 read against its usual, the cache used, members up.
  • See what broke scrolls to the cause; Open goes to the workload or service behind it.
  • A rollout, or a deploy your scripts send to the events API, is named when it came just before.
Right now on WatchLog’s MongoDB page while one query scans: analytics reads all of shop.events and fills the cache, with the four numbers.(opens the picture larger)
Broken: who scans, and the deploy before it.
Right now on WatchLog’s MongoDB page for the same shop on a server, in Docker Compose, when it is calm: Everything is answering, with the same four numbers.(opens the picture larger)
Calm, on a server in Docker Compose.
The chart

One chart, four views.

Busy with, Operations, Latency and Connections share one chart, with rollouts and deploys as pills on it. Drag across it to choose a period: every section and drawer below follows.

  • Busy with: active operations by what they wait on, with the p95 read on its own scale.
  • Hover for each series and the total; click a legend item to show it alone.
  • Latency shows reads, writes and commands from the server’s own histograms.
Who uses what

Which service spends the time, on which collection.

Each service on the left, the collections it spends the database’s time on on the right, each ribbon as wide as its share. A service scanning a collection, and that collection, are red.

  • An operation shape’s time is split over the clients seen running it.
  • Click a service or a collection to open it in a drawer.
  • Without pairs, two lists: services by their connections, collections by their time.

Pairs need operation shapes: $queryStats, or the slow log with slowms lowered. The page says so, with the one command.

Operations and why

The worst operation first, and why it is slow.

Operation shapes come worst first: waiting on a lock, then far slower than usual, then reading far more documents than they return, then by their share of the time. Beside them, where the waiting time goes, in plain words.

  • A query reading a whole collection: who sends it, the fields no index covers, what it does to the cache.
  • Operations waiting their turn for a ticket, a lock and the transaction holding it, flow control.
  • Values are never kept: a shape is field names and operators, every value a ?.
Drawers

Click anything, stay on the page.

Every row, ribbon, cause and card opens a drawer over the page, with the cause first, and the drawer is in the address, so you can send the link. Esc closes it; ↑ and ↓ move to the previous or next row.

  • An operation: why first, its calls, mean and documents read, and the index that would cover it.
  • A service: the scan it sends, its connections, its operations by what they wait on.
  • A collection: scanned or not, its share of the time, its size and indexes.
Everything else

Healthy things stay small.

Cache, Replica set, Storage and Connections are one card each: one number, one sentence and a bar. A card turns amber or red only with a finding, and opens the rest in a drawer.

  • Cache: used against the usual at this hour, and dirty.
  • Replica set: lag, the primary and the oplog’s window.
  • Storage: data, the days the disk lasts, and unused indexes.
Setup

It tells you what it can’t see.

The Setup view lists what WatchLog reads and what is missing. A self-hosted server keeps no $queryStats and logs only operations over 100 ms: the page says what that hides, and the one command that lowers slowms.

  • Everything else works with clusterMonitor alone.
  • Every command stops after 2 seconds.
  • WatchLog never runs find or aggregate on your collections, and never changes the profiler.
mongosh, on each member
db.setProfilingLevel(0, { slowms: 20 })

Level 0 keeps the profiler off: only the slow log’s threshold changes. Where the server keeps $queryStats (Atlas), nothing is needed. Where the shapes come from.

Light or dark, desk or phone

The same answer on a phone.

The page comes in a light and a dark theme, and on a phone it keeps the same order: the answer first, then the chart and the rest.

Alerts that are already written

On from the first minute.

Press Monitor and these are created; you tick the ones that start on. Each goes to Slack, Telegram, email or a webhook, and says what, where and which service.

  • The replica set has no primary for a minutecritical
  • A member down, or over 60 seconds behind, for a minutecritical
  • Application threads evicting from the cache for 5 minuteswarning
  • Collection scans above 100 a minute for 5 minuteswarning
  • The oplog window under 12 hours, once the oplog is fullwarning
  • Replication lag above 30 seconds for 2 minuteswarning
  • More than 20 slow operations a minute for 5 minuteswarning
Setup

One user. Read-only.

  1. Install the WatchLog agentOne command on a server, or one Helm chart on a cluster.
  2. WatchLog finds MongoDBFrom the images and ports the agent already sees, standalone or a replica set. It appears under Applications.
  3. Press MonitorRun the one command it writes: a user with clusterMonitor. The page and its alerts start at once.
Platform
kubectl exec -it -n shop statefulset/mongo -- mongosh -u root -p --authenticationDatabase admin --quiet \
  --eval 'db.getSiblingDB("admin").createUser({ user: "watchlog", pwd: "…", roles: [{ role: "clusterMonitor", db: "admin" }] })'
docker exec -it shop-mongo-1 mongosh -u root -p --authenticationDatabase admin --quiet \
  --eval 'db.getSiblingDB("admin").createUser({ user: "watchlog", pwd: "…", roles: [{ role: "clusterMonitor", db: "admin" }] })'

On a replica set, run it once, against the primary: the user reaches every member. Optional: lower slowms so the slow log holds the operation shapes; everything else works without it.

Installed from a package on a Linux server? WatchLog finds it by its systemd unit, and the command runs with mongosh. Applications on Linux servers.

Connecting, step by step →
Compared

Against an exporter and dashboards.

WhatWatchLogmongodb_exporter and dashboards
Time to the first chartMinutesHours: an exporter, a scrape config, dashboards
Which service reads a whole collectionNamed, with the fields no index coversYou read the logs
What operations wait onSampled every 15 seconds, by shapeNot available
Which service spends the time, on which collectionOne picture, by share of the timeNot available
Works on plain Linux serversYes, and KubernetesDepends on your setup
Reads your documentsNeverDepends on the exporter
Ask your AI

Ask your AI about MongoDB.

Claude and ChatGPT read the same facts through WatchLog’s MCP server, read-only: what operations wait on, which shape scans which collection and who sends it, the replica set and the cache.

Connect your assistant →

Why is the reports page slow?

get_application · explain_problem

shop/mongo runs about 290 slow collection scans a minute on shop.events, all sent by shop-analytics-1. An index on the fields it filters by would stop them.

An example on Docker, written from the docs.
Questions

MongoDB monitoring, answered.

Which MongoDB versions are supported?
6.0 and later, standalone or a replica set, on Kubernetes and on Linux servers (systemd services, process groups and containers). Waiting for a ticket is told apart from 8.0.
What access does WatchLog need?
A user with clusterMonitor, nothing broader. WatchLog writes the one command that creates it. It never runs find or aggregate on your collections and never changes the profiler.
Does it see my data?
No. Operations carry their values in $currentOp and the log; the collector reduces each to its shape, field names and operators with every value replaced by ?, before anything leaves it.
Where do the operation shapes come from?
From $queryStats where the server keeps it (Atlas does), otherwise from the slow log and a sample every 15 seconds. With neither, the page says so and gives the command that lowers slowms.
Will it slow MongoDB down?
No. Measured under load: about 0.6 commands a second to each member, at most a millisecond of server time a second. Collections and indexes are read every 10 minutes.
Does it work on Atlas?
Yes, with a database user that has clusterMonitor. On DocumentDB a panel whose command the server doesn’t have says so, and the rest works.
Can I alert on one operation?
Yes, from its drawer, in one click: far slower than usual, or a mean above a second.
Is it free?
The open-source edition is free without limits. WatchLog Cloud is free for 5 servers or nodes.

See your own MongoDB in five minutes.

Free on WatchLog Cloud for 5 servers or nodes, or run it yourself, open source.