create a prometheus exporter on a standard http port (#107)

* create a hyper server and add option to enable it in config

* move prometheus stuff to its own file; update format

* create metric type and help lookup table

* finish the metric help type map

* switch to a boolean and a standard port

* dont emit unimplemented metrics

* fail if curl returns a non 200

* resolve conflicts

* move log out of config.show and into main

* terminating new line

* upgrade curl

* include unimplemented stats
This commit is contained in:
Nicholas Dujay
2022-08-09 15:19:11 -04:00
committed by GitHub
parent 7592339092
commit 1b166b462d
11 changed files with 500 additions and 7 deletions

View File

@@ -117,6 +117,7 @@ impl Default for User {
pub struct General {
pub host: String,
pub port: i16,
pub enable_prometheus_exporter: Option<bool>,
pub connect_timeout: u64,
pub healthcheck_timeout: u64,
pub shutdown_timeout: u64,
@@ -133,6 +134,7 @@ impl Default for General {
General {
host: String::from("localhost"),
port: 5432,
enable_prometheus_exporter: Some(false),
connect_timeout: 5000,
healthcheck_timeout: 1000,
shutdown_timeout: 60000,