Skip to content

How to make sql_exporter consider different database versions when fetching data? #473

Closed Answered by burningalchemist
blueeye2015 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @blueeye2015, there is no way to set conditionals for queries, as we would need an additional query to identify the version of the database. And each database has a different way to store the version. It doesn't play well with the agnostic nature of this exporter.

So currently the config file might need to be pre-rendered based on the requirements. It happens outside of sql_exporter anyways.

Other available options are (in the order of increasing complexity):

  • have two sql_exporters with two separate queries;
  • have two separate queries within a single exporter, ignore errors;
  • have two separate jobs in sql_exporter and call them separately with query parameter /metrics?jobs[]=job_name;
  • a…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@blueeye2015
Comment options

Answer selected by burningalchemist
Comment options

You must be logged in to vote
1 reply
@burningalchemist
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants