percona / mongodb_exporter

A Prometheus exporter for MongoDB including sharding, replication and storage engines
Apache License 2.0
1.15k stars 426 forks source link

Extend /scrape fuction #789

Closed frenkye closed 7 months ago

frenkye commented 7 months ago

Is your feature request related to a problem? Please describe.

  1. create auth file next to exporter, where can be defined different credentials for multiple endpoints.
  2. There should not be requirement set --mongo.uri when want to use only /scape

Describe the solution you'd like

  1. the auth;

    • mysql exporter has file with logins which you enable by /scrape?target=....&auth=user
    • redis exporter has file with target and login, which is taken on request no need to define anything extra Either one would be fine.
  2. about the flag

    • mongo.uri not required on start
    • or add exclusive flag --no-local or something like that

Describe alternatives you've considered no other

Additional context When we using /scrape or /probe fuctionality on exporter we use it for all instances. Feels obsolete need to specify default instance.

mongodb_exporter: error: No MongoDB hosts were specified. You must specify the host(s) with the --mongodb.uri command argument or the MONGODB_URI environment variable
mongodb_exporter: error: No MongoDB hosts were specified. You must specify the host(s) with the --mongodb.uri command argument or the MONGODB_URI environment variable
frenkye commented 7 months ago

Seems yesterday I did not fully undestand required config. Test a bit more and reforme the issue if needed.