def patch_botocore_session_send(context, http_filter):
    """
    Monkey patches botocore's vendored requests, if available. Overloads the
    Session class' send method to add tracing and metric collection.
    """
    if BotocoreSession is None:
        return

    def send(self, *args, **kwargs):
        id = str(uuid.uuid4())
        with context.iopipe.mark(id):
            response = original_botocore_session_send(self, *args, **kwargs)
        trace = context.iopipe.mark.measure(id)
        context.iopipe.mark.delete(id)
        collect_metrics_for_response(response, context, trace, http_filter)
        return response

    BotocoreSession.send = send
Monkey patches botocore's vendored requests, if available. Overloads the
    Session class' send method to add tracing and metric collection.