Skip to content

Commit 7136156

Browse files
Export activerecord metrics via prometheus
- An existing collector already exsists we just need to start it - Exported metrics are: | `active_record_connection_pool_connections` | Total connections in pool | | `active_record_connection_pool_busy` | Connections currently in use | | `active_record_connection_pool_dead` | Dead connections | | `active_record_connection_pool_idle` | Idle connections | | `active_record_connection_pool_waiting` | Requests waiting for a connection |
1 parent a6b3dc5 commit 7136156

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

config/initializers/falcon.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
if ENV["EXPORT_WEB_METRICS"] == "true"
44
require "prometheus_exporter/instrumentation"
55
PrometheusExporter::Instrumentation::Process.start(type: "web")
6+
PrometheusExporter::Instrumentation::ActiveRecord.start
67
end

config/initializers/sidekiq.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ def call(_worker, job, _queue)
4747

4848
config.on :startup do
4949
PrometheusExporter::Instrumentation::Process.start type: "sidekiq"
50+
PrometheusExporter::Instrumentation::ActiveRecord.start
5051
PrometheusExporter::Instrumentation::SidekiqProcess.start
5152
PrometheusExporter::Instrumentation::SidekiqQueue.start
5253
PrometheusExporter::Instrumentation::SidekiqStats.start

0 commit comments

Comments
 (0)