Company
Date Published
Author
Jean-Mathieu Saponaro
Word count
1098
Language
English
Hacker News points
None

Summary

The MongoDB database provides several methods to collect performance metrics from the host machine and from the database itself. The first method is using built-in utilities such as `mongostat` and `mongotop`, which provide real-time statistics on activity, memory usage, and storage information. These tools are useful for quick checks but do not offer advanced monitoring features. Another method is to use native MongoDB commands such as `serverStatus`, `dbStats`, `collStats`, `getReplicationInfo`, and `replSetGetStatus`, which provide a wide range of metrics on connections, operations, storage, and replication. For databases running in production, a more comprehensive monitoring system that ingests MongoDB metrics along with metrics from other technologies is often necessary, and tools such as MongoDB's own management tools and Datadog offer extended monitoring capabilities.