The following PR introduces histogram for query duration. Doing so allow to use sql_exporter for synthetic monitoring.
A user could the following configuration
misc:
histogram_buckets:
- .25
- .5
- 1
- 2
- 4
jobs:
- connections:
- postgres://localhost:5432/canary?sslmode=require
interval: 1s
name: mydb
queries:
- allow_zero_rows: true
help: ""
name: delete_from_canary
query: delete from canary_check;
values: []
- allow_zero_rows: true
help: ""
name: insert_into_canary
query: insert into canary_check values(now()) on conflict do nothing;
values: []
- allow_zero_rows: true
help: ""
name: select_from_canary
query: select 1 as up from canary_check;
values:
- up
startup_sql:
- SET lock_timeout = 1000
- SET idle_in_transaction_session_timeout = 100
The following PR introduces histogram for query duration. Doing so allow to use sql_exporter for synthetic monitoring. A user could the following configuration
The resulting histogram looks like this
This is of great help to monitor the latency from a client point of view and build SLO around that. See also: https://prometheus.io/docs/practices/histograms/