]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: Add version info to prometheus statistics
authorPieter Lexis <pieter.lexis@powerdns.com>
Wed, 17 Jun 2020 12:26:25 +0000 (14:26 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Wed, 17 Jun 2020 12:26:25 +0000 (14:26 +0200)
pdns/ws-recursor.cc

index a074460c2f1f587191feefbaff1c052194981273..7237596e1dd06c51abf1198c5551e665c70d19c3 100644 (file)
@@ -458,6 +458,10 @@ static void prometheusMetrics(HttpRequest *req, HttpResponse *resp) {
         output << prometheusMetricName << " " << tup.second << "\n";
     }
 
+    output << "# HELP pdns_recursor_info " << "Info from pdns_recursor, value is always 1" << "\n";
+    output << "# TYPE pdns_recursor_info " << "gauge" << "\n";
+    output << "pdns_recursor_info{version=\"" << VERSION << "\"} " << "1" << "\n";
+
     resp->body = output.str();
     resp->headers["Content-Type"] = "text/plain";
     resp->status = 200;