From df04f36b0f399b0d461c5f6a1ac4b80934c77523 Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Wed, 17 Jun 2020 14:28:03 +0200 Subject: [PATCH] auth: Add version as prometheus metric --- pdns/ws-auth.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pdns/ws-auth.cc b/pdns/ws-auth.cc index 078a96cf3c..4209eae058 100644 --- a/pdns/ws-auth.cc +++ b/pdns/ws-auth.cc @@ -2274,6 +2274,10 @@ static void prometheusMetrics(HttpRequest* req, HttpResponse* resp) { output << prometheusMetricName << " " << S.read(metricName) << "\n"; } + output << "# HELP pdns_auth_info " << "Info from PowerDNS, value is always 1" << "\n"; + output << "# TYPE pdns_auth_info " << "gauge" << "\n"; + output << "pdns_auth_info{version=\"" << VERSION << "\"} " << "1" << "\n"; + resp->body = output.str(); resp->headers["Content-Type"] = "text/plain"; resp->status = 200; -- 2.47.2