prometheus-mongodb-exporter

by joaquinito2051

Helm chartv2.1.0App v0.7.0

A Prometheus exporter for MongoDB metrics

About this chart

Prometheus MongoDB Exporter

Installs the MongoDB Exporter for Prometheus. The MongoDB Exporter collects and exports oplog, replica set, server status, sharding and storage engine metrics.

Installing the Chart

To install the chart with the release name my-release:

$ helm upgrade --install my-release stable/prometheus-mongodb-exporter

This command deploys the MongoDB Exporter with the default configuration. The configuration section lists the parameters that can be configured during installation.

Using the Chart

To use the chart, ensure the mongodb.uri is populated with a valid 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. 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"

Configuration

ParameterDescriptionDefault
affinityNode/pod affinities{}
annotationsAnnotations to be added to the pods{}
extraArgsThe extra command line arguments to pass to the MongoDB ExporterSee values.yaml
fullnameOverrideOverride the full chart name``
image.pullPolicyMongoDB Exporter image pull policyIfNotPresent
image.repositoryMongoDB Exporter image namessheehy/mongodb-exporter
image.tagMongoDB Exporter image tag0.7.0
imagePullSecretsList of container registry secrets[]
mongodb.uriThe required URI to connect to MongoDB``
nameOverrideOverride the application name``
nodeSelectorNode labels for pod assignment{}
podAnnotationsAnnotations to be added to all pods{}
portThe container port to listen on9216
priorityClassNamePod priority class name``
replicasNumber of replicas in the replica set1
resourcesPod resource requests and limits{}
envExtra environment variables passed to pod{}
securityContextSecurity context for the podSee values.yaml
serviceMonitor.enabledSet to true if using the Prometheus Operatortrue
serviceMonitor.intervalInterval at which metrics should be scraped30s
serviceMonitor.scrapeTimeoutInterval at which metric scrapes should time out10s
serviceMonitor.namespaceThe namespace where the Prometheus Operator is deployed``
serviceMonitor.additionalLabelsAdditional labels to add to the ServiceMonitor{}
tolerationsList of node taints to tolerate[]

Limitations

Connecting to MongoDB via TLS is currently not supported.

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.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartprometheus-mongodb-exporter is pinned at v2.1.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. 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