Class NoopTraceScope

java.lang.Object
org.bithon.agent.sdk.tracing.impl.NoopTraceScope
All Implemented Interfaces:
AutoCloseable, ITraceScopeV1, ITraceScope

public class NoopTraceScope extends Object implements 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 Details

  • Constructor Details

    • NoopTraceScope

      public NoopTraceScope()
  • Method Details

    • currentTraceId

      public String currentTraceId()
      Description copied from interface: ITraceScopeV1
      Gets the trace ID associated with this scope
      Specified by:
      currentTraceId in interface ITraceScopeV1
      Returns:
      the trace ID, or null if not available
    • tracingMode

      public TracingMode tracingMode()
      Description copied from interface: ITraceScopeV1
      Gets the tracing mode for this scope
      Specified by:
      tracingMode in interface ITraceScopeV1
      Returns:
      the tracing mode
    • currentSpan

      public ISpanScope currentSpan()
      Description copied from interface: ITraceScopeV1
      Gets the underlying span for direct manipulation.
      Specified by:
      currentSpan in interface ITraceScopeV1
      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: ITraceScopeV1
      Finishes 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 exception SdkException is thrown
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface ITraceScopeV1