MetricsPort: new metric exposing time until online keys expire for relay operators using OfflineMasterKey
Summary
The number of tor relay operators using the OfflineMasterKey feature is increasing. To reduce the risk of relay outages caused by not renewed online keys, it would be great to help relay operators with monitoring their key expiry by exposing the number of seconds until the online keys expire and tor automatically shuts down.
This will allow relay operators to write alertmanager rules to notify them in time before their keys expire.
What is the expected behavior?
When connecting to the MetricsPort of a tor relay running in OfflineMasterKey mode, a metric will indicate the time in seconds until the online keys expire.
The metric could be named:
tor_relay_online_key_expiry_seconds
a positive integer as a countdown until tor shuts down.