def instrument(type, field)
      # Ignore internal GraphQL types
      if type.name.starts_with?("__")
        field
      else
        label = "#{type.name}.#{field.name}"
        old_resolve_proc = field.resolve_proc

        new_resolve_proc = -> (obj, args, ctx) {
          ActiveSupport::Notifications.instrument(NAME, label: label) do
            @instrumenter.instrument("GraphQL", label) do
              resolved = old_resolve_proc.call(obj, args, ctx)
              resolved
            end
          end
        }

        # Return a copy of `field`, with a new resolve proc
        field.redefine do
          resolve(new_resolve_proc)
        end
      end
    end
def instrument(type, field)
      # Ignore internal GraphQL types
      if type.name.starts_with?("__")
        field
      else
        label = "#{type.name}.#{field.name}"
        old_resolve_proc = field.resolve_proc

        new_resolve_proc = -> (obj, args, ctx) {
          ActiveSupport::Notifications.instrument(NAME, label: label) do
            @instrumenter.instrument("GraphQL", label) do
              resolved = old_resolve_proc.call(obj, args, ctx)
              resolved
            end
          end
        }

        # Return a copy of `field`, with a new resolve proc
        field.redefine do
          resolve(new_resolve_proc)
        end
      end
    end
instrumenter must respond to #instrument
 See ScoutApm::Tracer for example
 Track timing for all fields