-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
🌱 Add ssh cache metrics #11635
base: main
Are you sure you want to change the base?
🌱 Add ssh cache metrics #11635
Conversation
Skipping CI for Draft Pull Request. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@@ -99,16 +125,16 @@ func (r *ssaCache) Has(key string) bool { | |||
// once we found out that it would not produce a diff. | |||
// The identifier consists of: gvk, namespace, name and resourceVersion of the original object and a hash of the modified | |||
// object. This ensures that we re-run the request as soon as either original or modified changes. | |||
func ComputeRequestIdentifier(scheme *runtime.Scheme, original, modified client.Object) (string, error) { | |||
func ComputeRequestIdentifier(scheme *runtime.Scheme, original, modified client.Object) (id, kind string, err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if this is the best way to reuse the fact that we're pulling out GVK when computing the request ID
internal/util/ssa/cache.go
Outdated
type newCacheOption func(*newCacheConfig) | ||
|
||
// WithOwner allows definition of the owner field to be used in NewCache. | ||
func WithOwner(owner string) newCacheOption { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it actually looks like we get a provider
label when pulling this metric, which may make this cache_owner
label extension redundant?
added an example call here in local testing:
r.ssaCache = ssa.NewCache(ssa.WithOwner("kubeadmcontrolplane"))
and was getting metrics like this:
{
"metric": {
"__name__": "capi_ssa_cache_request_total",
"cache_owner": "kubeadmcontrolplane",
"instance": "10.244.0.17:8443",
"job": "capi-providers",
"kind": "ssa_cache",
"namespace": "capi-kubeadm-control-plane-system",
"pod": "capi-kubeadm-control-plane-controller-manager-85d788c785-gw247",
"provider": "control-plane-kubeadm",
"status": "miss"
},
"values": [
[
1735767358.995,
"358"
],
...
540ea95
to
87ba1bc
Compare
87ba1bc
to
33017f9
Compare
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #10527
/area util