Package io.micrometer.core.annotation
Annotation Interface Counted
Annotated methods would expose a few counter metrics about their execution status. By
default, both failed and successful attempts would be reported. Switching the
recordFailuresOnly()
to true
would instruct the corresponding aspect
to only record the failed attempts.
When the annotated method returns a CompletionStage
or any
of its subclasses, the counters will be incremented only when the
CompletionStage
is completed. If completed exceptionally a
failure is recorded, otherwise if recordFailuresOnly()
is set to
false
, a success is recorded.
- Since:
- 1.2.0
- See Also:
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionAn optional description for what the underlying counter is going to record.String[]
List of key-value pair arguments to supply the Counter as extra tags.boolean
By default, both failed and successful attempts are recorded.Represents the metric name for the to-be-recorded counters.
-
Element Details
-
value
String valueRepresents the metric name for the to-be-recorded counters.- Returns:
- The metric name.
- Default:
"method.counted"
-
recordFailuresOnly
boolean recordFailuresOnlyBy default, both failed and successful attempts are recorded. Switch it totrue
in order to only record failed attempts.- Returns:
- Whether to only report failures.
- Default:
false
-
extraTags
String[] extraTagsList of key-value pair arguments to supply the Counter as extra tags.- Returns:
- key-value pair of tags
- Since:
- 1.4.0
- See Also:
- Default:
{}
-
description
String descriptionAn optional description for what the underlying counter is going to record.- Returns:
- The counter description.
- Default:
""
-