Not collect custom metrics
After upgrade version to 2.7.0 stopped work custom metrics.
Endpoint /metrics don't cause any error, have only defaults metrics ( http_requests_total, http_request_duration_seconds, http_requests_in_progress_total, http_cache_results)
Using fiber at v2.52.5
PS.: After downgrade to 2.6, works correctly
I'm having same issue.
The problem are : https://github.com/ansrivas/fiberprometheus/blob/7755f92e96f9515a7511f63ed16668043fd18b4b/middleware.go#L156 https://github.com/ansrivas/fiberprometheus/blob/7755f92e96f9515a7511f63ed16668043fd18b4b/middleware.go#L167 https://github.com/ansrivas/fiberprometheus/blob/7755f92e96f9515a7511f63ed16668043fd18b4b/middleware.go#L179
in these 3 cases, before was
func New(serviceName string) *FiberPrometheus {
return create(prometheus.DefaultRegisterer, serviceName, "http", "", nil)
}
and now is
func New(serviceName string) *FiberPrometheus {
return create(nil, serviceName, "http", "", nil)
}
since this change, are not publishing custom metrics properly
Run into the same problem. I suppose we should switch to fiberprometheus.NewWithRegistry(prometheus.DefaultRegisterer, ... instead?
@alanhe Yes, the reason for the change was that the DefaultRegisterer is shared across modules, so multiple things were updating the same thing. This was exposed when the unit-tests were changed to run in Parallel.
I can add a function called NewWithDefault or something, that uses default registerer.