Sayyiduna Jabir bin Atik (may Allah be pleased with him) said that the Prophet (peace and blessings be upon him) said: "Sometimes Allah loves jealousy (ghayrah), and sometimes jealousy is not liked by Allah. The jealousy which Allah, the Lord of Might, loves is that concerning a matter of suspicion, and the jealousy which Allah dislikes is that which is shown without suspicion. And Allah, the Lord of Might, loves the pride a person adopts at the time of fighting, or pride at the time of giving charity; and the pride which Allah dislikes is that a person adopts boastfulness and arrogance about himself."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب السير / 18478