Package com.tnsai.resilience
Class TracedResolver
java.lang.Object
com.tnsai.resilience.TracedResolver
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 Summary
Modifier and TypeMethodDescriptionstatic TracedSpanOpens a traced span for the given action invocation.
-
Method Details
-
open
Opens a traced span for the given action invocation. The returned span emitsspan.start/span.endlog 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.includeArgsis true)- Returns:
- a span handle, or
TracedSpan.NOOPwhen neither method nor class declares@Traced
-