Class HTTPServer

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  HTTPServer.Builder
      We keep the original constructors of HTTPServer for compatibility, but new configuration parameters like sampleNameFilter must be configured using the Builder.
      static class  HTTPServer.HTTPMetricHandler
      Handles Metrics collections from the given registry.
    • Constructor Summary

      Constructors 
      Constructor Description
      HTTPServer​(int port)
      Start an HTTP server serving the default Prometheus registry using non-daemon threads.
      HTTPServer​(int port, boolean daemon)
      Start an HTTP server serving the default Prometheus registry.
      HTTPServer​(com.sun.net.httpserver.HttpServer httpServer, io.prometheus.client.CollectorRegistry registry, boolean daemon)
      Start an HTTP server serving Prometheus metrics from the given registry using the given HttpServer.
      HTTPServer​(String host, int port)
      Start an HTTP server serving the default Prometheus registry using non-daemon threads.
      HTTPServer​(String host, int port, boolean daemon)
      Start an HTTP server serving the default Prometheus registry.
      HTTPServer​(InetSocketAddress addr, io.prometheus.client.CollectorRegistry registry)
      Start an HTTP server serving Prometheus metrics from the given registry using non-daemon threads.
      HTTPServer​(InetSocketAddress addr, io.prometheus.client.CollectorRegistry registry, boolean daemon)
      Start an HTTP server serving Prometheus metrics from the given registry.
    • Constructor Detail

      • HTTPServer

        public HTTPServer​(com.sun.net.httpserver.HttpServer httpServer,
                          io.prometheus.client.CollectorRegistry registry,
                          boolean daemon)
                   throws IOException
        Start an HTTP server serving Prometheus metrics from the given registry using the given HttpServer. The httpServer is expected to already be bound to an address
        Throws:
        IOException
      • HTTPServer

        public HTTPServer​(InetSocketAddress addr,
                          io.prometheus.client.CollectorRegistry registry)
                   throws IOException
        Start an HTTP server serving Prometheus metrics from the given registry using non-daemon threads.
        Throws:
        IOException
      • HTTPServer

        public HTTPServer​(int port,
                          boolean daemon)
                   throws IOException
        Start an HTTP server serving the default Prometheus registry.
        Throws:
        IOException
      • HTTPServer

        public HTTPServer​(int port)
                   throws IOException
        Start an HTTP server serving the default Prometheus registry using non-daemon threads.
        Throws:
        IOException