Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add a metric exposing number of objects per type #59757
1 similar comment
changed the title from
WIP: add a metric exposing number of objects per type
Add a metric exposing number of objects per type
Feb 15, 2018
I briefly looked at your PR and it looks great. However, it seems like you're getting the metric from storage (correct me if I'm wrong). You may instead want to fetch it from the watch cache directly (which should work for all except iirc CRDs, events?) - I think @smarterclayton was also suggesting earlier.
I'm not asking for it in this PR - but maybe add a TODO?
[APPROVALNOTIFIER] This PR is APPROVED
The full list of commands accepted by this bot can be found here.
The pull request process is described here
Feb 24, 2018
13 checks passed
Note that this will not work correctly if we start separating resources into multiple keys, nor if there are other keys interspersed into a range that can't be accessed by name. I would have really preferred something that just remembered the last full list or checked the watch cache periodically.
The solution with watch cache was also my first thought, but it requires having watch cache enabled. And we were already discussing in the past enabling it only for some resources (and e.g for events it's not even enabled now).
That said, your argument is also very good one. Especially, since I may try to attack the problem with "making heartbeats cheaper (on etcd side)" by separating "hearbeat" part of object into separate thing in etcd (leaving the api as is).
I don't have any better suggestion now though...