Dispatches incoming request on rpc.

        Initializes rpc if necessary and dispatches incoming request.  If a rpc
        error is thrown, this function will attempt to recreate the stream and
        retry sending given request once.

        :type request: class:
          `~.metrics_service_pb2.ExportMetricsServiceRequest`
        :param request: incoming export request

def send(self, request):
        """Dispatches incoming request on rpc.

        Initializes rpc if necessary and dispatches incoming request.  If a rpc
        error is thrown, this function will attempt to recreate the stream and
        retry sending given request once.

        :type request: class:
          `~.metrics_service_pb2.ExportMetricsServiceRequest`
        :param request: incoming export request
        """
        if not self._initialized:
            self._initialize(request)
            return

        try:
            self._rpc.send(request)
        except grpc.RpcError as e:
            logging.info('Found rpc error %s', e, exc_info=True)
            # If stream has closed due to error, attempt to reopen with the
            # incoming request.
            self._initialize(request)