#46 Add Prometheus exporter
This commit is contained in:

committed by
Sebastian Serth

parent
39fcd255f9
commit
44b32b6f6a
27
lib/prometheus/record.rb
Normal file
27
lib/prometheus/record.rb
Normal 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
|
Reference in New Issue
Block a user