类 WebFluxSkyWalkingTraceContext

java.lang.Object
org.apache.skywalking.apm.toolkit.webflux.WebFluxSkyWalkingTraceContext

public class WebFluxSkyWalkingTraceContext extends Object
TraceContext for WebFlux.
  • 构造器详细资料

    • WebFluxSkyWalkingTraceContext

      public WebFluxSkyWalkingTraceContext()
  • 方法详细资料

    • traceId

      public static String traceId(org.springframework.web.server.ServerWebExchange serverWebExchange)
      Try to get the traceId of current trace context.
      参数:
      serverWebExchange - - EnhancedInstance that contains the tracing context
      返回:
      traceId, if it exists, or empty String.
    • segmentId

      public static String segmentId(org.springframework.web.server.ServerWebExchange serverWebExchange)
      Try to get the segmentId of current trace context.
      参数:
      serverWebExchange - - EnhancedInstance that contains the tracing context
      返回:
      segmentId, if it exists, or empty String.
    • spanId

      public static int spanId(org.springframework.web.server.ServerWebExchange serverWebExchange)
      Try to get the spanId of current trace context. The spanId is a negative number when the trace context is missing.
      参数:
      serverWebExchange - - EnhancedInstance that contains the tracing context
      返回:
      spanId, if it exists, or empty String.
    • getCorrelation

      public static Optional<String> getCorrelation(org.springframework.web.server.ServerWebExchange serverWebExchange, String key)
      Try to get the custom value from trace context.
      参数:
      serverWebExchange - - EnhancedInstance that contains the tracing context
      返回:
      custom data value.
    • putCorrelation

      public static Optional<String> putCorrelation(org.springframework.web.server.ServerWebExchange serverWebExchange, String key, String value)
      Put the custom key/value into trace context.
      参数:
      serverWebExchange - - EnhancedInstance that contains the tracing context
      返回:
      previous value if it exists.