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

Feature request: include collection of SSL expiration from SHOW GLOBAL STATUS output #457

Closed
nikosmeds opened this issue Mar 19, 2020 · 2 comments · Fixed by #561
Closed

Comments

@nikosmeds
Copy link

Issue

It appears that mysqld-exporter does not collect any non-floating point values from SHOW GLOBAL STATUS;

  1. Use SQL query search GLOBAL STATUS
    mysql> SHOW GLOBAL STATUS \G;
    [...]
    *************************** 389. row ***************************
    Variable_name: Ssl_finished_connects
            Value: 0
    *************************** 390. row ***************************
    Variable_name: Ssl_server_not_after
            Value: May 24 11:46:23 2020 GMT
    *************************** 391. row ***************************
    Variable_name: Ssl_server_not_before
            Value: Feb 24 11:46:23 2020 GMT
    *************************** 392. row ***************************
    Variable_name: Ssl_session_cache_hits
            Value: 0
    
  2. Via PromQL I can find mysql_global_status_ssl_finished_connects and mysql_global_status_ssl_session_cache_hits metrics
  3. Via PromQL I cannot find mysql_global_status_ssl_server_not_after or mysql_global_status_ssl_server_not_before metrics

My assumption is that these metrics are skipped due to the SQL command output format being timestamps and not a floating point value.

It would be great to have the SSL expiration metrics available in Prometheus, as then I can create "SSL Expiring Soon" alerts for the certificates loaded by MariaDB.

Thanks :)

Host operating system:

Linux redacted.example.net 5.0.0-36-generic #39~18.04.1-Ubuntu SMP Tue Nov 12 11:09:50 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

mysqld_exporter version:

mysqld_exporter, version 0.12.1 (branch: HEAD, revision: 48667bf7c3b438b5e93b259f3d17b70a7c9aff96)
  build user:       root@0b3e56a7bc0a
  build date:       20190729-12:35:58
  go version:       go1.12.7

MySQL server version

Percona XtraDB (i.e. MariaDB)

mysql> SELECT VERSION();
+------------------+
| VERSION()        |
+------------------+
| 5.7.28-31-57-log |
+------------------+
1 row in set (0.00 sec)
@nikosmeds
Copy link
Author

nikosmeds commented Mar 19, 2020

I have minimal Go experience, but #338 looks like a good example of the changes required when adding new metrics that aren't initially floating point values.

Also blackbox-exporter collects SSL expiration with HTTP requests, https://github.com/prometheus/blackbox_exporter/blob/master/prober/http.go#L260 may be another good example.

EDIT: Also related https://programming.guide/go/format-parse-string-time-date-example.html

@nikosmeds
Copy link
Author

Figured I'd update with a recent discovery: we can covert the value to epoch time using date command.

$ date -d "May 24 11:46:23 2020 GMT" +'%s'
1590320783

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

Successfully merging a pull request may close this issue.

1 participant