prometheus mongodb exporter #2
Description
Allows prometheus to scrape MongoDB metrics
- Tags:
- monitoring ›
- performance ›
This charm has been created to make metrics from Juju controller databases available for collection by prometheus. It should work for any MongoDB database, but it has no mongodb relation.
It is using the prometheus-mongodb-exporter snap.
Metrics will be available at http://<unit_ip>:19091/metrics
once exposed.
You can add a user dedicated to monitoring to MongoDB by running the following in a MongoDB shell :
db.createUser( { user: "prometheus-exporter",
pwd: "my-awesome-password",
roles: [ { role: "clusterMonitor", db: "admin" },
{ role: "read", db: "local" }, ] }
)
Configuration
- mongodb_tls_ca
- (string) base64 encoded CA that is trusted for MongoDB server connections. You can set this value to "juju" if you want to connect to a Juju controller MongoDB - the charm will automatically use the CA used by Juju.
- mongodb_tls_cert
- (string) base64 encoded client certificate and key used to connect to MongoDB. You can set this value to "juju" if you want to connect to a Juju controller MongoDB - the charm will automatically use the certificate used by Juju.
- mongodb_uri
- (string) The MongoDB server's URI, in the form "mongodb://user:pass@ip:port/". To monitor a local Juju controller, use the special string "juju-db://". The charm will choose appropriate values for mongodb_tls_ca and mongodb_tls_cert when using "juju-db://".
- port
- (int) Port to listen for connections on
- 19091
- snapd_refresh
- (string) How often snapd handles updates for installed snaps. The default (an empty string) is 4x per day. Set to "max" to check once per month based on the charm deployment date. You may also set a custom string as described in the 'refresh.timer' section here: https://forum.snapcraft.io/t/system-options/87