public class ApplicationEventTracer extends Object
TraceAutoConfiguration,
SleuthLogAutoConfiguration,
Slf4jCurrentTraceContext| Constructor and Description |
|---|
ApplicationEventTracer() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getSpanId()
获取当前线程中保存的spanId
|
static String |
getTraceId()
获取当前线程中保存的traceId
|
long |
nextId()
Generates a new 64-bit ID, taking care to dodge zero which can be
confused with absent
|
void |
replace(String key,
String value)
更新
MDC 上下文中的信息 |
void |
setTraceId(String traceId)
设置 traceId 信息到
MDC 上下文中 |
String |
startApplication()
开始记录应用启动事件
|
void |
startedApplication(org.springframework.context.ConfigurableApplicationContext applicationContext)
结束记录应用启动事件
|
public long nextId()
public void setTraceId(String traceId)
MDC 上下文中traceId - traceIdpublic void replace(String key, @Nullable String value)
MDC 上下文中的信息key - property keyvalue - property value,如果为 null 则删除这个 keypublic String startApplication()
public void startedApplication(org.springframework.context.ConfigurableApplicationContext applicationContext)
applicationContext - applicationContext上下文,用于将当前对象注册到上下文中public static String getSpanId()
优先取
ApmConstants.LEGACY_SPAN_ID_NAME
如果没有上面这个key,才取这个key的值
ApmConstants.SPAN_ID_NAME
public static String getTraceId()
优先取
ApmConstants.LEGACY_TRACE_ID_NAME
如果没有上面这个key,才取这个key的值
ApmConstants.TRACE_ID_NAME
Copyright © 2018–2020. All rights reserved.