The LORD judges the peoples;
judge me, O LORD, according to my righteousness
and according to the integrity that is in me.
This is quite the prayer. It accepts the reality of God as Judge. I'm not sure that is a part of God that "comforts" me. I know my sin so well that the thought of God as judge disturbs me. I know what my sins deserve. Even though Jesus died for those sins, I know that the weight of them brought me far from a holy God. I would not pray for God to judge me.
Yet this was prayed appealing to personal righteousness and integrity. The worshiper knew that God saw beyond sin. The worshiper was living in a measure of obedience under a knowledge of God's grace. And this request came from that heart. The repentant soul knows forgiveness and grace. It finds freedom to invite God's scrutiny in integrity and righteousness.
O God Who judges the nations,
In Christ I have been forgiven, for He has taken my judgment on the cross. You will look at me through His holy sacrifice now. And what righteousness or integrity that is in me is there because Christ's righteousness covers me. I can know the truth and do what is holy in Your sight. Thank You, Lord! May I not lose sight of this marvelous, helpful truth!