Search in sources :

Example 1 with HttpStatusCodeErrors

use of com.navercorp.pinpoint.bootstrap.config.HttpStatusCodeErrors in project pinpoint by naver.

the class ServletResponseListenerBuilder method build.

public ServletResponseListener<RESP> build() {
    HttpStatusCodeRecorder httpStatusCodeRecorder;
    if (httpStatusCodeErrors == null) {
        HttpStatusCodeErrors httpStatusCodeErrors = new HttpStatusCodeErrors(Collections.<String>emptyList());
        httpStatusCodeRecorder = new HttpStatusCodeRecorder(httpStatusCodeErrors);
    } else {
        httpStatusCodeRecorder = new HttpStatusCodeRecorder(httpStatusCodeErrors);
    }
    return new ServletResponseListener<>(traceContext, newServerResponseHeaderRecorder(), httpStatusCodeRecorder);
}
Also used : HttpStatusCodeErrors(com.navercorp.pinpoint.bootstrap.config.HttpStatusCodeErrors) HttpStatusCodeRecorder(com.navercorp.pinpoint.bootstrap.plugin.http.HttpStatusCodeRecorder)

Example 2 with HttpStatusCodeErrors

use of com.navercorp.pinpoint.bootstrap.config.HttpStatusCodeErrors in project pinpoint by naver.

the class ServletRequestListenerBuilder method build.

public ServletRequestListener<REQ> build() {
    RequestAdaptor<REQ> requestAdaptor = RemoteAddressResolverFactory.wrapRealIpSupport(this.requestAdaptor, realIpHeader, realIpEmptyValue);
    RequestTraceReader<REQ> requestTraceReader = new RequestTraceReader<>(traceContext, requestAdaptor, true);
    ProxyRequestRecorder<REQ> proxyRequestRecorder;
    if (requestRecorderFactory == null) {
        proxyRequestRecorder = new DisableRequestRecorder<>();
    } else {
        proxyRequestRecorder = requestRecorderFactory.getProxyRequestRecorder(requestAdaptor);
    }
    Filter<String> excludeUrlFilter = newExcludeUrlFilter(this.excludeUrlFilter);
    final ServerRequestRecorder<REQ> serverRequestRecorder = newServerRequestRecorder(requestAdaptor);
    ParameterRecorder<REQ> parameterRecorder = newParameterRecorder();
    // not general api : http??
    HttpStatusCodeRecorder httpStatusCodeRecorder;
    if (httpStatusCodeErrors == null) {
        HttpStatusCodeErrors httpStatusCodeErrors = new HttpStatusCodeErrors(Collections.<String>emptyList());
        httpStatusCodeRecorder = new HttpStatusCodeRecorder(httpStatusCodeErrors);
    } else {
        httpStatusCodeRecorder = new HttpStatusCodeRecorder(httpStatusCodeErrors);
    }
    return new ServletRequestListener<>(serviceType, traceContext, requestAdaptor, requestTraceReader, excludeUrlFilter, parameterRecorder, proxyRequestRecorder, serverRequestRecorder, httpStatusCodeRecorder, uriStatRecorder, recordStatusCode);
}
Also used : HttpStatusCodeErrors(com.navercorp.pinpoint.bootstrap.config.HttpStatusCodeErrors) HttpStatusCodeRecorder(com.navercorp.pinpoint.bootstrap.plugin.http.HttpStatusCodeRecorder)

Example 3 with HttpStatusCodeErrors

use of com.navercorp.pinpoint.bootstrap.config.HttpStatusCodeErrors in project pinpoint by naver.

the class HttpStatusCodeRecorderTest method record.

@Test
public void record() throws Exception {
    final SpanRecorder spanRecorder = mock(SpanRecorder.class);
    HttpStatusCodeErrors errors = new HttpStatusCodeErrors(Arrays.asList("5xx", "401", "402"));
    HttpStatusCodeRecorder recorder = new HttpStatusCodeRecorder(errors);
    recorder.record(spanRecorder, 500);
    recorder.record(spanRecorder, 200);
    recorder.record(spanRecorder, 404);
    // illegal argument.
    recorder.record(null, 500);
    recorder.record(spanRecorder, 0);
    recorder.record(spanRecorder, -1);
    recorder.record(spanRecorder, 999);
}
Also used : SpanRecorder(com.navercorp.pinpoint.bootstrap.context.SpanRecorder) HttpStatusCodeErrors(com.navercorp.pinpoint.bootstrap.config.HttpStatusCodeErrors) Test(org.junit.Test)

Aggregations

HttpStatusCodeErrors (com.navercorp.pinpoint.bootstrap.config.HttpStatusCodeErrors)3 HttpStatusCodeRecorder (com.navercorp.pinpoint.bootstrap.plugin.http.HttpStatusCodeRecorder)2 SpanRecorder (com.navercorp.pinpoint.bootstrap.context.SpanRecorder)1 Test (org.junit.Test)1