Skip to content

Conversation

fabianfett
Copy link
Member

Renamed the PrometheusCollectorRegistry destroy methods to unregister. this is more in line with the Prometheus documentation:

CollectorRegistry SHOULD offer register()/unregister() functions, and a Collector SHOULD be allowed to be registered to multiple CollectorRegistrys.

Further this is more in line with what this function actually does. The metrics aren't move only types, that we can actually destroy in the method.

Also added docc comments.

Copy link
Contributor

@FranzBusch FranzBusch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you also planning to rename the make methods?

@fabianfett
Copy link
Member Author

fabianfett commented Sep 25, 2023

Are you also planning to rename the make methods?

@FranzBusch No, I don't plan this. Reason: We might want to add explicit calls to register and allow create metric creation without a registry attached from the get go. However we could change the internal make implementation to do exactly that.

My goal with this is to get the API in such a shape, that we can be fully compatible with the prometheus requirements without breaking API.

Copy link
Collaborator

@ktoso ktoso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okey so both names exist then, that's ok

@ktoso ktoso merged commit 34598bf into swift-server:main Sep 26, 2023
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.

3 participants