I heard the Messenger of Allah ﷺ say in his prayer, "O Allah, by Your knowledge of the unseen and Your power over creation, keep me alive as long as You know that life is best for me, and take me when You know that death is best for me. O Allah, I ask You for awe of You in private and in public. I ask You for the word of truth in times of contentment and anger. I ask You for moderation in poverty and in wealth. I ask You for blessings that never cease, and for delight of the eye that never ends. I ask You for contentment after Your decree, and for the coolness of life after death. I ask You for the pleasure of gazing upon Your Face, and the longing to meet You, without any harmful affliction or misleading trial. O Allah, adorn us with the beauty of faith, and make us guides who are rightly guided."
سمعت رسول الله ﷺ يقول في صلاته: اللهم بعلمك الغيب، وقدرتك على الخلق أحيني ما علمت الحياة خيرا لي، وتوفني إذا علمت الوفاة خيرا لي، اللهم أسألك خشيتك- يعني في الغيب والشهادة-، وأسألك كلمة الحق في الرضا والغضب، وأسألك القصد في الفقر والغنى، وأسألك نعيما لا ينفد، وأسألك قرة عين لا تنقطع، وأسألك الرضا بعد القضاء، وأسألك برد العيش بعد الموت، وأسألك لذة النظر إلى وجهك، والشوق إلى لقائك في غير ضراء مضرة، ولا فتنة مضلة، اللهم زينا بزينة الإيمان، واجعلنا هداة مهتدين.
Nasai narrated it (1305), and Ibn Hibban graded it sahih (1971), as did Hakim (1/524), all of them through Hammad bin Zayd, who said, Ata bin Saaib bin Malik narrated to us, from his father, who said, Ammar bin Yasir led us in a prayer and made it brief. Some of the people said to him, "You have shortened," or, "You have made the prayer brief." He said, "As for that, I offered in it supplications that I heard from the Messenger of Allah ﷺ." When he stood up, a man from the group followed him, and this was my father (that is, the father of Ata), though he referred to himself in the third person, and he asked him about the supplication. Then he came and told the people, and he mentioned the supplication.Its chain of transmission is sahih. Ata bin Saaib is trustworthy, and the leading scholars affirmed his reliability, except that he became confused in his memory toward the end of his life. However, Hammad bin Zayd's transmission from him took place before that confusion set in.