Ask questionsNo metrics gathered, [from Gatherer #1] bad connection

There is a problem when there are no calls to the exporter for a long time, he seems to "fall asleep" and, when asked again, swears like this:

> No metrics gathered, [from Gatherer #1] bad connection

Restarting the exporter solves the problem and it continues to work and returns the metrics normally, as long as requests to it go.

How to reproduce the problem

  1. Raise an exporter anywhere
  2. Collect a couple of queries to the database and contact the exporter for them
  3. Wait 5-15 minutes without making any requests
  4. Contact the exporter again, there will be a problem.

Answer questions burningalchemist

@jesus-velez It's mainly code related, but it's also reflected in the settings. :) It really depends on how a driver interacts with your database instance (and what are the quirks), but you can try an alternative driver pgx, if you work with Postgres, and/or add max_connection_lifetime: parameter to sql_exporter.yml and try it out.

As I said, I had a similar case and was able to find a solution for it. Also, in the fork I currently maintain, the drivers and their dependencies have been updated, it might be the case too.

But yeah, it's a path of trial and errors. I'm happy to support, if you can try things out and provide some intermediate results. :)


Related questions

No questions were found.
Github User Rank List