Sha256: 2777c4666afc3290f37415f9bce38a02e4d95a4ceb5911b682badbf895955963
Contents?: true
Size: 1023 Bytes
Versions: 16
Compression:
Stored size: 1023 Bytes
Contents
# typed: false module Datadog module Tracing module Contrib module Grape # Instrumentation for Grape::Endpoint module Instrumentation def self.included(base) base.singleton_class.prepend(ClassMethods) base.prepend(InstanceMethods) end # ClassMethods - implementing instrumentation module ClassMethods def generate_api_method(*params, &block) method_api = super proc do |*args| ::ActiveSupport::Notifications.instrument('endpoint_render.grape.start_render') method_api.call(*args) end end end # InstanceMethods - implementing instrumentation module InstanceMethods def run(*args) ::ActiveSupport::Notifications.instrument('endpoint_run.grape.start_process', endpoint: self, env: env) super end end end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems