We have automation project which is not hosted basically and we are executing our github branches using Jenkins.
So when out jobs executes through Jenkins then the execution has Prometheus instrumentation and needs to expose metrics but how Prometheus scrape it??
HTTPServer httpServer = new HTTPServer.Builder().withPort(8001).build();
One way found which is setup Prometheus HttpServer to specific port and Prometheus scraps metrics from this port but when Jenkins executions starts, HttpServer up and running and when ends then HttpServer goes down and next time same happens.
So need to overcome this problem. Is there any way for it using Prometheus Java Client library?