jochen-schweizer / express-prom-bundle

express middleware with standard prometheus metrics in one bundle
MIT License
310 stars 68 forks source link

Question/Feature Request: Filter out status codes #28

Closed RangarajKaushikSundar closed 5 years ago

RangarajKaushikSundar commented 5 years ago

Is there a way I can completely filter out certain status codes? The formatStatusCode function gives us the option to combine status codes, but not ignore them.

disjunction commented 5 years ago

There is no way, and I agree it would be nice to have it.

As a workaround you can transform the status_code to say "ignored". And then delete or change the other labels so that all those are collapsed into just one line in metrics. It shouldn't have any impact on the traffic or performance this way.

RangarajKaushikSundar commented 5 years ago

Good idea. You can close this issue OR keep it open as a feature request. 😄

RangarajKaushikSundar commented 5 years ago

BTW. Thanks for the quick response @disjunction 👍

SyedAsadAbrar commented 2 years ago

@disjunction Could you share an example for this?