Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not collect custom metrics #215

Open
bigotto opened this issue Sep 8, 2024 · 4 comments · May be fixed by #221
Open

Not collect custom metrics #215

bigotto opened this issue Sep 8, 2024 · 4 comments · May be fixed by #221

Comments

@bigotto
Copy link

bigotto commented Sep 8, 2024

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

@bigotto bigotto changed the title Not collection custom metrics Not collect custom metrics Sep 9, 2024
@pineda89
Copy link

pineda89 commented Sep 17, 2024

I'm having same issue.

The problem are :

return create(nil, serviceName, "http", "", nil)

return create(nil, serviceName, namespace, subsystem, nil)

return create(nil, "", namespace, subsystem, labels)

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

@alanhe
Copy link

alanhe commented Sep 27, 2024

Run into the same problem. I suppose we should switch to fiberprometheus.NewWithRegistry(prometheus.DefaultRegisterer, ... instead?

@gaby
Copy link
Contributor

gaby commented Oct 6, 2024

@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.

@gaby
Copy link
Contributor

gaby commented Oct 6, 2024

I can add a function called NewWithDefault or something, that uses default registerer.

@gaby gaby linked a pull request Nov 4, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants