Hi,
I am trying to send some custom metrics to Prometheus using the java client. Below is my code. However, when I run the sample I get the following error:
java.net.BindException: Can't assign requested address at sun.nio.ch.Net.bind0(Native Method) at sun.nio.ch.Net.bind(Net.java:433) at sun.nio.ch.Net.bind(Net.java:425) at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) at sun.net.httpserver.ServerImpl.<init>(ServerImpl.java:100) at sun.net.httpserver.HttpServerImpl.<init>(HttpServerImpl.java:50) at sun.net.httpserver.DefaultHttpServerProvider.createHttpServer(DefaultHttpServerProvider.java:35) at com.sun.net.httpserver.HttpServer.create(HttpServer.java:130) at io.prometheus.client.exporter.HTTPServer.<init>(HTTPServer.java:176) at io.prometheus.client.exporter.HTTPServer.<init>(HTTPServer.java:211) at com.test.promtheus.App.main(App.java:38)When i try the URL on the browser it loads the dashboard correctly.
public class App {Am i missing something?