#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

27
lib/prometheus/record.rb Normal file
View File

@ -0,0 +1,27 @@
# frozen_string_literal: true
module Prometheus
module Record
extend ActiveSupport::Concern
included do
after_create_commit :create_notification
after_destroy_commit :destroy_notification
after_update_commit :update_notification
end
private
def create_notification
Prometheus::Controller.create_notification self
end
def destroy_notification
Prometheus::Controller.destroy_notification self
end
def update_notification
Prometheus::Controller.update_notification self
end
end
end