-
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 SSA cache metrics #11635
🌱 Add SSA cache metrics #11635
Conversation
Skipping CI for Draft Pull Request. |
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"
],
...
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.
IIRC provider is added by Prometheus when scraping the metrics. But I'm looking basically for a "controller" (i.e. reconciler) label, not one for the entire binary (I'll add an additional comment)
540ea95
to
87ba1bc
Compare
87ba1bc
to
33017f9
Compare
internal/controllers/topology/cluster/structuredmerge/dryrun.go
Outdated
Show resolved
Hide resolved
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.
IIRC provider is added by Prometheus when scraping the metrics. But I'm looking basically for a "controller" (i.e. reconciler) label, not one for the entire binary (I'll add an additional comment)
Might be worth removing draft and adding |
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.
Thx, looks pretty good.
I think you can remove WIP
Thank you! /lgtm Flake is independent (already opened an issue for that one) /test pull-cluster-api-e2e-main /assign @fabriziopandini @chrischdi |
LGTM label has been added. Git tree hash: e64d38d2446d7ea30efad7b4895e1067bf868163
|
/approve Thanks! |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chrischdi The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest (independent flake) |
@chrischdi: The
The following commands are available to trigger optional jobs:
Use
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/retest |
Nice work! |
/hold |
That one is independent of this PR. Occurs pretty frequently since we merged this test case via another PR: #11722 /retest |
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