Some tips and tools on adding Metrics, Logs, Traces, and Events to your JS/@Nodejs code.
TLDR: Add Observability. Don't log too much. Mostly `debug`.
swyx.io/writing/js-obs…
We break tools down to Metrics, Logs, Traces, and Events.
We need tools that report and help hold the line on bundle size - see Webpack's tooling and check out @_developit's `compressed-size-action` GitHub action!
Gradual slowdown can be hard to notice. Get familiar with console.time, the User Timing API, and build reporting tools with memory like @brian_d_vaughn's Progress Estimator ( )
Ask for @trevorbrindlejs' envinfo in every GitHub issue!
swyx.io/writing/js-obs…
Stream error and app logs. Structure them nicely. Use syslog log levels and `debug`.
`debug` stuff and clean up stack traces with @sindresorhus' clean-stack
Use `uuid` to generate uuid's and `concordance` to diff values for change events!