类 WebFluxSkyWalkingTraceContext
java.lang.Object
org.apache.skywalking.apm.toolkit.webflux.WebFluxSkyWalkingTraceContext
TraceContext for WebFlux.
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明getCorrelation(org.springframework.web.server.ServerWebExchange serverWebExchange, String key) Try to get the custom value from trace context.putCorrelation(org.springframework.web.server.ServerWebExchange serverWebExchange, String key, String value) Put the custom key/value into trace context.static StringsegmentId(org.springframework.web.server.ServerWebExchange serverWebExchange) Try to get the segmentId of current trace context.static intspanId(org.springframework.web.server.ServerWebExchange serverWebExchange) Try to get the spanId of current trace context.static StringtraceId(org.springframework.web.server.ServerWebExchange serverWebExchange) Try to get the traceId of current trace context.
-
构造器详细资料
-
WebFluxSkyWalkingTraceContext
public WebFluxSkyWalkingTraceContext()
-
-
方法详细资料
-
traceId
Try to get the traceId of current trace context.- 参数:
serverWebExchange- - EnhancedInstance that contains the tracing context- 返回:
- traceId, if it exists, or empty
String.
-
segmentId
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.
-