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

missing metric x509_cert_error for non-existent certificate file #312

Open
r0bj opened this issue Jul 24, 2024 · 0 comments
Open

missing metric x509_cert_error for non-existent certificate file #312

r0bj opened this issue Jul 24, 2024 · 0 comments

Comments

@r0bj
Copy link

r0bj commented Jul 24, 2024

I encountered an issue with the x509-certificate-exporter when using the --expose-per-cert-error-metrics option. The following configuration was set:

  • Certificate file: /path/to/certfile.crt
  • Explicitly set using --watch-file /path/to/certfile.crt

When the specified file is not present on the filesystem, the exporter logs the following warning:

level=warning msg="no certificate(s) found in "/path/to/certfile.crt"

According to the documentation, the metric x509_cert_error{filename="certfile.crt", filepath="/path/to/certfile.crt"} 1 should be exported, indicating the error. However, this metric is not being exported.

Steps to Reproduce:

  1. Configure the exporter with the following options:
--expose-per-cert-error-metrics
--watch-file /path/to/certfile.crt
  1. Ensure the file /path/to/certfile.crt does not exist on the filesystem.
  2. Check the exporter logs for the warning message.
  3. Verify if the metric x509_cert_error is being exported.

Expected Behavior:
When the certificate file is not found, the exporter should log the warning and export the metric:

x509_cert_error{filename="certfile.crt", filepath="/path/to/certfile.crt"} 1

BTW, x509_read_errors metric should also be incremented on every certificate failed read attempt but it's not the case.

Actual Behavior:
The warning message is logged, but the expected metric is not exported.

Environment:

  • x509-certificate-exporter version: 3.14.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant