Class PrometheusText
MetricsRegistry in the Prometheus text exposition format, version 0.0.4.
Dots in names become underscores. Counters get a _total suffix, and timers are exposed
in seconds as a histogram: cumulative _bucket series with an le tag, _sum
and _count. Every metric with help text (set on the registry, or built in for the
runtime's own metrics) gets a # HELP line, and the registry's own size and dropped series
are exposed as axiom_metrics_series and axiom_metrics_dropped_series_total.
Output order is stable. A timer's _count and its +Inf bucket are always equal;
its _sum may lag them by observations recorded while the registry was being read. Tag
values are escaped; no value is ever interpreted.
The metrics describe the application's routes and load. Serve them on a private network or behind authentication, never publicly; see the observability guide.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic Handlerhandler(MetricsRegistry registry) Returns a handler that answers with the registry's current exposition, for exampleapp.get("/metrics", PrometheusText.handler(registry), security.hasRole("ops")).static Stringrender(MetricsRegistry registry) Renders every series of a registry.
-
Field Details
-
CONTENT_TYPE
The media type of the exposition format.- See Also:
-
-
Method Details
-
render
Renders every series of a registry.- Parameters:
registry- registry to read- Returns:
- exposition text, empty for an empty registry
-
handler
Returns a handler that answers with the registry's current exposition, for exampleapp.get("/metrics", PrometheusText.handler(registry), security.hasRole("ops")).- Parameters:
registry- registry to read on every request- Returns:
- a handler answering 200 with
CONTENT_TYPE
-