/** * Constructs new RequestTelemetryContext object. * @param ticks The time in ticks * @param servletRequest The servlet request */ public RequestTelemetryContext(long ticks, HttpServletRequest servletRequest) { requestTelemetry = new RequestTelemetry(); requestStartTimeTicks = ticks; this.servletRequest = servletRequest; correlationContext = new CorrelationContext(); }
currentCorrelationContext.append(baggage); Map<String, String> propertyBag = getPropertyBag(baggage); currentCorrelationContext.getMappings().putAll(propertyBag); requestTelemetry.getProperties().putAll(propertyBag);
/** * Retrieves the currently stored correlation context from the request context. * @return The correlation context as a string. */ public static String retrieveCorrelationContext() { //check if context is null - no correlation will happen if (ThreadContext.getRequestTelemetryContext() == null) { InternalLogger.INSTANCE.warn("No correlation wil happen, Thread context is null"); return ""; } CorrelationContext context = ThreadContext.getRequestTelemetryContext().getCorrelationContext(); return context.toString(); }
Map<String, String> correlationContextMap = telemetryContext.getCorrelationContext().getMappings(); for (String key : correlationContextMap.keySet()) { if (telemetry.getProperties().get(key) == null) {
currentCorrelationContext.append(baggage); Map<String, String> propertyBag = getPropertyBag(baggage); currentCorrelationContext.getMappings().putAll(propertyBag); requestTelemetry.getProperties().putAll(propertyBag);
/** * Retrieves the currently stored correlation context from the request context. * @return The correlation context as a string. */ public static String retrieveCorrelationContext() { //check if context is null - no correlation will happen if (ThreadContext.getRequestTelemetryContext() == null) { InternalLogger.INSTANCE.warn("No correlation wil happen, Thread context is null"); return ""; } CorrelationContext context = ThreadContext.getRequestTelemetryContext().getCorrelationContext(); return context.toString(); }
Map<String, String> correlationContextMap = telemetryContext.getCorrelationContext().getMappings(); for (String key : correlationContextMap.keySet()) { if (telemetry.getProperties().get(key) == null) {
/** * Constructs new RequestTelemetryContext object. * @param ticks The time in ticks * @param servletRequest The servlet request */ public RequestTelemetryContext(long ticks, HttpServletRequest servletRequest) { requestTelemetry = new RequestTelemetry(); requestStartTimeTicks = ticks; this.servletRequest = servletRequest; correlationContext = new CorrelationContext(); }