Class: Sapience::Extensions::Grape::Notifications
- Inherits:
-
Notifications
- Object
- Notifications
- Sapience::Extensions::Grape::Notifications
- Includes:
- RequestFormatHelper
- 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 included from RequestFormatHelper
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
13 14 15 16 17 18 19 20 |
# File 'lib/sapience/extensions/grape/notifications.rb', line 13 def initialize(opts = {}) super @metric_name = opts[:metric_name] || "grape.request" Sapience::Extensions::Notifications.subscribe "endpoint_run.grape" do |event| record event end end |