What does Judaism have to say about sleep? 3a - staying awake
Temple workers

(ב) אִישׁ הַר הַבַּיִת הָיָה מְחַזֵּר עַל כָּל מִשְׁמָר וּמִשְׁמָר, וַאֲבוּקוֹת דּוֹלְקִין לְפָנָיו, וְכָל מִשְׁמָר שֶׁאֵינוֹ עוֹמֵד, אוֹמֵר לוֹ אִישׁ הַר הַבַּיִת, שָׁלוֹם עָלֶיךָ. נִכָּר שֶׁהוּא יָשֵׁן, חוֹבְטוֹ בְמַקְלוֹ. וּרְשׁוּת הָיָה לוֹ לִשְׂרֹף אֶת כְּסוּתוֹ. וְהֵם אוֹמְרִים, מַה קּוֹל בָּעֲזָרָה. קוֹל בֶּן לֵוִי לוֹקֶה וּבְגָדָיו נִשְׂרָפִין, שֶׁיָּשֵׁן לוֹ עַל מִשְׁמָרוֹ. רַבִּי אֱלִיעֶזֶר בֶּן יַעֲקֹב אוֹמֵר, פַּעַם אַחַת מָצְאוּ אֶת אֲחִי אִמָּא יָשֵׁן, וְשָׂרְפוּ אֶת כְּסוּתוֹ:

