You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MongoDB Query Exporter takes these results and exports every result of the pipeline as a prometheus metric.
The pipeline needs to be placed in a JSON file with the following properties.
Property
Data type
Description
type
string
The prometheus metric type to export. Only gauge is supported currently. Support for more types, e.g. histograms are planned.
name
string
The name of the exported prometheus metric
help
string
The description text in the prometheus exposition format. This explains what the metric is supposed to represent.
labels
string[]
A string array of label names. These need to match exactly the labels returned from the aggregation pipeline.
database
string
The MongoDB database to run this aggregation pipeline in.
collection
string
The MongoDB collection in the database to run this aggregation pipeline on.
pipeline
Array of pipeline stages
This is the actual aggregation pipeline. It is executed every scrape. MongoDB Extended JSON is supported. See MongoDB docs for more information on how to write his.
Why would I want that?
You can generate nice dashboards in Grafana, based on your data in Prometheus. Also alerting on stuff happening in the database, but I think this is better handled by the application. It is however an option with this exporter.