Comments (2)
We've written a very minimal custom RUM client that fits in about ~4kb gzipped. We only really need this RUM instance for error tracking on sessions, it doesn't need x-ray or web vitals. This library is running on pages that may have their own RUM solution already (either AWS RUM or another vendor), so we want to avoid loading multiple RUMs on the page.
We plan on improving on this total size by shifting some functionality into a lambda that forwards requests to the monitor instead. I think we can shift sigV4 signing, authentication, and UA parsing over to the lambda. The client-side JS would then only be responsible for emitting simple event payloads to an unauthenticated endpoint.
In general, for libraries with lots of optional functionality, I really dig it when it's possible to build your own. This gives bundlers the best possible chance of shaking out everything you're not using, and the option to skip polyfills if you don't need them:
import { baseClient } from "rum/base"
import { xray } from "rum/xray"
import { vitals } from "rum/vitals"
const client = baseClient.configure({
plugins: [
xray({ /* xray options */ }),
vitals({ /* vitals options */}),
],
// inject native implementations for things that are typically polyfilled
browserApis: {
uuid: crypto.randomUUID,
sha256: (message) => crypto.subtle.digest('SHA-256', new TextEncoder().encode(message)),
}
})
/* leanest, meanest client that fits my exact needs 🤙 */
from aws-rum-web.
Hi Josh, agree this is would be a good enhancement. Out of curiosity, what is your budget for RUM in your library (compressed/uncompressed)?
from aws-rum-web.
Related Issues (20)
- [Bug]: Error: Cannot find module '@aws-sdk/fetch-http-handler' HOT 1
- sessionSampleRate and error reporting HOT 8
- [Bug]: HOT 4
- [General Inquiry]: XMLHttpRequest error HOT 3
- [General Inquiry]: Should errors be limited by 'sessionEventLimit'? HOT 5
- [Bug]: docs example incorrect name for angular errohandler import HOT 1
- [General Inquiry]: is unauthenticated user pool secure ? HOT 1
- [Bug]: Cannot override title attribute in metadata HOT 3
- [Bug]: CWR: Failed to retrieve credentials from STS: TypeError: Cannot read properties of undefined (reading 'split') HOT 1
- [Feature Request]: create a separate AwsRum orchestrator to use with proxy HOT 1
- [Bug]: RUM stopped sending metrics after some user idle time HOT 2
- fix: optionally write HttpEvent.statusText
- [Feature Request]: optionally persist custom attributes
- [Feature Request]: collect metadata for connection type
- [Feature Request]: offline support HOT 5
- [General Inquiry]: Cloudwatch CDN NextJS HOT 1
- [General Inquiry]: missing stacktrace when recording js errors with RUM HOT 2
- [Feature Request]: Support for native mobile apps HOT 2
- [Feature Request]: error-free session_count V.S. No. of sessions experienced error
- [Feature Request]: Easier error ignore function HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-rum-web.