Class: Sapience::Extensions::Grape::Notifications
- Inherits:
-
Notifications
- Object
- Notifications
- Sapience::Extensions::Grape::Notifications
- Defined in:
- lib/sapience/extensions/grape/notifications.rb
Instance Attribute Summary
Attributes inherited from Notifications
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Notifications
constructor
Options:.
Methods inherited from Notifications
#metrics, #record?, subscribe, use
Constructor Details
#initialize(opts = {}) ⇒ Notifications
Options:
*:metric_name - the metric name, defaults to “grape.request” *:tags - additional tags
9 10 11 12 13 14 15 16 |
# File 'lib/sapience/extensions/grape/notifications.rb', line 9 def initialize(opts = {}) super @metric_name = opts[:metric_name] || "grape.request" Sapience::Extensions::Notifications.subscribe "endpoint_run.grape" do |event| record event end end |