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
64
SvelteJapanOnlineMeetup#2_SvelteKitアプリケーションのモニタリングを考える
naoketa
March 22, 2024
Tweet
Share
Other Decks in Programming
See All in Programming
見せてあげますよ、「本物のLaravel批判」ってやつを。
77web
7
7.8k
Realtime API 入門
riofujimon
0
150
Outline View in SwiftUI
1024jp
1
340
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
530
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
9
3.3k
Micro Frontends Unmasked Opportunities, Challenges, Alternatives
manfredsteyer
PRO
0
110
どうして僕の作ったクラスが手続き型と言われなきゃいけないんですか
akikogoto
1
120
flutterkaigi_2024.pdf
kyoheig3
0
160
Missing parts when designing and implementing Android UI
ericksli
0
160
デザインパターンで理解するLLMエージェントの作り方 / How to develop an LLM agent using agentic design patterns
rkaga
8
620
Make Impossible States Impossibleを 意識してReactのPropsを設計しよう
ikumatadokoro
0
280
Duckdb-Wasmでローカルダッシュボードを作ってみた
nkforwork
0
130
Featured
See All Featured
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
Music & Morning Musume
bryan
46
6.2k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Designing for humans not robots
tammielis
250
25k
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
Documentation Writing (for coders)
carmenintech
65
4.4k
GraphQLとの向き合い方2022年版
quramy
43
13k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Raft: Consensus for Rubyists
vanstee
136
6.6k
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ӡ༻࣌ͷϞχλϦϯάʹ͍ͭͯɺͲΜͳతͰԿΛݟ͍ͯΔ͔ɺۤ࿑ͳͲͳͲ ͝ҙݟ͍͖͍ͨͩͨͰ͢ʂ