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);
}
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);
}
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);
}
Aggregations