mongodb_exporter icon indicating copy to clipboard operation
mongodb_exporter copied to clipboard

Custom queries to export additional metrics from database data

Open Lusitaniae opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe. When using postgres_exporter, I have the ability to write custom queries to create additional metrics based on database data. Would be nice to have that option in mongodb_exporter too, so I wouldn't have to roll out my own home baked script.

https://github.com/prometheus-community/postgres_exporter#flags

postgres implementation was last changed in: https://github.com/prometheus-community/postgres_exporter/pull/801/files (in case you're following the readme and hitting dead links)

Describe the solution you'd like I'd like to write a mongodb query and have the results available as a metric.

Describe alternatives you've considered

  • Use Grafana Enterprise with mongodb datasource plugin (and run the query in grafana instead)
  • Write my own cronjob/script to run the queries and export metrics (i.e. by using node_exporter text collector)
  • Write my own exporter for my specific needs

Lusitaniae avatar Jul 06 '23 18:07 Lusitaniae

Hello @Lusitaniae, Thank you for your report. postgres_exporter is deprecating that feature https://github.com/prometheus-community/postgres_exporter/blob/master/CHANGELOG.md#0130--2023-06-21. We need to discuss it within the team.

BupycHuk avatar Jul 07 '23 07:07 BupycHuk

yeah, unfortunately no equivalent of https://github.com/burningalchemist/sql_exporter for nosql databases yet

Anyway, unless you'd really like this feature too, feel free to close the Issue and on my side I'll work something out for my needs.

Lusitaniae avatar Jul 09 '23 11:07 Lusitaniae