From 749e12faa0bb2695b2c03ad4d3a140d9bc6919ea Mon Sep 17 00:00:00 2001 From: Pat Riehecky Date: Tue, 25 Jul 2023 14:30:25 -0500 Subject: [PATCH] Add OpenMetrics compatible endpoint Signed-off-by: Pat Riehecky --- data/templates/Makefile.am | 1 + data/templates/metrics | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 data/templates/metrics diff --git a/data/templates/Makefile.am b/data/templates/Makefile.am index e4b0134..fd178a0 100644 --- a/data/templates/Makefile.am +++ b/data/templates/Makefile.am @@ -3,6 +3,7 @@ templatesdir = $(pkgdatadir) TEMPLATES = \ debug.html \ default.html \ + metrics \ stats.html templates_DATA = \ diff --git a/data/templates/metrics b/data/templates/metrics new file mode 100644 index 0000000..59627d9 --- /dev/null +++ b/data/templates/metrics @@ -0,0 +1,19 @@ +# HELP opens Number of open connections. +# TYPE opens Gauge +opens {opens} +# HELP reqs Number of requests. +# TYPE reqs Counter +reqs {reqs} +# HELP badconns Number of bad connections. +# TYPE badconns Counter +badconns {badconns} +# HELP deniedconns Number of denied connections. +# TYPE deniedconns Counter +deniedconns {deniedconns} +# HELP refusedconns Number of refused connections due to high load. +# TYPE refusedconns Counter +refusedconns {refusedconns} +# HELP binary_info Information about the binary +# TYPE binary Info +binary_info{name="{package}",version="{version}"} 1 +# EOF