Package io.micrometer.core.instrument
Class Meter.Builder
java.lang.Object
io.micrometer.core.instrument.Meter.Builder
- Enclosing interface:
- Meter
Fluent builder for custom meters.
-
Method Summary
Modifier and TypeMethodDescriptiondescription(String description)
register(MeterRegistry registry)
Add the meter to a single registry, or return an existing meter in that registry.
-
Method Details
-
tags
- Parameters:
tags
- Must be an even number of arguments representing key/value pairs of tags.- Returns:
- The custom meter builder with added tags.
-
tags
- Parameters:
tags
- Tags to add to the eventual meter.- Returns:
- The custom meter builder with added tags.
-
tag
- Parameters:
key
- The tag key.value
- The tag value.- Returns:
- The custom meter builder with a single added tag.
-
description
- Parameters:
description
- Description text of the eventual meter.- Returns:
- The custom meter builder with added description.
-
baseUnit
- Parameters:
unit
- Base unit of the eventual meter.- Returns:
- The custom meter builder with added base unit.
-
register
Add the meter to a single registry, or return an existing meter in that registry. The returned meter will be unique for each registry, but each registry is guaranteed to only create one meter for the same combination of name and tags.- Parameters:
registry
- A registry to add the custom meter to, if it doesn't already exist.- Returns:
- A new or existing custom meter.
-