Class MetricMetadata
Object
MetricMetadata
Immutable container for metric metadata: name, help, unit.
-
Constructor Summary
ConstructorDescriptionMetricMetadata
(String name) MetricMetadata
(String name, String help) MetricMetadata
(String name, String help, Unit unit) Constructor. -
Method Summary
-
Constructor Details
-
MetricMetadata
-
MetricMetadata
-
MetricMetadata
Constructor.- Parameters:
name
- must not benull
.isValidMetricName(name)
must betrue
. UsePrometheusNaming.sanitizeMetricName(String)
to convert arbitrary strings into valid names.help
- optional. May benull
.unit
- optional. May benull
.
-
-
Method Details
-
getName
The name does not include the_total
suffix for counter metrics or the_info
suffix for Info metrics.The name may contain dots. Use
getPrometheusName()
to get the name in Prometheus format, i.e. with dots replaced by underscores. -
getPrometheusName
Same asgetName()
but with dots replaced by underscores.This is used by Prometheus exposition formats.
-
getHelp
-
hasUnit
-
getUnit
-