generic-pool-prometheus-exporter
Prometheus exporter for the generic-pool
npm
package that's used by knex.
API
poolExporter
Create pool exporter
Types:
{type=min}
min size of the pool{type=max}
size of the pool{type=acquired}
number of resources that are currently acquired{type=spare_capacity}
number of resources the pool could create before hitting any limits{type=available}
number of unused resources in the pool{type=borrowed}
number of resources that are currently acquired by userland code{type=pending}
number of callers waiting to acquire a resource
Metrics:
# HELP pool_size_total Size of the pool
# TYPE pool_size_total gauge
pool_size_total{type="min"} 2
pool_size_total{type="max"} 3
pool_size_total{type="acquired"} 1
pool_size_total{type="spare_capacity"} 2
pool_size_total{type="available"} 0
pool_size_total{type="borrowed"} 1
pool_size_total{type="pending"} 0
Parameters
pool
Pool generic-pool instanceopts
Object? options
Examples
With generic-pool
(node-pool)
const promClient = ;const pool = ;const poolExporter = ; const myPool = genericPool;const exporter = ; console// exporter.registry.off()
<caption>With manual observeconst promClient = ;const pool = ;const poolExporter = ; const myPool = genericPool;const exporter = ; // exporter.observe();console// exporter.observe();console
With knex
const promClient = ;const Knex = ;const poolExporter = ; const knex = ;const exporter = ; console// =>// # HELP pool_size_total Size of the pool// # TYPE pool_size_total gauge// pool_size_total{type="min"} 2// pool_size_total{type="max"} 3// pool_size_total{type="acquired"} 1// pool_size_total{type="spare_capacity"} 2// pool_size_total{type="available"} 0// pool_size_total{type="borrowed"} 1// pool_size_total{type="pending"} 0
Returns Function exporter { off, observe }