restic-exporter
restic-exporter copied to clipboard
Basic Auth support
Hi, thanks for providing this. Would it be possible to have basic auth support in and being able to set user and pass via env var?
You mean in the /metrics
endpoint?
Yes, exactly.
The purpose of this exported is to be consumed by Prometheus. I never saw an exporter with basic auth and I think the prometheus client does not support it. If you are worried about unauthorized access to the endpoint, you can do it with network policies. If you are using Docker containers it's even easier. Anyway there is no much to be worried about, the info exposed is not sensitive.
Btw, new release is out => https://github.com/ngosang/restic-exporter/releases/tag/1.1.0
@ngosang The /metrics
endpoint which is being scraped and the scraping being configured in the prometheus.yml
allows to specify basic auth in that configuration. A lot of the exporters allow to secure the exposed metrics endpoint, like the default node-exporter or the node-systemd-exporter.
I'd imagine that it might be useful. Sure, I can solve it with network, but for a simple setup, maybe basic auth is just enough.
But OK, if that's nothing you'd consider, then there's nothing I can do. :-)
You are right. It's supported by the python client library and Prometheus. I didn't know about that. I'm not interested in implement this feature but I can accept PRs. Example code => https://github.com/prometheus/client_python#handlers-for-authentication