Annotation Interface Traced


@Documented @Retention(RUNTIME) @Target(METHOD) public @interface Traced
Adds trace ID propagation and structured logging to a method.

Usage


 @Traced
 public String chat(String message) { }

 @Traced(operationName = "tool-execution", includeArgs = true)
 public Object executeTool(String name, Map<String, Object> params) { }
 
Since:
0.3.0
See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Whether to include method arguments in the trace span attributes.
    boolean
    Whether to include the return value in the trace span.
    Custom operation name for the trace span.
  • Element Details

    • operationName

      String operationName
      Custom operation name for the trace span. Defaults to class.method if empty.
      Returns:
      operation name
      Default:
      ""
    • includeArgs

      boolean includeArgs
      Whether to include method arguments in the trace span attributes.
      Returns:
      true to log args (default: false)
      Default:
      false
    • includeResult

      boolean includeResult
      Whether to include the return value in the trace span.
      Returns:
      true to log result (default: false)
      Default:
      false