sql_exporter
sql_exporter copied to clipboard
Interpolate environment variables in config
As a general solution to the type of problem which #7 deals with, it would be nice to be able to reference environment variables in some or all config. For example, if we were to use golang templates, it might look like:
target:
data_source_name: 'sqlserver://prom_user:{{.PROM_PASSWORD}}@dbserver1.example.com:1433'
This could be done either for the entire file or for specific keys. I think it would be straightforward enough and I'd be happy to do it if you think it would be useful.
Here's a simple implementation:
https://github.com/free/sql_exporter/compare/master...treatwell:master