Class DistributedTracingContext
java.lang.Object
com.symphony.bdk.http.api.tracing.DistributedTracingContext
Helper class that manipulates underlying logger
MDC
for distributed tracing purpose. The Symphony platform
internally relies on header X-Trace-Id
value that is printed at server side logs. This is especially
useful when debugging issues across multiple distributed systems.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic void
clear()
static void
doWithTraceId
(String traceId, Runnable runnable) Processes any customRunnable
using a given traceId.static String
static boolean
static void
setBaseTraceId
(String baseTraceId) InitsMDC
X-Trace-Id entry with a given traceId followed by a generated random alphanumeric value.static void
InitsMDC
X-Trace-Id entry with a generated random alphanumeric value.static void
setTraceId
(String traceId) InitsMDC
X-Trace-Id entry with a given value.
-
Field Details
-
TRACE_ID
- See Also:
-
-
Method Details
-
setTraceId
public static void setTraceId()InitsMDC
X-Trace-Id entry with a generated random alphanumeric value. -
setTraceId
InitsMDC
X-Trace-Id entry with a given value. -
setBaseTraceId
InitsMDC
X-Trace-Id entry with a given traceId followed by a generated random alphanumeric value. -
getTraceId
-
hasTraceId
public static boolean hasTraceId() -
clear
public static void clear() -
doWithTraceId
Processes any customRunnable
using a given traceId. Then backup the original- Parameters:
traceId
- a given traceIdrunnable
- the logic to be executed
-