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

Consider optional disabling of metric sorting #483

Open
beorn7 opened this issue Oct 23, 2018 · 3 comments
Open

Consider optional disabling of metric sorting #483

beorn7 opened this issue Oct 23, 2018 · 3 comments
Labels
Milestone

Comments

@beorn7
Copy link
Member

beorn7 commented Oct 23, 2018

With extremely large exposition (example: kube-state-metrics on a large cluster will expose hundreds of MiB of metrics data), sorting of metrics becomes a quite significant computational burden. As metrics sorting is not required for valid expositions, a registry could provide an option to not sort after gathering metrics.

@glefloch
Copy link
Contributor

glefloch commented Oct 31, 2018

@beorn7, after looking at the code, you would like to add a option to the Registry to avoid this call :

return internal.NormalizeMetricFamilies(metricFamiliesByName), errs.MaybeUnwrap()
?

If this is the case, can I work one this or can you give me some hint?

@beorn7
Copy link
Member Author

beorn7 commented Oct 31, 2018

Yeah, the implementation of this will be straight forward, obviously.

The devil is in the detail of how to design the interface. I'm currently considering a separate registry package, inspired by the discussion of how to name WrapRegistererWith properly. We might have a New(Opts) constructor there, which would read in real code like the following:

r := registry.New(registry.Opts{DisableSorting: true, PedanticChecks: true})

That would avoid a combinatorial explosion of constructors (we already have NewPedanticRegistry).

I would like to postpone work on this particular issue until the grand design of this is done (and then it will be trivial to do). I'm currently working on something like a design doc for v0.10 to put it up for discussion.

@beorn7 beorn7 removed their assignment Jun 2, 2021
@beorn7
Copy link
Member Author

beorn7 commented Jun 2, 2021

I mostly assigned this to myself as a “default” because I used to be the maintainer of this repo. Therefore, I'm un-assigning this from myself no. New maintainers @bwplotka & @kakkoyun, please deal with this as you see fit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants