I recently started using the official driver instead of the globalsign project and one of the things I miss most is the ability to count how many active connections I have going with mongodb. I can see it on the server side in the monitoring section of the mongodb.com website. But I don’t know which of my servers is misbehaving without restarting them and watching the number go down. It would be nice if the mongo client gave health info like this. Does it already exist and I just can’t find it?
What monitoring/health checking options does the golang mongodb driver support? Like connection count?
Have I posted in the wrong forum? Is there something I can do better to get a response?
I don’t think such thing exists. You may need to “emit metric” from all nodes in your cluster and do sort of aggregation. Host identifier is needed so that you know where the data is from.
In our system. We use k8s + prometheus, so we know which k8s pod is sending what data.
Sure, I can wrap the mongodb client and track what requests are made and when. But I can’t see the internal workings of the client. So, I can’t know how many connections currently exist (which matters because we can run out0. Is there really nothing to check the internal health of the client?