Class NoopTraceScope
java.lang.Object
org.bithon.agent.sdk.tracing.impl.NoopTraceScope
- All Implemented Interfaces:
AutoCloseable,ITraceScopeV1,ITraceScope
No-op implementation of TraceScope used when the agent is not loaded
- Author:
- frank.chen021@outlook.com
- Date:
- 7/9/25 3:48 pm
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Finishes the underlying span and detaches the tracing context from current thread.Gets the underlying span for direct manipulation.Gets the trace ID associated with this scopeGets the tracing mode for this scope
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
NoopTraceScope
public NoopTraceScope()
-
-
Method Details
-
currentTraceId
Description copied from interface:ITraceScopeV1Gets the trace ID associated with this scope- Specified by:
currentTraceIdin interfaceITraceScopeV1- Returns:
- the trace ID, or null if not available
-
tracingMode
Description copied from interface:ITraceScopeV1Gets the tracing mode for this scope- Specified by:
tracingModein interfaceITraceScopeV1- Returns:
- the tracing mode
-
currentSpan
Description copied from interface:ITraceScopeV1Gets the underlying span for direct manipulation.- Specified by:
currentSpanin interfaceITraceScopeV1- Returns:
- the underlying span, or a no-op span if not available. NOTE: every call of this method returns a different instance of the span, even if the span is the same.
-
close
public void close()Description copied from interface:ITraceScopeV1Finishes the underlying span and detaches the tracing context from current thread. This must be called in the same thread where the scope was created, or an exceptionSdkExceptionis thrown- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceITraceScopeV1
-