Hannah was not able to have a child, which was a tragic state of affairs in those days. When she had reached the very depths of despair, she prayed earnestly - made a covenant with God - that if she were blessed with a child, she would give up him to serve in the temple. This prayer was strictly between her and her God - no witnesses.
When the child came, she never wavered from her promise - imagine the joy she was experiencing, how easy it would have been to revise her promise, perhaps justify keeping the child because surely a loving God would not hold her to such a hard thing... No. Hannah fulfilled her side of the covenant, so that as soon as the child was weaned, she delivered him to the priest.
How many would do that? How often have we made a covenant in secret, and then, when we got what we wanted, bent the rules a bit because, who would know?
Hannah set the standard for all time. And what was the result? Her son, Samuel, turned out to be the faithful prophet and spiritual leader of Israel. AND, Hannah, to her joy, went on to have five more children.
When we are tempted to deviate from a covenant we may have made, remember Hannah, and trust God's disposal of events!