public class TelemetryCorrelationUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CORRELATION_CONTEXT_HEADER_NAME |
static java.lang.String |
CORRELATION_HEADER_NAME |
static java.lang.String |
REQUEST_CONTEXT_HEADER_APPID_KEY |
static java.lang.String |
REQUEST_CONTEXT_HEADER_NAME |
static java.lang.String |
REQUEST_CONTEXT_HEADER_ROLENAME_KEY |
static int |
REQUESTID_MAXLENGTH |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
generateChildDependencyId()
Generates a child Id for dependencies.
|
static java.lang.String |
generateChildDependencyTarget(java.lang.String requestContext)
Given a request context, it generates a new dependency target, possibly including the appId found in
the given Request-Context.
|
static boolean |
isHierarchicalId(java.lang.String id) |
static void |
resolveCorrelation(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
com.microsoft.applicationinsights.telemetry.RequestTelemetry requestTelemetry)
Resolves correlation ID's by parsing well-known correlation headers in the request.
|
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 |
retrieveApplicationCorrelationId()
Retrieves the appId (in correlation format) for the current active config's instrumentation key.
|
static java.lang.String |
retrieveCorrelationContext()
Retrieves the currently stored correlation context from the request context.
|
public static final java.lang.String CORRELATION_HEADER_NAME
public static final java.lang.String CORRELATION_CONTEXT_HEADER_NAME
public static final java.lang.String REQUEST_CONTEXT_HEADER_NAME
public static final java.lang.String REQUEST_CONTEXT_HEADER_APPID_KEY
public static final java.lang.String REQUEST_CONTEXT_HEADER_ROLENAME_KEY
public static final int REQUESTID_MAXLENGTH
public static void resolveCorrelation(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
com.microsoft.applicationinsights.telemetry.RequestTelemetry requestTelemetry)
request - The servlet request.requestTelemetry - The request telemetry to be populated with correlation ID's.public static java.lang.String generateChildDependencyId()
public static java.lang.String retrieveCorrelationContext()
public static java.lang.String retrieveApplicationCorrelationId()
public static java.lang.String generateChildDependencyTarget(java.lang.String requestContext)
requestContext - - the Request-Context header valuepublic 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 boolean isHierarchicalId(java.lang.String id)