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/f7dcb0fb-6182-4c04-97a7-4504d004860do%40googlegroups.com.

Reply via email to