Class MicrometerPrometheusFormatter
java.lang.Object
io.helidon.metrics.providers.micrometer.MicrometerPrometheusFormatter
- All Implemented Interfaces:
MeterRegistryFormatter
Retrieves and prepares meter output from the specified meter registry according to the formats supported by the Prometheus
meter registry.
Because the Prometheus exposition format is flat, and because some meter types have multiple values, the meter names in the output repeat the actual meter name with suffixes to indicate the specific quantities (e.g., count, total, max) each reported value conveys. Further, meter names in the output might need the prefix "m_" if the actual meter name starts with a digit or underscore and underscores replace special characters.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Builder for creating a tailored Prometheus formatter. -
Field Summary
Modifier and TypeFieldDescriptionMapping from supported media types to the corresponding Prometheus registry content types. -
Method Summary
Modifier and TypeMethodDescriptionbuilder
(MeterRegistry meterRegistry) Returns a new builder for constructing a formatter.format()
Returns the Prometheus output governed by the previously-specified media type, optionally filtered by the previously-specified scope and meter name selections.Formats the meter registry's metadata.static String
Convert the meter or tag name to the format used by the Prometheus simple client.
-
Field Details
-
MEDIA_TYPE_TO_FORMAT
Mapping from supported media types to the corresponding Prometheus registry content types.
-
-
Method Details
-
builder
Returns a new builder for constructing a formatter.- Parameters:
meterRegistry
- theMeterRegistry
from which to build the Prometheus output- Returns:
- new builder
-
normalizeNameToPrometheus
Convert the meter or tag name to the format used by the Prometheus simple client.- Parameters:
name
- original name- Returns:
- normalized name
-
format
Returns the Prometheus output governed by the previously-specified media type, optionally filtered by the previously-specified scope and meter name selections.- Specified by:
format
in interfaceMeterRegistryFormatter
- Returns:
- filtered Prometheus output
-
formatMetadata
Description copied from interface:MeterRegistryFormatter
Formats the meter registry's metadata.- Specified by:
formatMetadata
in interfaceMeterRegistryFormatter
- Returns:
- formatted metadata output
-