Class TracedResolver

java.lang.Object
com.tnsai.resilience.TracedResolver

public final class TracedResolver extends Object
Resolves the @Traced annotation on an action method or its declaring Role class and produces a TracedSpan that wraps the dispatch with structured trace logs. Issue #173, Phase 1.

Resolution order: method-level wins over class-level (matching every other Phase-1 resolver). Both absent → returns TracedSpan.NOOP so the calling pattern never branches.

Phase 1 emits via SLF4J + MDC for trace-id propagation; Phase 2 will hand off to an OpenTelemetry SPI.

Since:
0.5.4 (issue #173, Phase 1)
  • Method Details

    • open

      public static TracedSpan open(ActionMetadata action, Role role, Map<String,Object> params)
      Opens a traced span for the given action invocation. The returned span emits span.start / span.end log lines and pushes the trace id onto the SLF4J MDC for downstream log correlation.
      Parameters:
      action - the action being dispatched (carries the method handle)
      role - the role hosting the action (for class-level fallback)
      params - the action's invocation arguments (logged when @Traced.includeArgs is true)
      Returns:
      a span handle, or TracedSpan.NOOP when neither method nor class declares @Traced