public class TraceContextCorrelation
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
AZURE_TRACEPARENT_COMPONENT_INITIAL |
static java.lang.String |
REQUEST_CONTEXT_HEADER_APPID_KEY |
static java.lang.String |
REQUEST_CONTEXT_HEADER_NAME |
static java.lang.String |
TRACEPARENT_HEADER_NAME |
static java.lang.String |
TRACESTATE_HEADER_NAME |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
createChildIdFromTraceparentString(java.lang.String traceparent)
This is helper method to convert traceparent (W3C) format to AI legacy format for supportability
|
static java.lang.String |
generateChildDependencyTarget(java.lang.String requestContext)
Generates the target appId to add to Outbound call
|
static java.lang.String |
generateChildDependencyTraceparent()
Generates child TraceParent by retrieving values from ThreadLocal.
|
static java.lang.String |
getAppId()
Retrieves the appId for the current active config's instrumentation key.
|
static void |
resolveCorrelation(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
com.microsoft.applicationinsights.telemetry.RequestTelemetry requestTelemetry)
This method is responsible to perform correlation for incoming request by populating it's
traceId, spanId and parentId.
|
static void |
resolveRequestSource(javax.servlet.http.HttpServletRequest request,
com.microsoft.applicationinsights.telemetry.RequestTelemetry requestTelemetry,
java.lang.String instrumentationKey)
Resolves the source of a request based on request header information and the appId of the current
component, which is retrieved via a query to the AppInsights service.
|
static java.lang.String |
retriveTracestate()
Helper method to retrieve Tracestate from ThreadLocal
|
static void |
setIsW3CBackCompatEnabled(boolean isW3CBackCompatEnabled) |
public static final java.lang.String TRACEPARENT_HEADER_NAME
public static final java.lang.String TRACESTATE_HEADER_NAME
public static final java.lang.String REQUEST_CONTEXT_HEADER_NAME
public static final java.lang.String AZURE_TRACEPARENT_COMPONENT_INITIAL
public static final java.lang.String REQUEST_CONTEXT_HEADER_APPID_KEY
public static void resolveCorrelation(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
com.microsoft.applicationinsights.telemetry.RequestTelemetry requestTelemetry)
request - response - requestTelemetry - public static java.lang.String getAppId()
public static void resolveRequestSource(javax.servlet.http.HttpServletRequest request,
com.microsoft.applicationinsights.telemetry.RequestTelemetry requestTelemetry,
java.lang.String instrumentationKey)
request - The servlet request.requestTelemetry - The request telemetry in which source will be populated.instrumentationKey - The instrumentation key for the current component.public static java.lang.String generateChildDependencyTarget(java.lang.String requestContext)
requestContext - public static java.lang.String retriveTracestate()
public static java.lang.String generateChildDependencyTraceparent()
public static java.lang.String createChildIdFromTraceparentString(java.lang.String traceparent)
traceparent - public static void setIsW3CBackCompatEnabled(boolean isW3CBackCompatEnabled)