client_java
GitHubToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeBack to homepage

HTTPServer

The HTTPServer is a standalone server for exposing a metric endpoint. A minimal example application for HTTPServer can be found in the examples directory.

HTTPServer server = HTTPServer.builder()
    .port(9400)
    .buildAndStart();

By default, HTTPServer binds to any IP address, you can change this with hostname() or inetAddress().

HTTPServer is configured with three endpoints:

  • /metrics for Prometheus scraping.
  • /-/healthy for simple health checks.
  • / the default handler is a static HTML page.

The default handler can be changed with defaultHandler().

Authentication and HTTPS

You can find an example of authentication and SSL in the jmx_exporter.

Properties

See config section (todo) on runtime configuration options.

  • io.prometheus.exporter.httpServer.port: The port to bind to.