Skip to content

Is it possible to distinguish between the sql exporter process status and the target database? #384

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

You must be logged in to vote

Hey @karenlava,

I think you might want to name your target in the configuration like here:

# The target to monitor and the list of collectors to execute on it.
target:
  name: "target_name"
  data_source_name: 'dsn://example'
  collectors: [collectors_example]

Once configured, there should appear another up metric (it's exposed by sql_exporter) with the target name label (and any other static labels you might include as well), that corresponds to the database connection state. The name should be put explicitly for a single target mode. In case of using jobs (multi-target mode), the labels are populated automatically.

So, If you query the up metric with respective labels (e.g. target label…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by burningalchemist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
enhancement New feature or request
3 participants
Converted from issue

This discussion was converted from issue #381 on November 07, 2023 12:35.