labbsr0x / express-monitor

A Prometheus middleware to add basic but very useful metrics for your Express JS app.
MIT License
11 stars 8 forks source link

Update prom-client for node18 #44

Open contecloud opened 1 year ago

contecloud commented 1 year ago

When using Node.JS 18.16.0, prom-client returns the given error:

TypeError: Value is not a valid number: 191

brunoclaudinos commented 1 year ago

When using Node.JS 18.16.0, prom-client returns the given error:

TypeError: Value is not a valid number: 191

Any solution?

brunoclaudinos commented 1 year ago

Probably the reason you are getting this error is because the Express's response is now returning a string value in the _contentLength field.

You can try to fix this error by converting this value to a number before calling Monitor.init method