Enable lightweight profiling (safe for production):
db.setProfilingLevel(1, { slowms: 100 }) // captures ops > 100ms
Then query the profiler periodically:
db.system.profile.find({ millis: { $gt: 100 } }).sort({ ts: -1 }).limit(5).pretty()
Useful fields:
ns (namespace: e.g., mydb.users)
op (operation: query, update, etc.)
query or command
millis
planSummary