MongoDB collstats metricset

edit

MongoDB collstats metricset

edit

This is the collstats metricset of the module mongodb.

It is using the top administrative command to return usage statistics for each collection. It provides the amount of time, in microseconds, used and a count of operations for the following types:

  • total
  • readLock
  • writeLock
  • queries
  • getmore
  • insert
  • update
  • remove
  • commands

Fields

edit

For a description of each field in the metricset, see the exported fields section.

Here is an example document generated by this metricset:

{
    "@timestamp": "2017-10-12T08:05:34.853Z",
    "agent": {
        "hostname": "host.example.com",
        "name": "host.example.com"
    },
    "event": {
        "dataset": "mongodb.collstats",
        "duration": 115000,
        "module": "mongodb"
    },
    "metricset": {
        "name": "collstats"
    },
    "mongodb": {
        "collstats": {
            "collection": "startup_log",
            "commands": {
                "count": 0,
                "time": {
                    "us": 0
                }
            },
            "db": "local",
            "getmore": {
                "count": 0,
                "time": {
                    "us": 0
                }
            },
            "insert": {
                "count": 0,
                "time": {
                    "us": 0
                }
            },
            "lock": {
                "read": {
                    "count": 74,
                    "time": {
                        "us": 443
                    }
                },
                "write": {
                    "count": 1,
                    "time": {
                        "us": 8
                    }
                }
            },
            "name": "local.startup_log",
            "queries": {
                "count": 0,
                "time": {
                    "us": 0
                }
            },
            "remove": {
                "count": 0,
                "time": {
                    "us": 0
                }
            },
            "total": {
                "count": 75,
                "time": {
                    "us": 451
                }
            },
            "update": {
                "count": 0,
                "time": {
                    "us": 0
                }
            }
        }
    },
    "service": {
        "address": "172.26.0.2:27017",
        "type": "mongodb"
    }
}