A Prometheus exporter for MongoDB metrics.
Installs the MongoDB Exporter for Prometheus. The MongoDB Exporter collects and exports oplog, replica set, server status, sharding and storage engine metrics.
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
See helm repo
for command documentation.
helm install [RELEASE_NAME] prometheus-community/prometheus-mongodb-exporter
See configuration below.
See helm install for command documentation.
helm uninstall [RELEASE_NAME]
This removes all the Kubernetes components associated with the chart and deletes the release.
See helm uninstall for command documentation.
helm upgrade [RELEASE_NAME] [CHART] --install
See helm upgrade for command documentation.
A major chart version change (like v1.2.3 -> v2.0.0) indicates that there is an incompatible breaking change needing manual actions.
This version uses the original percona/mongodb_exporter docker image again, as described in the readme and Chart.yaml. It's maintained and it uses frequent docker builds, so this is preferable for security reasons.
The commnad arguments of the exporter have changed. If you have custom extraArgs
settings you have to adjust them. Because of the newer version of the exporter image metrics may varry though, so you might need to adjust your dashboard querries or try out the "--compatible-mode" parameter in extraArgs
.
The mongodb.uri
variable got "mongodb://monogdb:27017" as default parameter.
Chart API was raisded to v2, so Helm 2 is not supported anymore.
The servicemonitor has been disabled by default as prometheus operator might not be installed in cluster.
See Customizing the Chart Before Installing. To see all configurable options with detailed comments, visit the chart's values.yaml, or run these configuration commands:
helm show values prometheus-community/prometheus-mongodb-exporter
To use the chart, ensure the mongodb.uri
is populated with a valid MongoDB URI or an existing secret (in the releases namespace) containing the key defined on existingSecret.key
, with the URI is referred via existingSecret.name
. If no secret key is defined, the default value is mongodb-uri
.
If the MongoDB server requires authentication, credentials should be populated in the connection string as well. The MongoDB Exporter supports connecting to either a MongoDB replica set member, shard, or standalone instance.
The chart comes with a ServiceMonitor for use with the Prometheus Operator. By default, the ServiceMonitor is disabled. You can enable the ServiceMonitor by setting serviceMonitor.enabled
to true
. For the ServiceMonitor to be detected by the Prometheus Operator, you must add the selector label to serviceMonitor.additionalLabels
. You can find this label under spec.serviceMonitorSelector
of the Prometheus CRD.
If you're not using the Prometheus Operator, you can instead populate the podAnnotations
as below:
podAnnotations:
prometheus.io/scrape: "true"
prometheus.io/port: "metrics"