Class PrometheusMetricsServlet
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
ConstructorsConstructorDescriptionPrometheusMetricsServlet(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 TypeMethodDescriptionprotected voiddoGet(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, serviceMethods inherited from class jakarta.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
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:
doGetin classjakarta.servlet.http.HttpServlet- Throws:
IOException
-