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

fix: custommetrics: log no _info suffix in name only once per reading the configuration #2157

Merged
merged 1 commit into from
Aug 18, 2023

Conversation

chrischdi
Copy link
Member

What this PR does / why we need it*:

This PR moves the log statement Info metric does not have _info suffix from pkg/metric_generator/generator.go to pkg/customresourcestate/registry_factory.go.

By doing this it only gets logged once when the custom resource configuration gets initialised instead of on creation of every custom resource object.

Also properly uses InfoS to not output %s.

Before:

I0818 16:54:32.105070   71540 generator.go:79] "Info metric %s does not have _info suffix" capi_machine_owner="(MISSING)"
...
I0818 16:58:32.105070   71540 generator.go:79] "Info metric %s does not have _info suffix" capi_machine_owner="(MISSING)"

After:

I0818 17:54:21.954531    7984 registry_factory.go:76] "Info metric does not have _info suffix" gvk="cluster.x-k8s.io_v1beta1_Machine" name="info"

How does this change affect the cardinality of KSM: (increases, decreases or does not change cardinality)

None

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 #2155

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 18, 2023
@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 18, 2023
@chrischdi chrischdi changed the title feat(customresource) log no _info suffix in name only once per reading the configuration fix: log no _info suffix in name only once per reading the configuration Aug 18, 2023
@chrischdi chrischdi changed the title fix: log no _info suffix in name only once per reading the configuration fix: custommetrics: log no _info suffix in name only once per reading the configuration Aug 18, 2023
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 18, 2023
@mrueg
Copy link
Member

mrueg commented Aug 18, 2023

/triage accepted
/assign mrueg

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Aug 18, 2023
@mrueg
Copy link
Member

mrueg commented Aug 18, 2023

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 18, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chrischdi, mrueg

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 7ab0612 into kubernetes:main Aug 18, 2023
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom resources spam Info metric %s does not have _info suffix
3 participants