mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Exporter: Listen at port 9972 for Prometheus exporter. (#3195)
This commit is contained in:
parent
4ad4dd0975
commit
9525511032
7 changed files with 105 additions and 4 deletions
|
@ -87,7 +87,9 @@ srs_error_t srs_api_response_json(ISrsHttpResponseWriter* w, string data)
|
|||
SrsHttpHeader* h = w->header();
|
||||
|
||||
h->set_content_length(data.length());
|
||||
h->set_content_type("application/json");
|
||||
if (h->content_type().empty()) {
|
||||
h->set_content_type("application/json");
|
||||
}
|
||||
|
||||
if ((err = w->write((char*)data.data(), (int)data.length())) != srs_success) {
|
||||
return srs_error_wrap(err, "write json");
|
||||
|
@ -1153,5 +1155,7 @@ srs_error_t SrsGoApiMetrics::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessa
|
|||
<< nerrs
|
||||
<< "\n";
|
||||
|
||||
w->header()->set_content_type("text/plain; charset=utf-8");
|
||||
|
||||
return srs_api_response(w, r, ss.str());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue