Prometheus metrics for MongoDB instances created via MongoDB Community Operator

I’m having trouble monitoring MongoDB instances created via the MongoDB Community Operator with Prometheus Scrape Jobs. The metrics endpoint is always protected, and I can’t disable it. Additionally, I can’t add the annotations needed for service discovery on the Kubernetes service resource created by the operator because only the StatefulSet resource is configurable. I’m considering using a MongoDB exporter, but I’m unsure if it can handle metrics from multiple instances. Any advice or configuration examples would be appreciated.

Hi, we have a docs page in the repo about this:

But it covers using a service monitor, instead of service discovery.

We don’t allow configuring prometheus without any password.

Does this offer what you need?


Opentelemtry does not fully support service monitors, and I had to switch to a different approach to scrape the service via a static target.

Now I’m trying to build a Grafana Dashboard from scratch, because the old one does not seem to work anymore on the latest Grafana version and the data returned by the queries does not seem correct.

For example, “mongodb_opLatencies_reads_ops” value grows over time, I don’t see any moment where the value decreases. I currently don’t execute anything to the database, so I don’t understand why this grows and grows without stop.

Is there any documentation or new dashboard that I can consume with the latest version of the operator? I’m trying to monitor the MongoDB instances via the default metrics.

Thank you

Hi, I chatted to the Engineering team.

Unfortunately we’d need to spend some time investigating and recreating this to be able to provide a meaningful reply.

I’ve created a ticket on our internal backlog to pick this up and see what we can offer!

I’m not sure right now when that’s likely to happen but when it does we’ll reply back here.


Thank you for your prompt reply, I’ll wait for a reply on this thread.