I took the prometheus monitoring setup script from an earlier article and turned it into a single express middleware. You can now get:
- Api pass/fail rate (with status_code label)
- Api count over time (with http_request_duration_seconds_count )
- Api response duration for 95% of the user (with histogram and http_request_duration_seconds_bucket )
with a single line import!
Also, request routes will be mapped into the original pattern (works with nested routes) without changing the param names.
https://medium.com/teamzerolabs/zero-configuration-express-api-metrics-monitoring-480aeae9fb47?source=friends_link&sk=498d715c47edf70a8c8d2209adc9d2df
Above is a friend link and won't trigger paywall!
Enjoy guys