Skip to content
Discussion options

You must be logged in to vote

Hey @qfritz, it's possible to set the statement_timeout as a parameter in the DSN, as in:

postgres://user:pass@host/db?statement_timeout=25000 (it's in milliseconds)

But it's per connection and would not apply to specific queries/metrics.

I think it's likely to be related to the scrape timeouts combo on Prometheus/sql_exporter side.

From the docs:

Scrape timeouts ensure that:
  #   (i)  scraping completes in reasonable time and
  #   (ii) slow queries are canceled early when the database is already under heavy load
  # Prometheus informs targets of its own scrape timeout (via the "X-Prometheus-Scrape-Timeout-Seconds" request header)
  # so the actual timeout is computed as:
  #   min(scr…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@qfritz
Comment options

@qfritz
Comment options

@burningalchemist
Comment options

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