sql_exporter icon indicating copy to clipboard operation
sql_exporter copied to clipboard

Support data source configuration outside of sql_exporter.yml

Open marcinbudny opened this issue 7 years ago • 2 comments

Instead of specifying the data_source_name directly in sql_exporter.yml, provide an option to point to external file or environment variable, that contains the data source config.

Use case: I want to store the credentials to the database securely in a Kubernetes secret, while the sql_exporter.yml would be a Kubernetes config map. There is no easy way to interpolate the secret into the config map. But if I was able to point to an external file on env variable, the problem would be solved.

marcinbudny avatar Feb 12 '18 13:02 marcinbudny

Done. With apologies for not even replying until now.

There exists now a flag, config.data-source-name, which will override the value of target.data_source_name, as defined in the configuration file. Note that you still need to provide a non-empty value for target.data_source_name in the configuration file, if only for documentation purposes.

free avatar May 14 '18 13:05 free

Thanks!

marcinbudny avatar May 14 '18 19:05 marcinbudny