siimon / prom-client

Prometheus client for node.js
Apache License 2.0
3.15k stars 378 forks source link

types: handler might be string or array of strings #582

Open morriq opened 1 year ago

morriq commented 1 year ago

Hello

handler as string[] is correctly displayed in metrics:

http_request_duration_milliseconds_count{handler="/tiles/:segments(*),/tiles",code="200",method="HEAD"} 3

but TS can't agree to use it:

Screenshot 2023-08-10 at 10 45 17

Screenshot 2023-08-10 at 10 45 47

SimenB commented 1 year ago

Happy to take a PR 🙂

zbjornson commented 12 months ago

I'm not sure if that is works by intent or chance, actually. If you want to make it PR, it would need to add tests in addition to the typescript declaration changes.