Change prometheus port

This commit is contained in:
Barzan Hayati 2025-07-17 00:59:56 +00:00
parent a29d9b38be
commit de2183edab
2 changed files with 12 additions and 4 deletions

View File

@ -7,9 +7,13 @@
"mount_address": "/rtsp-output",
"udp_buffer_size": 524288,
"clock_rate": 90000,
"bitrate":4000000,
"bitrate": 4000000,
"payload": 96,
"rtsp_port": 3087,
"updsink_port_num": 5400,
"host": "224.224.255.255"
}
"host": "224.224.255.255",
"prometheus": {
"port": 3091,
"host": "0.0.0.0"
}
}

View File

@ -59,9 +59,13 @@ int main(int argc, char *argv[]) {
return 1;
}
const auto &config = ConfigManager::get_instance().get_config();
std::string host = config["prometheus"]["host"];
int port = config["prometheus"]["port"];
std::string prometheus_address = host + ":" + std::to_string(port);
// MetricsManager* metric_manager = new MetricsManager();
std::shared_ptr<MetricsManager> metric_manager =
std::make_shared<MetricsManager>("0.0.0.0:8080");
std::make_shared<MetricsManager>(prometheus_address);
metric_manager->setup_prometheus(); // Calls the metrics_loop method
std::thread metrics_thread(&MetricsManager::metrics_loop, metric_manager);