linkerd2/proxy
Eliza Weisman d76be26d85
proxy: Add tls_config_last_reload_seconds metric (#1204)
Depends on #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 <eliza@buoyant.io>
2018-07-05 16:23:57 -07:00
..
benches Proxy: More carefully keep track of the reason TLS isn't used. (#1164) 2018-06-20 07:40:49 -10:00
controller-grpc proxy: Update prost to 0.4.0 (#1127) 2018-06-14 16:29:41 -07:00
futures-mpsc-lossy Prepare for the v0.3.0 release (#406) 2018-02-21 11:14:11 -08:00
router proxy/router: Implement LRU cache eviction (#925) 2018-05-10 19:06:31 -07:00
src proxy: Add tls_config_last_reload_seconds metric (#1204) 2018-07-05 16:23:57 -07:00
tests proxy: Add TLS label in `transparency::retry_reconnect_errors` test (#1258) 2018-07-03 12:27:08 -07:00
Cargo.toml proxy: Fix out-of-control inotify CPU use (#1263) 2018-07-03 20:16:12 -07:00
Dockerfile proxy: update Rust compiler to 1.27.0 (#1207) 2018-06-26 13:12:17 -07:00