#46 Add Prometheus exporter

This commit is contained in:
Tobias Kantusch
2021-02-18 18:02:56 +01:00
committed by Sebastian Serth
parent 39fcd255f9
commit 44b32b6f6a
26 changed files with 2121 additions and 45 deletions

View File

@ -0,0 +1,10 @@
# frozen_string_literal: true
return unless CodeOcean::Config.new(:code_ocean).read[:prometheus_exporter][:enabled]
return if Rake.application.top_level_tasks.to_s.include?('db:')
# Add metric callbacks to all models
ApplicationRecord.include Prometheus::Record
# Initialize the counters according to the db
Prometheus::Controller.initialize_metrics