Class: Telegraf::Grape
- Inherits:
-
Object
- Object
- Telegraf::Grape
- Defined in:
- lib/telegraf/grape.rb
Overview
Telegraf::Grape
This class extends requests metrics with details for Grape API endpoints.
Tags:
-
‘controller`:
The Grape endpoint class.
-
‘instance`:
The Grape endpoint class.
-
‘format`:
Grape's internal identifier for the response format.
Instance Method Summary collapse
Instance Method Details
#call(_name, _start, _finish, _id, payload) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/telegraf/grape.rb', line 21 def call(_name, _start, _finish, _id, payload) point = payload[:env][::Telegraf::Rack::FIELD_NAME] return unless point endpoint = payload[:endpoint] return unless endpoint point.[:controller] = endpoint.[:for].to_s point.[:instance] = point.[:controller] point.[:format] = payload[:env]['api.format'] end |