Closed ankon closed 3 years ago
Currently doing this
const metricsRequestMiddleware: any = prometheus({
autoregister: false,
includeMethod: true,
includePath: true,
...
promClient: {
collectDefaultMetrics: {},
}
});
this.http.use(metricsRequestMiddleware);
this.monitor.use(metricsRequestMiddleware.metricsMiddleware);
This PR, even if simple, adds lot of value here 👍
I have exactly the same use case: Multiple listeners, all should be collecting metrics, but only one should expose the /metrics
endpoint.
@disjunction sorry to ping you directly. Are you folks considering this pr? It really add value to certain use cases
I'll see to it tomorrow
Hey guys. I'm sorting out the permissions for this repo. There was some misunderstanding. But will merge and publish to npm as soon as it's resolved.
Great, thanks!
it's available on npm with a new version 6.2.0
Thanks a lot!
Related-to: #49
Note that this only adds the
metricsMiddleware
, not thepromClient
: I didn't feel comfortable to declare that as simplyany
.