Skip to content

Add Venafi OAuth token metrics and AuthFailed condition docs - #2117

Merged
cert-manager-prow[bot] merged 3 commits into
cert-manager:masterfrom
FelixPhipps:docs/ngts-issuer
Jun 2, 2026
Merged

cert-manager-prow[bot] merged 3 commits into
cert-manager:masterfrom
FelixPhipps:docs/ngts-issuer

Conversation

@FelixPhipps

@FelixPhipps FelixPhipps commented May 29, 2026 •

Copy link
Copy Markdown
Member

Documents the two new Prometheus metrics added in cert-manager/cert-manager#8808 (certmanager_venafi_oauth_token_requests_total and certmanager_venafi_oauth_token_request_duration_seconds) in the Prometheus metrics page, and adds an "Issuer conditions" section to the Venafi configuration docs explaining the new AuthFailed condition reason and how it differs from ErrorSetup.

@cert-manager-prow cert-manager-prow Bot added dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 29, 2026
@netlify

netlify Bot commented May 29, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cert-manager ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit a04af03
🔍 Latest deploy log https://app.netlify.com/projects/cert-manager/deploys/6a1da0cc64bb6b0008939c96
😎 Deploy Preview https://deploy-preview-2117--cert-manager.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@cert-manager-prow cert-manager-prow Bot added dco-signoff: no Indicates that at least one commit in this pull request is missing the DCO sign-off message. and removed dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. labels Jun 1, 2026
@cert-manager-prow cert-manager-prow Bot added dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. and removed dco-signoff: no Indicates that at least one commit in this pull request is missing the DCO sign-off message. labels Jun 1, 2026
Comment thread content/docs/configuration/venafi.md Outdated
Comment on lines +284 to +301
## Issuer conditions

### AuthFailed

When a Venafi endpoint rejects the supplied credentials (for example, with an HTTP 401 or 403 response), the `Issuer` or `ClusterIssuer` Ready condition transitions to `False` with `reason: AuthFailed`:

```bash
$ kubectl describe issuer corp-issuer --namespace='NAMESPACE OF YOUR ISSUER RESOURCE'
...
Status:
Conditions:
Message: OAuth token request failed: ...
Reason: AuthFailed
Status: False
Type: Ready
```

`AuthFailed` indicates that the credentials themselves are invalid. This is distinct from the generic `ErrorSetup` reason, which covers transient network or infrastructure problems. If you see `AuthFailed`, check the credentials in the referenced `Secret` — the API key for CyberArk Certificate Manager SaaS, the access token or username/password for CyberArk Certificate Manager Self-Hosted, or the `client-id` and `client-secret` for Next-Gen Trust Security (NGTS) — and ensure they are correct and have not expired.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AuthFailed is self-explanatory, is it really worth documenting it? I'd suggest leaving the entire "Issuer Conditions" section out.


| Metric | Type | Labels | Description |
|--------|------|--------|-------------|
| `certmanager_venafi_oauth_token_requests_total` | Counter | `status` (`success` \| `failure`) | Total number of Venafi OAuth token requests made by cert-manager. |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised certmanager_venafi_oauth_token_requests_total's status is "success" and "failure". I would have expected the HTTP status code instead. That would give a bit more information: 403 = probably misconfiguration, 500 = probably something wrong with the backend.

But maybe success/failure makes sense, I don't know.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Success/Failure is what we're using in the implementation as oppose to status codes.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But would it be worth going with status codes instead of success/failure in the implementation? I know I come a bit late (I didn't review the other PR), I am just wondering if it would be a little more usable with HTTP status codes.

Unless the auth flow contains multiple HTTP calls, and in that case it wouldn't make sense?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The token endpoint is a single call, so status codes would technically work, but success/failure also covers non-HTTP failures like network timeouts.

PR #8808 is already merged so changing labels now would be a breaking change.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem in changing what's in master, we can break it as much as we want until we cut the first beta. 👍

Non-HTTP errors returned by the OS (io timeout, can't reach server, and such) can be captured in the same label:

certmanager_venafi_oauth_token_requests_total{path="/oauth2/access_token", status="200"} 4902
certmanager_venafi_oauth_token_requests_total{path="/oauth2/access_token", status="200"} 45
certmanager_venafi_oauth_token_requests_total{path="/oauth2/access_token", status="net_error"} 3

or something like that.

example: https://github.com/jetstack/venafi-connection-lib/blob/443dd7e48a1aec2d75c071e996c06667f0d656d2/http_client/roundtripper_metrics.go#L76 (link private to Palo Alto)

@maelvls maelvls Jun 1, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not super hyped by these two metrics because this information is already available on the issuer/clusterissuer itself, and these already have metrics. The two new metrics don't any more information and don't add value IMO. And the epic didn't say anything about metrics:

Token request failures and successes can be tracked by reviewing the logs at the corresponding log level.

The Ready condition status for Issuer/ClusterIssuer should accurately indicate OAuth auth readiness. For instance, if a token cannot be obtained, the status should be set to NotReady with a reason such as AuthFailed or a similar equivalent.

I don't know why the ticket under the epic started talking about metrics. I guess AI just went "oh well let's have everything we can think of just in case".

I've had a chat with Felix, and we decided to keep the two metrics in cert-manager (cert-manager/cert-manager#8808) as Felix is going on vacation and removing the metrics would take work.

fyi @inteon

@maelvls maelvls left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a comment about success/failure vs. HTTP status code, but feel free to ignore if you feel it doesn't add much.

@cert-manager-prow cert-manager-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 1, 2026
@maelvls

maelvls commented Jun 1, 2026

Copy link
Copy Markdown
Member

/lgtm
/approve
/hold in case you want to do something about success/failure

@cert-manager-prow cert-manager-prow Bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm Indicates that a PR is ready to be merged. labels Jun 1, 2026
@cert-manager-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: maelvls

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 the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 1, 2026
felix.phipps added 2 commits June 1, 2026 16:07
Signed-off-by: felix.phipps <[email protected]>
Signed-off-by: felix.phipps <[email protected]>
@cert-manager-prow cert-manager-prow Bot added dco-signoff: no Indicates that at least one commit in this pull request is missing the DCO sign-off message. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed lgtm Indicates that a PR is ready to be merged. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 1, 2026
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Signed-off-by: felix.phipps <[email protected]>
@cert-manager-prow cert-manager-prow Bot removed the dco-signoff: no Indicates that at least one commit in this pull request is missing the DCO sign-off message. label Jun 1, 2026
@cert-manager-prow cert-manager-prow Bot added the dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. label Jun 1, 2026
@maelvls

maelvls commented Jun 2, 2026

Copy link
Copy Markdown
Member

/lgtm

@cert-manager-prow cert-manager-prow Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 2, 2026
@maelvls

maelvls commented Jun 2, 2026

Copy link
Copy Markdown
Member

/unhold

@cert-manager-prow cert-manager-prow Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 2, 2026
@cert-manager-prow
cert-manager-prow Bot merged commit 448de42 into cert-manager:master Jun 2, 2026
4 checks passed
@maelvls

maelvls commented Jun 8, 2026

Copy link
Copy Markdown
Member

This has been merged to master instead of release-next.

cert-manager-prow Bot added a commit that referenced this pull request Jun 8, 2026
Reapply #2117 (document 2 new Venafi client metrics)
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. lgtm Indicates that a PR is ready to be merged. 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