Package io.micrometer.core.annotation
Annotation Interface Timed
@Target({ANNOTATION_TYPE,TYPE,METHOD})
@Repeatable(TimedSet.class)
@Retention(RUNTIME)
@Inherited
public @interface Timed
Annotated methods are instrumented using a
Timer or a LongTaskTimer
(longTask flag).
If the instrumented method completes exceptionally, the exception will be recorded in a
separate tag. When the annotated method returns a
CompletionStage or any of its subclasses, the
Timer/LongTaskTimer will be stopped only when the
CompletionStage is completed.
- See Also:
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionDescription of theTimer.String[]List of key-value pair arguments to supply the Timer as extra tags.booleanWhether to enable recording of a percentile histogram for theTimer.booleanFlag of whether the Timer should be aLongTaskTimer.double[]List of percentiles to calculate client-side for theTimer.double[]List of service level objectives to calculate client-side for theTimerin seconds.Name of the Timer metric.
-
Element Details
-
value
String valueName of the Timer metric.- Returns:
- name of the Timer metric
- Default:
""
-
extraTags
String[] extraTagsList of key-value pair arguments to supply the Timer as extra tags.- Returns:
- key-value pair of tags
- See Also:
- Default:
{}
-
longTask
boolean longTaskFlag of whether the Timer should be aLongTaskTimer.- Returns:
- whether the timer is a LongTaskTimer
- Default:
false
-
percentiles
double[] percentilesList of percentiles to calculate client-side for theTimer. For example, the 95th percentile should be passed as0.95.- Returns:
- percentiles to calculate
- See Also:
- Default:
{}
-
histogram
boolean histogramWhether to enable recording of a percentile histogram for theTimer.- Returns:
- whether percentile histogram is enabled
- See Also:
- Default:
false
-
serviceLevelObjectives
double[] serviceLevelObjectivesList of service level objectives to calculate client-side for theTimerin seconds. For example, for a 100ms should be passed as0.1.- Returns:
- service level objectives to calculate
- Since:
- 1.14.0
- See Also:
- Default:
{}
-
description
String descriptionDescription of theTimer.- Returns:
- meter description
- See Also:
- Default:
""
-