albertodonato / query-exporter

Export Prometheus metrics from SQL queries
GNU General Public License v3.0
436 stars 101 forks source link

Allow query sql to be defined in a file #188

Open toddwh50 opened 7 months ago

toddwh50 commented 7 months ago

Is your feature request related to a problem? Please describe. Many of my queries are long and complex, making the config.yml very long. Since I don't have permission to add views or stored procedures to the target database, I cannot shorten the sql statement that goes into the config.

Describe the solution you'd like It would be helpful to allow a query to reference a filename containing the sql for the query instead of having to put the entire sql within the YAML.

Describe alternatives you've considered An alternative might be to implement and "!include" directive in the yaml parser that could be used to include files containing the SQL.

Additional context None.