Reactive Scala Driver for MongoDB
Asynchronous & Non-Blocking
ReactiveMongo provides a mechanism to collect some metrics about MongoDB connections, that can be useful to monitor.
A JMX module is available.
When running with this module, you can check the state of the ReactiveMongo pools from outside the JVM, using a JMX client.
It can be enabled by adding the dependency as bellow.
In order to monitor with
jconsole, first start it and select the ReactiveMongo JVM.
The following warning may be display when connecting to a JVM without SSL (e.g. for local JVMs).
Once connected, you can select the “MBeans” tab on the top of JConsole, to check the beans managed in the JVM, including those representing the MongoDB nodes managed by ReactiveMongo.
Kamon is an instrumentation and monitoring library for JVM application.
For projects where Kamon is set up, the module
reactivemongo-kamon can to added as bellow, to collect metrics about the connection pools.
Then the metrics can be configured in dashboards, according the used Kamon reporters. For example if using Kamon APM.
The collected metrics are the following.
Pool metrics: (tagged by pool name)
reactivemongo.awaitingRequests: Total number of requests awaiting to be processed by MongoDB nodes.
reactivemongo.maxAwaitingRequestsPerChannel: Maximum number of requests that were awaiting to be processed for a single channel (see
reactivemongo.numberOfNodes: Number of nodes that are part of the set.
reactivemongo.hasPrimary: Indicates whether the primary node is known (0 or 1).
reactivemongo.hasNearest: Indicates whether the nearest node is known (0 or 1).
reactivemongo.isMongos: Indicates whether mongos is used (0 or 1).
reactivemongo.numberOfSecondaries: Number of secondary nodes in the set. Node metrics: (tagged by pool & node)
reactivemongo.nodeChannels: Number of network channels to a same MongoDB node, whatever is the status (see
reactivemongo.connectedChannels: Number of connected channels to a same MongoDB node (see
reactivemongo.authenticatedChannels: Number of authenticated channels to a same MongoDB node (see
reactivemongo.pingTime: Response delay (in nanoseconds) for the last IsMaster request.