Search in sources :

Example 1 with Header

use of com.navercorp.pinpoint.bootstrap.context.Header in project pinpoint by naver.

the class HttpRequestExecutorExecuteMethodInterceptor method recordCookie.

protected void recordCookie(HttpMessage httpMessage, Trace trace) {
    org.apache.http.Header[] cookies = httpMessage.getHeaders("Cookie");
    for (org.apache.http.Header header : cookies) {
        final String value = header.getValue();
        if (value != null && !value.isEmpty()) {
            if (cookieSampler.isSampling()) {
                final SpanEventRecorder recorder = trace.currentSpanEventRecorder();
                recorder.recordAttribute(AnnotationKey.HTTP_COOKIE, StringUtils.abbreviate(value, 1024));
            }
            // PMD complains if we use break here
            return;
        }
    }
}
Also used : Header(com.navercorp.pinpoint.bootstrap.context.Header) SpanEventRecorder(com.navercorp.pinpoint.bootstrap.context.SpanEventRecorder)

Aggregations

Header (com.navercorp.pinpoint.bootstrap.context.Header)1 SpanEventRecorder (com.navercorp.pinpoint.bootstrap.context.SpanEventRecorder)1