Prometheus v3 will, by default, be more strict about the content-types
returned from scrape endpoints. With the current value (just
`text/plain`), it would fail to scrape.
In this commit the value is changed from `text/plain` to `text/plain;
version=0.0.4`.
See also [1] and [2]
[1] https://prometheus.io/docs/instrumenting/exposition_formats/
[2] https://prometheus.io/docs/prometheus/3.0/migration/
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 */
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
<< "\n";
resp->body = output.str();
- resp->headers["Content-Type"] = "text/plain";
+ resp->headers["Content-Type"] = "text/plain; version=0.0.4";
resp->status = 200;
}
<< "\n";
resp->body = output.str();
- resp->headers["Content-Type"] = "text/plain";
+ resp->headers["Content-Type"] = "text/plain; version=0.0.4";
resp->status = 200;
}