Annotation Interface Metered


@Documented @Retention(RUNTIME) @Target({METHOD,TYPE}) public @interface Metered
Collects latency, call count, and error rate metrics for a method.

Usage


 @Metered
 public String chat(String message) { }

 @Metered(name = "tool.execution", tags = {"module=core"})
 public Object executeTool(String name) { }
 
Since:
0.3.0
See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Whether to record a latency histogram in addition to counters.
    Custom metric name.
    Static tags added to every metric emission (key=value format).
  • Element Details

    • name

      String name
      Custom metric name. Defaults to class.method if empty.
      Returns:
      metric name
      Default:
      ""
    • tags

      String[] tags
      Static tags added to every metric emission (key=value format).
      Returns:
      metric tags
      Default:
      {}
    • histogram

      boolean histogram
      Whether to record a latency histogram in addition to counters.
      Returns:
      true to record histogram (default: true)
      Default:
      true