Class SimpleMeterConvention<C extends @Nullable Object>
java.lang.Object
io.micrometer.core.instrument.binder.SimpleMeterConvention<C>
- Type Parameters:
C- context type from which tags can be derived
- All Implemented Interfaces:
MeterConvention<C>
public class SimpleMeterConvention<C extends @Nullable Object>
extends Object
implements MeterConvention<C>
Basic implementation of a
MeterConvention.- Since:
- 1.16.0
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleMeterConvention(String name) Create a convention with a name and no tags.SimpleMeterConvention(String name, Tags tags) Create a convention with a name and fixed tags.SimpleMeterConvention(String name, Function<C, Tags> tagsFunction) Create a convention with a name and tags derived from a function. -
Method Summary
-
Constructor Details
-
SimpleMeterConvention
Create a convention with a name and no tags.- Parameters:
name- meter name
-
SimpleMeterConvention
Create a convention with a name and fixed tags.- Parameters:
name- meter nametags- tags associated with the meter
-
SimpleMeterConvention
Create a convention with a name and tags derived from a function.- Parameters:
name- meter nametagsFunction- derive tags from the context with this function
-
-
Method Details
-
getName
Description copied from interface:MeterConventionCanonical name of the meter.- Specified by:
getNamein interfaceMeterConvention<C extends @Nullable Object>- Returns:
- meter name
-
getTags
Description copied from interface:MeterConventionTags specific to this meter convention. Generally they should be combined with any common tags if this convention is associated with other conventions that share tags.- Specified by:
getTagsin interfaceMeterConvention<C extends @Nullable Object>- Parameters:
context- optional context which may be used for deriving tags- Returns:
- tags instance to use with the meter described by this convention
-