bbyars / mountebank

Over the wire test doubles
http://www.mbtest.org
MIT License
2k stars 262 forks source link

Mountebank doesn't show imposters metrics #718

Closed deividbatfish2 closed 1 year ago

deividbatfish2 commented 1 year ago

Expected behaviour

After use an imposter, when we call /metrics endpoint, the metrics mb_predicate_match_duration_seconds, mb_request_total and mb_response_generation_duration_seconds should be returned. ...

Actual behaviour

The mountebank returns in /metrics, only de mb metrics, like cpu and collector ...

Steps to reproduce

Start a new imposter, make some calls for him, and call the /metrics endpoint ...

Software versions used

OS: Linux
mountebank : 2.8.1
node.js    : 18.13.0
Installation method : npm

After the changes in require modules to improve the performance, the module imposter.js started to be loaded before the method prometheus.register.clear(); to be called. Because of that , the metrics of imposters are cleaned in the start of the mountebank.