Package com.tnsai.mcp.observability
Class LoggingMcpTracer
java.lang.Object
com.tnsai.mcp.observability.LoggingMcpTracer
- All Implemented Interfaces:
McpTracer
SLF4J-based implementation of
McpTracer that logs span lifecycle events.
Logs span start, end, attributes, status, and exceptions using the
com.tnsai.mcp.observability.McpTracing logger. Useful for development
and debugging without requiring a full tracing backend.
Log levels used:
- DEBUG - Span start, attribute setting, span end with duration
- WARN - Span errors and exceptions
- See Also:
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
LoggingMcpTracer
public LoggingMcpTracer()
-
-
Method Details
-
startSpan
Description copied from interface:McpTracerStarts a new root span with the given operation name.- Specified by:
startSpanin interfaceMcpTracer- Parameters:
operationName- the name of the operation being traced- Returns:
- a new span that must be ended via
McpSpan.end()
-
startSpan
Description copied from interface:McpTracerStarts a new child span with the given operation name and parent.- Specified by:
startSpanin interfaceMcpTracer- Parameters:
operationName- the name of the operation being tracedparent- the parent span- Returns:
- a new child span that must be ended via
McpSpan.end()
-