MongoDB Performance Metrics
Sharded Cluster Metrics
| Metric Alias | Metric Description | Unit |
|---|---|---|
| Connection Details | MongoDB cluster connection details; mongos node connection count is the sum of all nodes, configServer and shard use the Primary node connection count | |
| Cursor Count | Number of cursors in MongoDB cluster; configServer and shard use the Primary node connection count | |
| Table Count per Shard | Number of tables on each shard in the cluster; sum(metric_value) by shard | |
| Table Size per Shard | Table size on each shard in the cluster; sum(metric_value) by shard | Bytes |
| Index Size per Shard | Index size on each shard in the cluster; sum(metric_value) by shard | Bytes |
| Index Count per Shard | Index count on each shard in the cluster; sum(metric_value) by shard | |
| Document Count per Shard | Document count on each shard in the cluster; sum(metric_value) by shard | |
| Balancer Enabled | Whether Balancer is enabled in the cluster; take the max value (top1) among all instances | |
| Cluster Events | Average number of events triggered per second in the cluster (metric_value>0 means event triggered); event dimension value indicates different event names | |
| Chunk Balancer Enabled | Whether Chunk Balancer is enabled; take the min value (top1) among all instances; after the chunk threshold is triggered, the cluster will automatically migrate and balance chunks across all shards | |
| Chunk Count | Number of chunks in the cluster; sum(value) by ty_cluster | |
| Partitioned Table Count | Number of partitioned tables in the cluster | |
| Sharded Database Count | Number of databases in partitions in the cluster; take the max value (top1) among all instances | |
| Chunk Count per Shard | Number of chunks on each shard in the cluster; sum(metric_value) by shard | |
| Draining Shard Count | Number of shards in Draining state in the cluster; take the max value (top1) among all instances; after removeShard, the shard will be in Draining state until the balancer migrates all chunks off and deletes the shard | |
| Shard Count | Number of shards in the cluster; take the max value (top1) among all instances | |
| Operation Count | MongoDB cluster operation details. mongos node connection count is the sum of all nodes, configServer and shard use the Primary node connection count; type dimension value insert, update, delete, query, sum as QPS | |
| Connection Ratio | current/total | % |
Replica Set Metrics
| Metric Alias | Metric Description | Unit |
|---|---|---|
| Last Election Time | Time of last election in replica set; take the max value (top1) among all instances | |
| Election Occurred | Whether an election occurred in the replica set, 0-no; >0 means occurred | |
| Replication Lag | Replication lag time, secondary and primary lag | |
| Replica Set Status | Role status of each instance in the replica set, 1-primary; 2-secondary; 7-arbiter | |
| Ping Latency | Ping latency of replica set members; take the max value (top1) among all instances |
Instance Metrics
| Metric Alias | Metric Description | Unit |
|---|---|---|
| Uptime | Uptime of this component | s |
| Role | MongoDB role | |
| Version | MongoDB version | |
| Availability | MongoDB availability | |
| CPU Usage | Process CPU usage | % |
| Memory Used | Process memory usage | Bytes |
| Memory Usage | Process memory usage / host total memory | % |
| Disk Throughput (Read) | Process disk read throughput per second | Bytes/s |
| Disk Throughput (Write) | Process disk write throughput per second | Bytes/s |
| Traffic (Send) | Bytes sent per second by MongoDB | Bytes/s |
| Traffic (Receive) | Bytes received per second by MongoDB | Bytes/s |
| Throughput (QPS) | Number of commands executed per second | Count/s |
| Throughput Details | Number of insert, delete, update, return per second | Count/s |
| Average Response Time | Average response time of service | ms |
| Response Time Details | Average response time for specific operations | ms |
| Cursor Total | Total number of open cursors | |
| Pinned Cursor Count | Number of open pinned cursors | |
| noTimeout Cursor Count | Number of open cursors with DBQuery.Option.noTimeout set | |
| Connection Count | Current number of connections | |
| Active Connection Count | Current number of active connections | |
| Connection Ratio | Current connections / max connections | % |
| Queue Lock Count | Number of requests waiting for lock | |
| Read Lock Count | Number of requests waiting for read lock | |
| Write Lock Count | Number of requests waiting for write lock | |
| Storage Engine | Storage engine type | |
| Data Size | Bytes used by database | Bytes |
| Memory Usage Details | Bytes used for mapped, resident, virtual memory | Bytes |
| Index Size | Bytes used by database indexes | Bytes |
| Replication Lag | Master-slave replication lag | s |
| Cache Usage | WiredTiger cache usage, calculated as current usage / max configured | % |
| Cache Used | Data stored in WiredTiger cache (after decompression) | Bytes |
| Cache Max | Max value set for WiredTiger cache | Bytes |
| Transaction Count | Average number of internal transactions per second in WiredTiger engine | |
| Evicted Page Count | Average number of cache pages evicted per second in WiredTiger engine |