Consider the wisdom books (Ecclesiastes, Proverbs, Job) not only as complementary, differing in focus and filling out the ideas by considering difficult cases, but also as a progression.
Ecclesiastes begins with a lost person, who despite a measure of wisdom, is confused about the meaning and purpose of life and unable to find the most enjoyable course to follow. It ends with the conclusion: "Fear God and keep his commandments."
Proverbs begins (in 1:7) with the thesis: "The fear of the Lord is the beginning of knowledge, but fools despise wisdom and instruction." But chapter 2 begins with a passage that stands in contrast with Ecclesiastes and touches on your question:
My son, if you accept my words
and store up my commands within you, 2 turning your ear to wisdom
and applying your heart to understanding— 3 indeed, if you call out for insight
and cry aloud for understanding, 4 and if you look for it as for silver
and search for it as for hidden treasure, 5 then you will understand the fear of the Lord
and find the knowledge of God. 6 For the Lord gives wisdom;
from his mouth come knowledge and understanding. 7 He holds success in store for the upright,
he is a shield to those whose walk is blameless, 8 for he guards the course of the just
and protects the way of his faithful ones. 9 Then you will understand what is right and just
and fair—every good path. 10 For wisdom will enter your heart,
and knowledge will be pleasant to your soul.
The Teacher in Ecclesiastes did speak of how wisdom brought pain, mourning, and suffering. But here in Proverbs it states that fallen humans do not find wisdom "pleasant to the soul" unless they embark on a journey of the heart. Humility - and the hungering and thirsting that Jesus alludes to in the Beatitudes - are required. Making the acquisition of wisdom a top priority and treasuring it more than material wealth and pleasure is a precondition for Wisdom satisfying the soul.
Job completes the trilogy. It begins with "In the land of Uz there lived a man whose name was Job. This man was blameless and upright; he feared God and shunned evil." In verse 8 this characterization of Job is cemented:
Then the Lord said to Satan, “Have you considered my servant Job?
There is no one on earth like him; he is blameless and upright, a man
who fears God and shuns evil.”
So Ecclesiastes ends with a call to fear the Lord, Proverbs is saturated with it (there are at least twenty passages describing the benefits of fearing the Lord), and Job begins with it, as it explores what happens when fearing God seems to fail. The faith that sustained Job even when the blessings of a God-fearing life disappeared was a faith built upon the glory that God had revealed to him during his years of obedience. That glory persuaded Job that God's character was such that He would redeem him, would answer him, would appear in his time of need. In the end, it was not God's wisdom as a form of utilitarian access to manifold blessings that Job pursued, it was God Himself.
In Exodus 33, despite assurances from God that He would send an angel to accompany them, Moses held out for more.
15 Then Moses said to him, “If your Presence does not go with us, do
not send us up from here. 16 How will anyone know that you are pleased
with me and with your people unless you go with us? What else will
distinguish me and your people from all the other people on the face
of the earth?”
17 And the Lord said to Moses, “I will do the very thing you have
asked, because I am pleased with you and I know you by name.”
18 Then Moses said, “Now show me your glory.”
Ultimately the desire of the heart of Moses, Job, and all who have faith is to behold God's glory, and fearing God is the path that leads there. Though Ecclesiastes 1:8 says this:
All things are wearisome,
more than one can say.
The eye never has enough of seeing,
nor the ear its fill of hearing.
the Glory of God will fill our eyes and satisfy us forever.
As Psalm 27:4 says:
One thing I ask from the LORD, this only do I seek: that I may dwell
in the house of the LORD all the days of my life, to gaze on the
beauty of the LORD and to seek him in his temple.