Skip to content

Make Collector labels-to-child map implementation pluggable #514

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

Closed
wants to merge 1 commit into from

Conversation

njhill
Copy link

@njhill njhill commented Nov 22, 2019

#460 proposed an optimized zero-GC version of the child lookup logic which was deemed too specialized for inclusion in the library.

Subjectively less complex alternatives were also proposed which provide some but not as much performance/garbage improvement, and rely for example on some per-thread overhead.

This PR aims to add a minimally-invasive mechanism to allow users to plug in an implementation of their choice, so that performance sensitive consumers can opt for minimal overhead without the core library having to include the corresponding code.

@njhill njhill mentioned this pull request Nov 22, 2019
prometheus#460 proposed an optimized zero-GC version of the child lookup logic
which was deemed too specialized for inclusion in the library.

Subjectively less complex alternatives were also proposed which provide
some but not as much performance/garbage improvement, and rely for
example on some per-thread overhead.

This PR aims to add a minimally-invasive mechanism to allow users to
plug in an implementation of their choice, so that performance sensitive
consumers can opt for minimal overhead without the core library having
to include the corresponding code.

Signed-off-by: nickhill <nickhill@us.ibm.com>
@brian-brazil
Copy link
Contributor

Thanks for your PR, I don't believe this sort of thing should be pluggable - that's asking for someone to make an incompatible implementation and causing problems down the line. We should have one implementation that works well such as proposed in #486, and if someone is in a particularly niche setup they can always create custom collectors.

@njhill
Copy link
Author

njhill commented Nov 22, 2019

@brian-brazil the only "niche" aspect of my usage is the desire for minimal runtime overhead. I am using a few of the different standard collectors and so using custom ones will mean duplicating all of them which I was hoping to avoid but I guess is the only option.

@njhill njhill closed this Nov 22, 2019
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