You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: instrumentation.rb
    path of file: ./repos/newrelic-ruby-agent/lib/new_relic/agent/instrumentation/rake
    
    the code of the file until where you have to start completion: # This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
# frozen_string_literal: true

module NewRelic
  module Agent
    module Instrumentation
      module Rake
        module Tracer
          INSTRUMENTATION_NAME = 'Rake'

          def invoke_with_newrelic_tracing(*args)
            unless NewRelic::Agent::Instrumentation::Rake.should_trace?(name)
    
    
        def ensure_at_exit
          return if @installed_at_exit

          at_exit do
            # The agent's default at_exit might not default to installing, but
            # if we are running an instrumented rake task, we always want it.
            # No code coverage, as the strategy for mocking Kernel.exit prevents
            # the at_exit block from being executed, and not mocking results in
            # an early unwanted exit of MiniTest.
            # :nocov:
            NewRelic::Agent.shutdown
            # :nocov:
          end

          @installed_at_exit = true
        end