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: excon.rb
    path of file: ./repos/newrelic-ruby-agent/lib/new_relic/agent/instrumentation
    
    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

Dependency
    
  def install_middleware_excon_instrumentation
    NewRelic::Agent.logger.info('Installing middleware-based Excon instrumentation')
    require 'new_relic/agent/instrumentation/excon/middleware'
    defaults = Excon.defaults

    if defaults[:middlewares]
      defaults[:middlewares] << Excon::Middleware::NewRelicCrossAppTracing
    else
      NewRelic::Agent.logger.warn('Did not find :middlewares key in Excon.defaults, skipping Excon instrumentation')
    end