Hi All, I am trying to send the runtime and status of a scala job to a pushgateway running on another server. The Pushgateway URL is something like ' *https://pushgateway.de/pushgateway*' which is redirected to :9091/metrics. I am using the below code where I am reading the URL, username and password from the docker run command. ----------------------------------------------- val pg = new PushGateway(hostname) val username = sys.env("PROMETHEUS_USERNAME") val password = sys.env("PROMETHEUS_PASSWORD") pg.setConnectionFactory(pg.setConnectionFactory(new BasicAuthHttpConnectionFactory(username, password)) pg.pushAdd(registry, jobName) --------------------------------------------------
When I run the Scala job I get the below error Exception in thread "main" java.net.UnknownHostException: https at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at sun.net.NetworkClient.doConnect(NetworkClient.java:175) at sun.net.www.http.HttpClient.openServer(HttpClient.java:463) at sun.net.www.http.HttpClient.openServer(HttpClient.java:558) at sun.net.www.http.HttpClient.<init>(HttpClient.java:242) at sun.net.www.http.HttpClient.New(HttpClient.java:339) at sun.net.www.http.HttpClient.New(HttpClient.java:357) at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1220) at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1156) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050) at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:984) at io.prometheus.client.exporter.PushGateway.doRequest(PushGateway.java:243) at io.prometheus.client.exporter.PushGateway.pushAdd(PushGateway.java:156) I am also able to curl to the URL. Could you please let me know what can be done here. P.S.: If I run the same job and send metrics to a instance on the same server with http URL, it works fine. Regards, Pradeep -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/bd500dbb-b0cc-4d71-88bd-e0bc17d53c62n%40googlegroups.com.

