Implement standard Prometheus metrics
Most client libraries and applications export a few standard metrics that would be useful for tor to implement. Below are some examples from a Prometheus' own /metrics
page.
Build Info - Don't need as many labels as GO provides here but the short version tag that appears on the relay consensus would be good.
# HELP prometheus_build_info A metric with a constant '1' value labeled by version, revision, branch, goversion from which prometheus was built, and the goos and goarch for the build.
# TYPE prometheus_build_info gauge
prometheus_build_info{branch="HEAD",goarch="amd64",goos="linux",goversion="go1.19.5",revision="225c61122d88b01d1f0eaaee0e05b6f3e0567ac0",version="2.42.0"} 1
Process start time and last config reload - Useful for dashboard annotations and alerts.
# HELP process_start_time_seconds Start time of the process since unix epoch in seconds.
# TYPE process_start_time_seconds gauge
process_start_time_seconds 1.67604147258e+09
# HELP prometheus_config_last_reload_success_timestamp_seconds Timestamp of the last successful configuration reload.
# TYPE prometheus_config_last_reload_success_timestamp_seconds gauge
prometheus_config_last_reload_success_timestamp_seconds 1.6761274276477513e+09
CPU / Memory of the current process - These might be a bit of a stretch as they could be hard to implement in a cross platform way and will require supporting float values for counters.
# HELP process_cpu_seconds_total Total user and system CPU time spent in seconds.
# TYPE process_cpu_seconds_total counter
process_cpu_seconds_total 6232.69
# HELP process_virtual_memory_bytes Virtual memory size in bytes.
# TYPE process_virtual_memory_bytes gauge
process_virtual_memory_bytes 1.924509696e+09
# HELP process_virtual_memory_max_bytes Maximum amount of virtual memory available in bytes.
# TYPE process_virtual_memory_max_bytes gauge
process_virtual_memory_max_bytes 1.8446744073709552e+19