Skip to content

fix(metrics): Initialise dynamic serving certificate signing counters - #9644

Merged
cert-manager-prow[bot] merged 1 commit into
cert-manager:masterfrom
efadeev:dynamic-serving-metrics-init
Nov 23, 2026
Merged

cert-manager-prow[bot] merged 1 commit into
cert-manager:masterfrom
efadeev:dynamic-serving-metrics-init

Conversation

@efadeev

@efadeev efadeev commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Pull Request Motivation

Follow-up to #9432, addressing #9432 (comment).

The status="failure" series of certmanager_dynamic_serving_certificate_signings_total was only created by the first failed signing, so rate() and increase() missed that first failure and a query on status="failure" returned no data on a healthy system.

DynamicAuthority.Run now creates both the success and the failure series, so they are exported as 0 from start-up, as recommended by Prometheus.

Testing: go test -race ./pkg/server/tls/..., including the new TestDynamicAuthorityMetricsInit.

Kind

/kind bug

Release Note

NONE

@cert-manager-prow cert-manager-prow Bot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 23, 2026
@cert-manager-prow

Copy link
Copy Markdown
Contributor

Hi @efadeev. Thanks for your PR.

I'm waiting for a cert-manager member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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.

@cert-manager-prow cert-manager-prow Bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Nov 23, 2026
@wallrj

wallrj commented Nov 23, 2026

Copy link
Copy Markdown
Member

Thank you for the quick follow-up. This does what I asked in #9432 (comment).

  • initMetrics uses the same four label values as observeSign, so the series it creates are the ones that are later incremented.
  • Run calls it after the SecretNamespace and SecretName checks, so no series is created for an invalid authority.
  • The test removes series left by an earlier run, so it also passes with -count.

I have not run the tests myself. CI will run them now.

/ok-to-test
/lgtm
/approve

[Claude Fable 5.2]

@cert-manager-prow cert-manager-prow Bot added ok-to-test and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 23, 2026
@cert-manager-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: wallrj

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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

@cert-manager-prow cert-manager-prow Bot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 23, 2026
@cert-manager-prow
cert-manager-prow Bot merged commit 1922961 into cert-manager:master Nov 23, 2026
6 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. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. ok-to-test release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants