David opens with a cry: he asks God to hear his plea and to listen to his prayer. From the end of the earth, with a heart that is growing faint, he asks to be led to a rock that is higher than he is. He remembers that God has been a refuge and a strong tower against the enemy, and that memory supports his request.
In the next verses the psalmist voices his longing to live forever in God's tent and to take refuge under the cover of his wings. The reason is that God has heard his vows and has given him the heritage of those who fear his name.
The second half changes voice and prays for the king: that God would add days to his days, that his years would last through many generations and that he would reign forever in God's presence, guarded by steadfast love and faithfulness. The psalm closes with a decision to sing praise to God's name and to fulfill what he has promised, day by day.