Thanks for your help, it works! On Saturday, June 20, 2020 at 1:24:20 PM UTC+4:30, Brian Candler wrote: > > OK, the instance labels look consistent. So the first thing I suggest is > breaking your attempted query into parts and look at the results: > > sum (pg_locks_count) by (instance) > > pg_settings_max_locks_per_transaction * pg_settings_max_connections > > Do both of those give reasonable answers? If so you should be able to > combine them with the division operator. But if label sets are not > identical you'll need to tell it which labels to match or ignore. You > could use > > A / on(instance) B > > A / ignoring(mode,datname) B > > So in this case, given that you've already summed by instance, I would > suggest: > > (sum (pg_locks_count) by (instance)) / on (instance) ( > pg_settings_max_locks_per_transaction * pg_settings_max_connections) > >
-- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/0a14a6f6-7d0c-4f3f-be2a-fca852cf18b9o%40googlegroups.com.

