Sha256: ae47e477edd0c1f7f7a8706c9f1c0de7ed9ea2a48abcae16364e5b59070f3515
Contents?: true
Size: 1.01 KB
Versions: 18
Compression:
Stored size: 1.01 KB
Contents
# frozen_string_literal: true 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
18 entries across 18 versions & 1 rubygems