2
0 Comments

Need to monitor express api endpoint? You can now do it with a single middleware (only requires a single line change)!

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

Trending on Indie Hackers
How I grew a side project to 100k Unique Visitors in 7 days with 0 audience 49 comments Competing with Product Hunt: a month later 33 comments Why do you hate marketing? 29 comments My Top 20 Free Tools That I Use Everyday as an Indie Hacker 16 comments $15k revenues in <4 months as a solopreneur 14 comments Use Your Product 13 comments