From 560da9412218ec012fcd4e217a0dbd2de40b4ada Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Wed, 17 Jun 2020 14:14:37 +0200 Subject: [PATCH] dnsdist: Add prometheus metric for version number --- pdns/dnsdist-web.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pdns/dnsdist-web.cc b/pdns/dnsdist-web.cc index 5a738ca0ac..92208c5434 100644 --- a/pdns/dnsdist-web.cc +++ b/pdns/dnsdist-web.cc @@ -804,6 +804,10 @@ static void connectionThread(int sock, ComboAddress remote) } } + output << "# HELP dnsdist_info " << "Info from dnsdist, value is always 1" << "\n"; + output << "# TYPE dnsdist_info " << "gauge" << "\n"; + output << "dnsdist_info{version=\"" << VERSION << "\"} " << "1" << "\n"; + resp.body = output.str(); resp.headers["Content-Type"] = "text/plain"; } -- 2.47.3