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

NewDefaultRegistry function #1730

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dnovikoff
Copy link

I suggest to add a function for creating a defaulty configured Registry.

@kakkoyun
Copy link
Member

Thanks a lot for opening the PR.

Could you please add some context what is the reason behind the change? What would be the potential implications of it? Any benefits?

I understand using init is not a best practice but we also wouldn't want to change things for sake of changing it. client_golang is a dependency for a lot of packages and programs out there.

@dnovikoff
Copy link
Author

dnovikoff commented Feb 13, 2025

Could you please add some context what is the reason behind the change? What would be the potential implications of it? Any benefits?

I don't like the idea of using global Registry in my projects. I prefer to explicitly define the object. Still I want to have the ability to create it exactly the same way as the default is created.

I understand using init is not a best practice but we also wouldn't want to change things for sake of changing it. client_golang is a dependency for a lot of packages and programs out there.

I think, that the behaviour seems not to change here for the existing code. Only new function is added. The initialization seems to be better controlled from the constuctor, than from the init function

Maybee we should go further and create something like RegisterDefaultCollectors

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 this pull request may close these issues.

2 participants