Class PrometheusMetricsServlet
Object
GenericServlet
HttpServlet
PrometheusMetricsServlet
- All Implemented Interfaces:
Serializable
,Servlet
,ServletConfig
This class extends HttpServlet to create a servlet for exporting Prometheus metrics. It uses a
PrometheusScrapeHandler to handle HTTP GET requests and export metrics. The servlet can be
configured with custom PrometheusProperties and a PrometheusRegistry.
- See Also:
-
Constructor Summary
ConstructorDescriptionDefault constructor.Constructor with custom PrometheusProperties.PrometheusMetricsServlet
(PrometheusProperties config, PrometheusRegistry registry) Constructor with custom PrometheusProperties and PrometheusRegistry.PrometheusMetricsServlet
(PrometheusRegistry registry) Constructor with a custom PrometheusRegistry. -
Method Summary
Methods inherited from class HttpServlet
service
Methods inherited from class GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
-
Constructor Details
-
PrometheusMetricsServlet
public PrometheusMetricsServlet()Default constructor. Uses the default PrometheusProperties and PrometheusRegistry. -
PrometheusMetricsServlet
Constructor with a custom PrometheusRegistry. Uses the default PrometheusProperties.- Parameters:
registry
- the PrometheusRegistry to use
-
PrometheusMetricsServlet
Constructor with custom PrometheusProperties. Uses the default PrometheusRegistry.- Parameters:
config
- the PrometheusProperties to use
-
PrometheusMetricsServlet
Constructor with custom PrometheusProperties and PrometheusRegistry.- Parameters:
config
- the PrometheusProperties to useregistry
- the PrometheusRegistry to use
-