Class MetricMetadata.Builder
Object
Builder
- Enclosing class:
MetricMetadata
Builder for
MetricMetadata.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds theMetricMetadata.counterSuffix(boolean counterSuffix) Optional.expositionBaseName(String expositionBaseName) Internal use only.Optional.Required.originalName(String originalName) Internal use only.Optional.
-
Method Details
-
name
Required. The base metric name (without type suffix like_total). -
expositionBaseName
Internal use only. Not part of the stable API.Allows internal callers to preserve a separate exposition base name.
-
originalName
Internal use only. Not part of the stable API.Allows internal callers to preserve the raw name before normalization.
-
help
Optional. Human-readable description of the metric. -
unit
Optional. The unit of measurement. Appended to the name if not already present. -
counterSuffix
Optional. Whentrue, the writer appends_totalto the exposition name. Use this for counter metrics, especially UTF-8 names where the writer cannot infer it from the snapshot type alone. -
build
Builds theMetricMetadata. Throws ifnamewas not set.
-