Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust Content-Type header for Prometheus endpoint to include version #15072

Merged
merged 1 commit into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pdns/dnsdistdist/dnsdist-web.cc
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ static void handlePrometheus(const YaHTTP::Request& req, YaHTTP::Response& resp)
output << "dnsdist_info{version=\"" << VERSION << "\"} " << "1" << "\n";

resp.body = output.str();
resp.headers["Content-Type"] = "text/plain";
resp.headers["Content-Type"] = "text/plain; version=0.0.4";
// clang-format on
}
#endif /* DISABLE_PROMETHEUS */
Expand Down
2 changes: 1 addition & 1 deletion pdns/recursordist/docs/http-api/prometheus.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Prometheus Data Endpoint
HTTP/1.1 200 OK
Connection: close
Content-Length: 19203
Content-Type: text/plain
Content-Type: text/plain; version=0.0.4
Server: PowerDNS/0.0.16480.0.g876dd46192

# HELP pdns_recursor_all_outqueries Number of outgoing UDP queries since starting
Expand Down
2 changes: 1 addition & 1 deletion pdns/recursordist/ws-recursor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ static void prometheusMetrics(HttpRequest* /* req */, HttpResponse* resp)
<< "\n";

resp->body = output.str();
resp->headers["Content-Type"] = "text/plain";
resp->headers["Content-Type"] = "text/plain; version=0.0.4";
resp->status = 200;
}

Expand Down
2 changes: 1 addition & 1 deletion pdns/ws-auth.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2667,7 +2667,7 @@ static void prometheusMetrics(HttpRequest* /* req */, HttpResponse* resp)
<< "\n";

resp->body = output.str();
resp->headers["Content-Type"] = "text/plain";
resp->headers["Content-Type"] = "text/plain; version=0.0.4";
resp->status = 200;
}

Expand Down
Loading