Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
SvelteJapanOnlineMeetup#2_SvelteKitアプリケーションのモニタ...
Search
naoketa
March 22, 2024
Programming
1
70
SvelteJapanOnlineMeetup#2_SvelteKitアプリケーションのモニタリングを考える
naoketa
March 22, 2024
Tweet
Share
Other Decks in Programming
See All in Programming
Stackless и stackful? Корутины и асинхронность в Go
lamodatech
0
950
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
340
Monixと常駐プログラムの勘どころ / Scalaわいわい勉強会 #4
stoneream
0
290
Fibonacci Function Gallery - Part 1
philipschwarz
PRO
0
230
今年のアップデートで振り返るCDKセキュリティのシフトレフト/2024-cdk-security-shift-left
tomoki10
0
230
コンテナをたくさん詰め込んだシステムとランタイムの変化
makihiro
1
140
htmxって知っていますか?次世代のHTML
hiro_ghap1
0
350
nekko cloudにおけるProxmox VE利用事例
irumaru
3
460
PHPで作るWebSocketサーバー ~リアクティブなアプリケーションを知るために~ / WebSocket Server in PHP - To know reactive applications
seike460
PRO
2
650
短期間での新規プロダクト開発における「コスパの良い」Goのテスト戦略」 / kamakura.go
n3xem
2
180
バグを見つけた?それAppleに直してもらおう!
uetyo
0
180
アクターシステムに頼らずEvent Sourcingする方法について
j5ik2o
4
350
Featured
See All Featured
How To Stay Up To Date on Web Technology
chriscoyier
789
250k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
3
170
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.1k
Building Adaptive Systems
keathley
38
2.3k
Building a Scalable Design System with Sketch
lauravandoore
460
33k
Mobile First: as difficult as doing things right
swwweet
222
9k
The Cult of Friendly URLs
andyhume
78
6.1k
Practical Orchestrator
shlominoach
186
10k
Navigating Team Friction
lara
183
15k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
Transcript
SvelteKitΞϓϦέʔγϣϯͷ ϞχλϦϯάΛߟ͑Δ -AWS Amplify্ͷSSRͳSvelteKitͷߏྫ- Svelte Japan Online Meetup#2 @naoketa
ࣗݾհ X/Twitter: @naoketa Github: @naoketa Blog: https://naoketa.net
ϑϩϯτΤϯυͷϞχλϦϯάࢹͬͯͲ͏͞Εͯ·͔͢ʁ
• Γํϝϯόʔମ੍ɺѻ͏ϏδωεɺΞϓϦέʔγϣϯʹΑ༷ͬͯʑɻ • ϝϯόʔମ੍ • (ྫ)όοΫΤϯυ/ϑϩϯτΤϯυͷϝϯόʔ͕ͦΕͧΕݟ͍ͯΔɻΫϩεϑΝϯΫγϣφϧͳνʔϜͰݟ ͍ͯΔɻSREνʔϜ͕ݟ͍ͯΔɻetc • ѻ͏Ϗδωε/ΞϓϦέʔγϣϯ •
(ྫ)αʔϏε͕ࢭ·Δ͜ͱͰϏδωεӨڹ͕େ͖͍ɻฏதଳ͔͠Θͳ͍ɻetc • ͲΜͳతͰԿΛϞχλϦϯά͢Δ͖͔ɻ ϑϩϯτΤϯυͷϞχλϦϯάࢹͬͯͲ͏͞Εͯ·͔͢ʁ
ϑϩϯτΤϯυͷϞχλϦϯάͷత • త • Ϣʔβ͔Βݟͯʮಈ͖ଓ͚Δ͜ͱ で ͳ͘ɺૉૣ͘ϩʔ ド ͞ΕΔ͜ͱʯ͕࠷ऴΰʔϧ •
ղܾ͍ͨ͠՝ • ϑϩϯτΤϯυͰಈ࡞ڥ͕όϥόϥ(ɺϒϥβɺωοτϫʔΫetc)ɻ • શύλʔϯֻ͚߹Θͤͯςετ͢ΔͷෆՄೳɻ࣮ࡍͷϢʔβͷڥͰΰʔϧΛຬͨͤΔͷ ͔νΣοΫ͕͍͠ɻ • όάใࠂ͕͋ͬͯͳ͔ͥ࠶ݱ͠ͳ͍ɻ͓·ɻ • ϑϩϯτΤϯυ͔ΒόοΫΤϯυ·ͰΤϯυπʔΤϯυͰࢹ͍͕ͨ͠ɺϑϩϯτΤϯυ ޙखʹपΓ͕ͪɻ (ࢀߟ)O’Reilly Japan, Incʮೖ ࢹ ―ϞμϯͳϞχλϦϯάͷͨΊͷσβΠϯύλʔϯʯ
ϑϩϯτΤϯυͷϞχλϦϯάͷೋͭͷΞϓϩʔν • ϦΞϧϢʔβࢹ (࣮ࡍͷϢʔβར༻ͷࢹ) • ύϑΥʔϚϯεࢹɿ࣮ࡍͷϢʔβ͔Βͷݟ͑ํͷύϑΥʔϚϯεΛࢹ • Τϥʔࢹɿ࣮ࡍͷϢʔβͷϒϥβ্Ͱൃੜͨ͠ΤϥʔΛࢹ • γϯηςΟοΫࢹ
(ਓҝతͳϦΫΤετΛͬͨࢹ) • URLࢮ׆ࢹɿಛఆͷΤϯυϙΠϯτ͕׆͖͍ͯΔ͜ͱͷࢹ • γφϦΦࢹɿWebαΠτͷॏཁͳಋઢ͕ػೳ͍ͯ͠Δ͜ͱͷࢹ (ࢀߟ)O’Reilly Japan, Incʮೖ ࢹ ―ϞμϯͳϞχλϦϯάͷͨΊͷσβΠϯύλʔϯʯ
Ͳ͏ͬͯϞχλϦϯά͢Δ͔ʁ • πʔϧυϦϒϯͰߟ͑ͳ͍ • πʔϧͰऔΕΔ͔ΒͱແବͳϝτϦΫεΛऔͬͯϊΠζɻ • ʮࠓͬͯΔπʔϧͩͱऔΕͳ͍͔Βɻɻʯຊసɻ • ඞཁͳͷΛΈ߹ΘͤՄೳʹ͢Δ •
ΞϓϦέʔγϣϯཉ͍͠ใࢹπʔϧਐԽ͍ͯ͘͠ɻ • πʔϧΛӡ༻͢ΔதͰΈ͑ͯظతʹվળ͍ͯ͘͠ɻ (ࢀߟ)O’Reilly Japan, Incʮೖ ࢹ ―ϞμϯͳϞχλϦϯάͷͨΊͷσβΠϯύλʔϯʯ
͓ɿAmplifyͰϗετ͢ΔSvelteKitΞϓϦέʔγϣϯͷϞχλϦϯά • SSRΛؚΉSvelteKitͳΞϓϦέʔγϣϯΛྫʹɺAmplifyͰϗεςΟϯάͯ͠ϞχλϦϯά Lambda@Edge S3 CloudFront Amplify Github Developer User
git push amplify cli AWSཧ(Πϝʔδ) "84෦ͰσϓϩΠཧ͞ΕΔϦιʔε ˞࣮ࡍͷϦιʔεར༻ऀ͔Βݟ͑ͳ͍ͨΊɺ ࣮ࡍʹ-BNCEB!&EHFͰͳ͍Մೳੑ͋Γ AmplifyͷߏΠϝʔδ SSR ੩తϑΝΠϧऔಘ
(ࢀߟ) AWS Amplify HostingͰNext.jsҎ֎SSRͰ͖ΔΑ͏ʹͳͬͨ • ैདྷͷNext.jsʹՃ͑ͯɺࡢ͔ΒSvelteKitͳͲҙͷSSRϑϨʔϜϫʔΫ͕ϗεςΟϯάՄೳʹɻ (ࢀߟ) https://aws.amazon.com/jp/blogs/news/introducing-support-for-hosting-any-ssr-app-on-aws-amplify-hosting/
AmplifyͰϗετ͢ΔSvelteKitΞϓϦέʔγϣϯͷϞχλϦϯά • SSRΛؚΉSvelteKitͳΞϓϦέʔγϣϯΛྫʹɺAmplifyͰϗεςΟϯάͯ͠ϞχλϦϯά Amplify User CloudWatch Alarm CloudWatch Logs CloudWatch
Metrics CloudWatch RUM Synthetic Canary Slack AWS ChatBot SSRAPIͷϩΪϯά/ϝτϦΫε ϦΞϧϢʔβࢹ γϯηςΟοΫࢹ ϞχλϦϯάͷߏΠϝʔδ
AmplifyͰϗετ͢ΔSvelteKitΞϓϦέʔγϣϯͷϞχλϦϯά • SSRΛؚΉSvelteKitͳΞϓϦέʔγϣϯΛྫʹɺAmplifyͰϗεςΟϯάͯ͠ϞχλϦϯά Amplify User CloudWatch Alarm CloudWatch Logs CloudWatch
Metrics CloudWatch RUM Synthetic Canary Slack AWS ChatBot SSRAPIͷϩΪϯά/ϝτϦΫε ϦΞϧϢʔβࢹ γϯηςΟοΫࢹ ϞχλϦϯάͷߏΠϝʔδ
CloudWatch RUMΛͬͨϦΞϧϢʔβࢹ • ύϑΥʔϚϯεࢹɿ࣮ࡍͷϢʔβใΛͱʹϩʔυ࣌ؒCore Web VitalsΛ͡ΊΤϯυϢʔβͷϒϥβ্ͷύϑΥʔ ϚϯεใΛऔಘɻ • ΤϥʔࢹɿJSΤϥʔऔಘͰ͖Δ͕minify͞ΕͨελοΫτϨʔεΛιʔεϚοϓͰม͍͠ɻྫ֎࣌ʹࣗલͰΧ ελϜΠϕϯτ࣮ݕ౼ɻ
CloudWatch RUMΛͬͨϦΞϧϢʔβࢹ • CloudWatch RUMͰग़ྗ͞ΕΔεχϖοτϕʔεͰίϯϙʔωϯτͱͯ͠औΓࠐΈɻ
(࠶ܝ)AmplifyͰϗετ͢ΔSvelteKitΞϓϦέʔγϣϯͷϞχλϦϯά • SSRΛؚΉSvelteKitͳΞϓϦέʔγϣϯΛྫʹɺAmplifyͰϗεςΟϯάͯ͠ϞχλϦϯά Amplify User CloudWatch Alarm CloudWatch Logs CloudWatch
Metrics CloudWatch RUM Synthetic Canary Slack AWS ChatBot SSRAPIͷϩΪϯά/ϝτϦΫε ϦΞϧϢʔβࢹ γϯηςΟοΫࢹ ϞχλϦϯάͷߏΠϝʔδ
Synthetics CanaryΛͬͨγϯηςΟοΫࢹ • URLࢮ׆ࢹɿPuppeteerϕʔεͷNode.jsͳLambdaΛఆظతʹ࣮ߦͯ͠ରΤϯυϙΠϯτΛࢹ • γφϦΦࢹɿPuppeteerͷίʔυ͔Βը໘ભҠΛͤͯ͞ࢹ
(࠶ܝ)AmplifyͰϗετ͢ΔSvelteKitΞϓϦέʔγϣϯͷϞχλϦϯά • SSRΛؚΉSvelteKitͳΞϓϦέʔγϣϯΛྫʹɺAmplifyͰϗεςΟϯάͯ͠ϞχλϦϯά Amplify User CloudWatch Alarm CloudWatch Logs CloudWatch
Metrics CloudWatch RUM Synthetic Canary Slack AWS ChatBot SSRAPIͷϩΪϯά/ϝτϦΫε ϦΞϧϢʔβࢹ γϯηςΟοΫࢹ ϞχλϦϯάͷߏΠϝʔδ
SSRAPI෦ͷϩΪϯά/ϝτϦΫε • ෦తʹLambda@Edge͕ग़ྗ͢ΔSSRAPIͷඪ४ग़ྗͷϩάΛऩू • ͦͷଞ4xx/5xxεςʔλείʔυͳͲͷϝτϦΫεಉ༷ʹऩू
͍͞͝ʹ • ಛʹRUMͳͲ৭ʑͳϝτϦΫε͕औΓ͘͢ͳͬͨҰํͰɺϞχλϦϯάͯ͠ରॲͰ͖Δϝϯ όʔͷϦιʔεมΘΒͳ͍ɻΞϥʔτඞཁ࠷ݶʹߜͬͯతΛݟ͢͜ͱ͕ඞཁɻ • ଈ࣌ɾظతʹඞཁͳใ͔ɺظతʹඞཁͳใ͔ɻ • Amplify HostingͷSvelteKitͷSSR͏গ͠ӡ༻ͯ͠Έͯੑೳ໘Λࢼ͍ͨ͠ɻ —-
• օ༷ͷSvelteKitӡ༻࣌ͷϞχλϦϯάʹ͍ͭͯɺͲΜͳతͰԿΛݟ͍ͯΔ͔ɺۤ࿑ͳͲͳͲ ͝ҙݟ͍͖͍ͨͩͨͰ͢ʂ