(2) The man [who is in charge] of the Temple Mount would go around to each and every guard. In front of him there were lit torches and any guard who was not standing [on guard], the man of the Temple Mount would say to him [the sleeping guard] "Peace onto you." If it was apparent that he [the guard] was sleeping he would hit him with his stick. He even had permission to burn his [the sleeping guard's] clothes. [If that occurred] they [the people on the outsde] would say "What is that noise in the Temple Courtyard?" [They were told that] it is the voice of a Levi being beaten and whose clothes are being burned because he slept on guard duty. Rebbi Eliezer ben Yaakov says: "They once, found my mother's brother sleeping and they burned his cloak."

תנן התם איש הר הבית היה מחזר על כל משמר ומשמר ואבוקות דולקות לפניו וכל משמר שאינו עומד וא"ל איש הר הבית

We learned in a mishna there: the officer of the Temple Mount would make his rounds to each and every guard with torches lit before him. And any guard who did not stand, and say to him “officer of the Temple Mount

שלום עליך ניכר שהוא ישן חובטו במקלו ורשות היתה לו לשרוף את כסותו והם אומרים מה קול בעזרה קול בן לוי לוקה ובגדיו נשרפין שישן לו על משמר ר' אליעזר בן יעקב אומר פעם אחת מצאו את אחי אמי ישן ושרפו את כסותו א"ר חייא בר אבא כי מטי רבי יוחנן בהא מתניתא אמר הכי אשריהם לראשונים שאפילו על אונס שינה עושין דין שלא על אונס שינה על אחת כמה וכמה

- peace unto you!” was recognised as sleeping and the office would strike him with his staff and he also had permission to burn his garment. And they [the people of Jerusalem] would say: what is that noise in the courtyard? a Levi being beaten and his clothing set alight because he fell asleep on his watch. R. Eliezer ben Yaakov says: One time they found my mother’s brother sleeping on his watch and they burned his garment.

Rabbi Chiya bar Abba would say when they reached this mishna: Fortunate are the earlier ones for even for [a sin committed through] coercion of sleep they would execute judgement. For a sin not committed through coercion of sleep how much more so [would they execute judgement.]

Yom Kippur night

מתני [...] עם חשיכה לא היו מניחין אותו לאכול הרבה מפני שהמאכל מביא את השינה

MISHNA: [...] On Yom Kippur eve at nightfall, they would not allow him to eat a great deal because food induces sleep

מתני׳ בקש להתנמנם פרחי כהונה מכין לפניו באצבע צרדא ואומרים לו אישי כ"ג עמוד והפג אחת על הרצפה ומעסיקין אותו עד שיגיע זמן השחיטה

גמ׳ [...] מיקירי ירושלים לא היו ישנין כל הלילה כדי שישמע כ"ג קול הברה ולא תהא שינה חוטפתו תניא אבא שאול אמר אף בגבולין היו עושין כן זכר למקדש אלא שהיו חוטאין אמר אביי ואיתימא ר"נ בר יצחק תרגומא נהרדעא דא"ל אליהו לרב יהודה אחוה דרב סלא חסידא אמריתו אמאי לא אתי משיח והא האידנא יומא דכיפורי הוא ואבעול כמה בתולתא בנהרדעא אמר ליה הקב"ה מאי אמר אמר ליה

MISHNA: If the High Priest sought to sleep at night, the young priests would snap the middle [tzerada] finger against the thumb before him, and they would say to him every so often: My Master, High Priest. Stand from your bed and chill yourself once on the floor and overcome your drowsiness. And they would engage him in various ways until the time would arrive to slaughter the daily offering.

GEMARA: [...] the prominent men of Jerusalem would not sleep the entire night but instead engaged in Torah study, so that the High Priest would hear the sound of noise in the city and sleep would not overcome him in the silence of the sleeping city. It was taught in a baraita that Abba Shaul said: They would do so even in the outlying areas and stay awake all night in acknowledgment of the Temple; however, the result was that they would sin, as the men and women would participate in games together to pass the time, leading to transgression. Abaye said, and some say it was Rav Naḥman bar Yitzḥak who said: Interpret that statement as referring to Neharde’a, as Elijah the Prophet said to Rav Yehuda, brother of Rav Salla Ḥasida: You have said and wondered: Why has the Messiah not come? Why is that surprising? Isn’t today Yom Kippur, and relations were had with several virgins in Neharde’a, as the men and women stayed awake all night and that led to promiscuity? Rav Yehuda said to him: What did the Holy One, Blessed be He, say about those sins committed by the Jewish people? He said: This is what God said:

Sukkot Water Drawing Celebration

תניא אמר ר' יהושע בן חנניה כשהיינו שמחים שמחת בית השואבה לא ראינו שינה בעינינו

איני והאמר רבי יוחנן שבועה שלא אישן שלשה ימים מלקין אותו וישן לאלתר אלא הכי קאמר לא טעמנו טעם שינה דהוו מנמנמי אכתפא דהדדי:

It is taught in a baraita that Rabbi Yehoshua ben Ḥananya said: When we would rejoice in the Celebration of the Place of the Drawing of the Water, we did not see sleep in our eyes the entire Festival. [description of the celebrations]

Really? But didn’t Rabbi Yoḥanan say: One who took an oath that I will not sleep three days, one flogs him immediately for taking an oath in vain, and he may sleep immediately because it is impossible to stay awake for three days uninterrupted. Rather, this is what Rabbi Yehoshua is saying: We did not experience the sense of actual sleep, because they would merely doze on each other’s shoulders. In any case, they were not actually awake for the entire week.

Erev Shavuot

(ז) ר' חנינא אומר, בחדש השלישי היום כפול בלילה וישנו ישראל עד שתי שעות ביום ששינת יום העצרת עריבה והלילה קצרה ויצא משה ובא למחנה ישראל והיה מעורר ישראל משינתם ואמ' להם עימדו משינתכם שהרי אלהיכם מבקש ליתן לכם את התורה, כבר החתן מבקש להביא את הכלה להכניס לחופה כדי ליתן לכם את התורה. באה השעה, שנ' ויוצא משה את העם וכו', ואף הב"ה יצא לקראתן כחתן היוצא לקראת כלה כן הב"ה יצא לקראתן ליתן להם את התורה שנ' ה' בצאתך משעיר וכו'.

(7) Rabbi Chanina said: || In the third month the day is double the night, and the Israelites slept until two hours of the day, for sleep on the day of the (feast of) 'Azereth is pleasant, the night being short. And Moses went forth and came to the camp of the Israelites, and he aroused the Israelites from their sleep, saying to them: Arise ye from your sleep, for behold, your God desires to give the Torah to you. Already the bridegroom wishes to lead the bride and to enter the bridal chamber. The hour has come for giving you the Torah, as it is said, "And Moses brought forth the people out of the camp to meet God" (Ex. xix. 17). And the Holy One, blessed be He, also went forth to meet them; like a bridegroom who goes forth to meet the bride, so the Holy One, blessed be He, went forth to meet them to give them the Torah, as it is said, "O God, when thou wentest forth before thy people" (Ps. lxviii. 7).

The first documented instance of a tikkun vigil, more or less as we now know it, took place in the early 16th century. In a well-known letter, the kabbalist Solomon Alkabetz, now mostly remembered as the author of Lekha Dodi, recounts the mind-bending experience of spending Shavuot night with the great halakhist Joseph Karo. Both men were later to become key figures in the kabbalistic circles of Safed, but Karo was then living in Nicopolis, in present-day Bulgaria, where his father had preceded him as chief rabbi. Although the Zohar, the major work of medieval, had not yet been published, Karo was strongly influenced by its teachings, as the great historian Jacob Katz deftly demonstrated. Karo must, therefore, have been familiar with the passage in the Zohar that describes its mystical hero Rabbi Simeon bar Yochai engaged in Torah study “all night when the bride was about to be united with her husband.” As the scholar Isaiah Tishby explained, this referred to the night of Shavuot, when the Shekhina, which is the tenth sephira (a divine emanation, power, or rung), often symbolized as a bride, was to be united with the higher sephira of Tiferet, her husband.

Rabbi Simeon explained to his disciples that those studying Torah on the night of Shavuot, proceeding from biblical texts to rabbinic and mystical ones, were like friends of the bride staying up with her on the eve of her wedding, adorning her with ornaments so that the groom would find her attractive. When the groom saw his beautifully adorned bride at the ceremony, accompanied by her bridesmaids (the Torah scholars), he would inquire after them and bless them.

In Nicopolis, sometime in the 1530s, Rabbis Alkabetz and Karo decided to reenact that allegedly ancient Zoharic scene. Karo, the senior of the two, asked Alkabetz to prepare an order of study—or rather, recitation—for the occasion. The order of texts followed by the two scholars seems to have been improvised and was somewhat haphazard, a characteristic sign of a tradition being “invented.”

- "A Tale of Two night Vigils" by Elliot Horowitz in Jewish Review of Books, Fall 2016

Deliberate sleep avoidance

(ד) רַבִּי חֲנִינָא בֶן חֲכִינַאי אוֹמֵר, הַנֵּעוֹר בַּלַּיְלָה וְהַמְהַלֵּךְ בַּדֶּרֶךְ יְחִידִי וְהַמְפַנֶּה לִבּוֹ לְבַטָּלָה, הֲרֵי זֶה מִתְחַיֵּב בְּנַפְשׁוֹ:

(4) Rabbi Chananya ben Chakhinai says: One who stays awake at night, and one who wanders on a road alone, and one who turns his heart to idleness, such a one is liable for [forfeiture of] his life.

מתני׳ קונם שאני ישן שאני מדבר שאני מהלך האומר לאשה קונם שאני משמשך הרי זה בלא יחל דברו:
MISHNA: With regard to one who says: Sleeping is forbidden for me as if it were an offering [konam], thereby prohibiting himself from sleeping; or: Speaking is konam for me; or: Walking is konam for me; or one who says to his wife: Engaging in sexual intercourse with you is konam for me, if he violates the vow he is in violation of the prohibition “He shall not profane his word” (Numbers 30:3).
ואי דלא יהיב שיעורא מי שבקינן ליה עד דעבר איסור בל יחל והאמר רבי יוחנן שבועה שלא אישן שלשה ימים מלקין אותו וישן לאלתר

The Gemara questions this interpretation: And if he did not give a measurement to the prohibition created by the vow, but rather prohibited himself from sleeping for an unlimited period of time, do we let him be until he inevitably transgresses the prohibition: He shall not profane, by falling asleep? But didn’t Rabbi Yoḥanan say that if one says: I hereby take an oath that I will not sleep for three days, the court flogs him for taking an oath in vain, and he may sleep immediately, as he is incapable of fulfilling his oath? Here too, if the prohibition has no time frame, the vow should not take effect.

Middle-of-the-night prayers
ד"א בלילה שכל הבוכה בלילה קולו נשמע ד"א בלילה שכל הבוכה בלילה כוכבים ומזלות בוכין עמו ד"א בלילה שכל הבוכה בלילה השומע קולו בוכה כנגדו מעשה באשה אחת שכנתו של רבן גמליאל שמת בנה והיתה בוכה עליו בלילה שמע רבן גמליאל קולה ובכה כנגדה עד שנשרו ריסי עיניו למחר הכירו בו תלמידיו והוציאוה משכונתו

Alternatively, the term “at night” indicates that with regard to anyone who cries at night, his voice is heard due to the ambient silence. Alternatively, the term “at night” indicates that in the case of anyone who cries at night, the stars and the constellations cry with him. Alternatively, the term “at night” indicates that in the case of anyone who cries at night, one who hears his voice is touched by his suffering and cries with him. There was an incident involving one woman, the neighbor of Rabban Gamliel, whose son died, and she would cry over his death at night. Rabban Gamliel heard her voice and cried with her until his eyelashes fell out. The next day his students noticed that he had been crying, and they removed the woman from his neighborhood so that Rabban Gamliel could sleep.

Vach Nacht

Vach Nacht = the night before a brit

https://www.thoughtco.com/what-is-a-brit-yitzchak-2076854

Another home ceremony, called in Yiddish vakhnakht ("watchnight, vigil"), was held on the night preceding circumcision. Candles were lit throughout the home, and following a festive meal, featuring cooked beans and peas, prayers were recited and the Torah was studied until after midnight. Before departing, the guests recited the Shema aloud at the bedside of the mother. This custom is mentioned as early as the Talmud by the name yeshu'a ha-ben or shevu'a haben (Sanh. 32b; BK 80a). It probably evolved from the fact that when the mohel checked the infant's health on the eve of the circumcision, he was accompanied by the sandak ("godfather") and other friends who came to congratulate the parents. This custom later became associated with the belief that it is necessary to guard the child against Lilith and other evil spirits by guarding him throughout the night while reciting prayers and studying Torah. This vigil, also very popular among Sephardi Jews, is called "midrash" because of a discourse on the weekly Torah section delivered by the hakham. The hazzan also chants appropriate poems and the Kaddish. Poppy-seed, honey cake, and coffee are served at this ceremony. In Salonika, the eve of the circumcision was known as "veula" ("watchnight," from vigilia – "eve," "watch"), and the mother stayed awake all night. In Yemen, on the eve of circumcision, care was taken not to leave the mother and child alone, and incense was burned inside the room to ward off the evil spirits.

https://www.jewishvirtuallibrary.org/circumcision-brit-milah