Skip to content

PrometheusServlet

PrometheusServlet is a metrics sink that comes with a ServletContextHandler to serve metrics snapshots in Prometheus format.

Creating Instance

PrometheusServlet takes the following to be created:

PrometheusServlet is created when:

ServletContextHandler

PrometheusServlet creates a ServletContextHandler to be registered at the path configured by path property.

The ServletContextHandler handles text/plain content type.

When executed, the ServletContextHandler gives a metrics snapshot.

Metrics Snapshot

getMetricsSnapshot(
  request: HttpServletRequest): String

getMetricsSnapshot...FIXME

getHandlers

getHandlers(
  conf: SparkConf): Array[ServletContextHandler]

getHandlers is the ServletContextHandler.

getHandlers is used when: