Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
proxy: Add tls_config_last_reload_seconds metric (linkerd#1204)
Depends on linkerd#1141. This PR adds a `tls_config_last_reload_seconds` Prometheus metric that reports the last time the TLS configuration files were reloaded. Proof that it works: Started the proxy with no certs, then generated them: ``` ➜ http GET localhost:4191/metrics HTTP/1.1 200 OK content-encoding: gzip content-length: 323 content-type: text/plain date: Mon, 25 Jun 2018 23:02:52 GMT # HELP tls_config_reload_total Total number of times the proxy's TLS config files were reloaded. # TYPE tls_config_reload_total counter tls_config_reload_total{status="io_error",path="example-example.crt",error_code="2"} 9 tls_config_reload_total{status="reloaded"} 3 # HELP tls_config_last_reload_seconds Timestamp of when the TLS configuration files were last reloaded successfully (in seconds since the UNIX epoch) # TYPE tls_config_last_reload_seconds gauge tls_config_last_reload_seconds 1529967764 # HELP process_start_time_seconds Time that the process started (in seconds since the UNIX epoch) # TYPE process_start_time_seconds gauge process_start_time_seconds 1529967754 ``` Started the proxy with certs already present: ``` ➜ http GET localhost:4191/metrics HTTP/1.1 200 OK content-encoding: gzip content-length: 285 content-type: text/plain date: Mon, 25 Jun 2018 23:04:39 GMT # HELP tls_config_reload_total Total number of times the proxy's TLS config files were reloaded. # TYPE tls_config_reload_total counter tls_config_reload_total{status="reloaded"} 4 # HELP tls_config_last_reload_seconds Timestamp of when the TLS configuration files were last reloaded successfully (in seconds since the UNIX epoch) # TYPE tls_config_last_reload_seconds gauge tls_config_last_reload_seconds 1529967876 # HELP process_start_time_seconds Time that the process started (in seconds since the UNIX epoch) # TYPE process_start_time_seconds gauge process_start_time_seconds 1529967874 ``` Signed-off-by: Eliza Weisman <[email protected]>
- Loading branch information