Serverless website analytics with Lambda@Edge

JimmyDahlqvist 20 views 28 slides Aug 24, 2024
Slide 1
Slide 1 of 28
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28

About This Presentation

Presentation from JAWS PANKRATION 2024.


Slide Content

JIMMY DAHLQVIST | 2024-08-24 Serverless website analytics with Lambda@Edge

Serverless website analytics with Lambda@Edge Jimmy Dahlqvist AWS Ambassador Community Builder AWS-UG Scania, Sweden. 2024-08-24

JIMMY DAHLQVIST Head of AWS @ Sigma Technology Cloud Founder of serverless- handbook.com AWS Ambassador | AWS Community Builder | User Group Leader § Hello, I'm

Todays agenda Episode I: The Problem Awakens Episode II: Birth of a Solution Episode III: Revenge of the Gotchas Episode IV: A New Refined Solution Episode V: Summary

Episode I: The Problem Awakens

Website statistics Google Analytics Been my tracker for years Universal Analytics deprecated Way to advanced Open Source alternatives Plausible and Matomo Fathom Analytics Not free

I just want Easy way to understand my readers! How hard can it be? Could I track in the backend?

Episode II: Birth of a Solution

Thoughts No client side tracking Page (post), Time, and Country Can I integrate into my CloudFront distribution?

Decoupled and event-driven Event-driven solution Decouple Ingestion Storage Analytics

CloudFront Integration points

Lambda@Edge vs CloudFront Functions Lambda@Edge All integration points Network access Up to 5 or 30 second duration CloudFront Functions Viewer Request / Response No network access Sub millisecon duration

Ingestion

Data-store

Analytics

Episode III: Revenge of the Gotchas

Three problems Solution failed to deploy, cryptic error message There was missing data Page felt sluggish

Gotcha Lambda@Edge and Functions won’t combine Lambda@Edge -> EventBridge high latency Glue and new lines CloudFront headers in cache policy

Episode IV: A New Refined Solution

Needed to solve High Latency Time & Date Viewer type

A new hope

Cost Managed Grafana - $9 S3 - $5 Glue - $2 Total - $16

Episode V: Summary

I know what blog post is accessed at what time I can visualize where in the world my users are locates I can create dashboards that show the information I need

Last 30 days

Serverless Handbook https://serverless- handbook.com /serverless-web-statistics

@ jimmydahlqvist dahlqvistjimmy https://serverless- handbook.com https:// jimmydqv.com THANK YOU