jochen-schweizer / express-prom-bundle

express middleware with standard prometheus metrics in one bundle
MIT License
303 stars 67 forks source link

Update prom-client to v15 #125

Closed steve1337 closed 8 months ago

steve1337 commented 9 months ago

prom-client version 15 has breaking changes.

Due to the package.json specifying the version as ^13.0.0 users will get a compile error when

  1. Using node18 (incl. npm 10)
  2. Deleting their package-lock.json
  3. Deleting node_modules and
  4. Running npm i afterwards
node_modules/express-prom-bundle/types/index.d.ts(51,44): 
error TS2314: 
Generic type 'DefaultMetricsCollectorConfiguration<T>' requires 1 type argument(s).
Screenshot 2024-01-04 at 13 24 29

This MR will upgrade to the latest version and add the required type parameter

steve1337 commented 9 months ago

Doing this upgrade should hopefully also allow merging this PR: https://github.com/jochen-schweizer/express-prom-bundle/pull/119#issuecomment-1470338738

disjunction commented 9 months ago

Hi @steve1337 . Thanks for the PR. I haven't been active lately, but will look into it tomorrow

steve1337 commented 9 months ago

@disjunction great, thx a lot. Esp. for picking this up so quickly. Big help for my team!

It might be worth noting that it's a valid alternative to add a default parameter to prom-bundle to restore backwards compatibility. But haven't looked into that yet.

If you have concerns regarding this change just LMK and I'll see what I can do on the other package

disjunction commented 8 months ago

Merged manually. Thanks for contributing. This was released in v7.0.0

steve1337 commented 8 months ago

@disjunction very cool! Thank you so much :)