prometheus_exporter icon indicating copy to clipboard operation
prometheus_exporter copied to clipboard

Ability to configure options via configuration file for exporter process

Open ThisIsMissEm opened this issue 6 months ago • 0 comments

Currently when using the exporter process for multi-process exporting (e.g., from puma or sidekiq), the only way to configure the exporter is via command line flags. It'd be useful, particularly for labels to be able to specify them in a configuration file, otherwise when running the exporter you end up with quite a long script, e.g., in a systemd service file, we've ended up with:

ExecStart=/home/mastodon/.rbenv/shims/bundle exec bin/prometheus_exporter -p 9194 -b 0.0.0.0 --prefix 'mastodon_' --label '{"env": "dev", "system": "mastodon", "host": "$HOSTNAME"}'

That's only some of the default labels we apply to most prometheus exporters (we also have provider, region, system role and possibly more)

So it'd be useful to be able to define the labels and the prefix in a configuration file, instead of having to define these in the command.

I'd be happy to contribute something for this, if it's desired.

ThisIsMissEm avatar Jun 21 '25 15:06 ThisIsMissEm