prometheus-mongodb-exporter
by worawutchan
A Prometheus exporter for MongoDB metrics
About this chart
Prometheus MongoDB Exporter
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.
Get Repo Info
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
See helm repo for command documentation.
Install Chart
# Helm 3
$ helm install [RELEASE_NAME] prometheus-community/prometheus-mongodb-exporter
# Helm 2
$ helm install --name [RELEASE_NAME] prometheus-community/prometheus-mongodb-exporter
See configuration below.
See helm install for command documentation.
Uninstall Chart
# Helm 3
$ helm uninstall [RELEASE_NAME]
# Helm 2
# helm delete --purge [RELEASE_NAME]
This removes all the Kubernetes components associated with the chart and deletes the release.
See helm uninstall for command documentation.
Upgrading Chart
# Helm 3 or 2
$ helm upgrade [RELEASE_NAME] [CHART] --install
See helm upgrade for command documentation.
Configuration
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 2
$ helm inspect values prometheus-community/prometheus-mongodb-exporter
# Helm 3
$ helm show values prometheus-community/prometheus-mongodb-exporter
MongoDB Server Connection
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.
Service Monitor
The chart comes with a ServiceMonitor for use with the Prometheus Operator. If you're not using the Prometheus Operator, you can disable the ServiceMonitor by setting serviceMonitor.enabled to false and instead populate the podAnnotations as below:
podAnnotations:
prometheus.io/scrape: "true"
prometheus.io/port: "metrics"
Deploy prometheus-mongodb-exporter with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has prometheus-mongodb-exporter on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartprometheus-mongodb-exporter is pinned at v2.8.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply