The present invention provides an inhibitor of Bruton's tyrosine kinase, which is a compound of formula (I), or its pharmaceutically acceptable salt, solvate, ester, acid, metabolite or prodrug. The present invention also provides a pharmaceutical composition comprsing the compound. The present invention also provides a method for inhibiting the activity of tyrosine kinase activity or for treating a disease, disorder, or condition, which would benefit from the inhibition of Bruton's tyrosine kinase(s), by using the Bruton's tyrosine kinase inhibitor, as well as application of the Bruton's tyrosine kinase inhibitor for the same.