java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
io.prometheus.metrics.exporter.servlet.jakarta.PrometheusMetricsServlet
All Implemented Interfaces:
jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable

public class PrometheusMetricsServlet extends jakarta.servlet.http.HttpServlet
Initial example exporter so that we can try the new metrics library out.

We'll add a Jakarta servlet, the built-in HTTPServer, etc. soon, and likely move common code into a common module.

See Also:
  • Field Summary

    Fields inherited from class jakarta.servlet.http.HttpServlet

    LEGACY_DO_HEAD
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    PrometheusMetricsServlet(io.prometheus.metrics.config.PrometheusProperties config)
     
    PrometheusMetricsServlet(io.prometheus.metrics.config.PrometheusProperties config, io.prometheus.metrics.model.registry.PrometheusRegistry registry)
     
    PrometheusMetricsServlet(io.prometheus.metrics.model.registry.PrometheusRegistry registry)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    doGet(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
     

    Methods inherited from class jakarta.servlet.http.HttpServlet

    doDelete, doHead, doOptions, doPatch, doPost, doPut, doTrace, getLastModified, init, isSensitiveHeader, service, service

    Methods inherited from class jakarta.servlet.GenericServlet

    destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PrometheusMetricsServlet

      public PrometheusMetricsServlet()
    • PrometheusMetricsServlet

      public PrometheusMetricsServlet(io.prometheus.metrics.model.registry.PrometheusRegistry registry)
    • PrometheusMetricsServlet

      public PrometheusMetricsServlet(io.prometheus.metrics.config.PrometheusProperties config)
    • PrometheusMetricsServlet

      public PrometheusMetricsServlet(io.prometheus.metrics.config.PrometheusProperties config, io.prometheus.metrics.model.registry.PrometheusRegistry registry)
  • Method Details

    • doGet

      protected void doGet(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws IOException
      Overrides:
      doGet in class jakarta.servlet.http.HttpServlet
      Throws:
      IOException