As a developer, it is important to know how to identify the metrics and practices that will allow us to reflect and build monitoring for our applications (web or desktop). We will mainly talk about APM here.
Some modern frameworks like fastify already have packages to export metrics (promeheus format).
The most important metrics in Node.js are often those concerning the event-loop. I recommend the following resources to you which will go through different means of exploiting them;
- NodeConf Remote 2020 - Trevor Norris - Introduction to Event Loop Utilization
- Introduction to Event Loop Usage in Node.js
Other resources related to Node.js monitoring:
- Don't Starve the Event Loop: Measuring and Monitoring Node.js for Performance
- Node.js Monitoring, Alerting and Reliability 101 Ebook
- Module core Node.js V8
- Investigating Node.js Performance: Event Loop and Network I/O (Part 1)
- Investigating Node.js Performance: Event Loop and Network I/O (Part 2)
- The Importance of Measuring Memory Allocation in Node.js Applications
- Monitoring Node.js Performance
Links and resources for HTTP API monitoring:
Links and resources for log monitoring :
- Logs monitoring with Loki, Node.js and Fastify.js
- Consuming Loki logs with Grafana API and Node.js
- Fastify.js - Unlock the Power of Runtime Log Level Control (by Manuel Spigolon)
- pino-loki - This package provides a transport for pino that forwards messages to Loki.
⬅️ 🌇 Architecture & Paradigms: Others | ➡️ 💻 System: Introduction