Fix an error status bug in the httpasyncclient plugin (#608)
Co-authored-by: 刘颖 <liuying03196@51shebao.com>
This commit is contained in:
parent
922a5001fa
commit
6f80861657
|
|
@ -8,6 +8,7 @@ Release Notes.
|
|||
* Fix hbase onConstruct NPE in the file configuration scenario
|
||||
* Fix the issue of createSpan failure caused by invalid request URL in HttpClient 4.x/5.x plugin
|
||||
* Optimize ElasticSearch 6.x 7.x plugin compatibility
|
||||
* Fix an issue with the httpasyncclient component where the isError state is incorrect.
|
||||
|
||||
#### Documentation
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ public class HttpAsyncResponseConsumerWrapper<T> implements HttpAsyncResponseCon
|
|||
public void responseReceived(HttpResponse response) throws IOException, HttpException {
|
||||
if (ContextManager.isActive()) {
|
||||
int statusCode = response.getStatusLine().getStatusCode();
|
||||
AbstractSpan span = ContextManager.activeSpan().errorOccurred();
|
||||
AbstractSpan span = ContextManager.activeSpan();
|
||||
Tags.HTTP_RESPONSE_STATUS_CODE.set(span, statusCode);
|
||||
if (statusCode >= 400) {
|
||||
span.errorOccurred();
|
||||
|
|
|
|||
|
|
@ -348,6 +348,7 @@ public class HttpAsyncClientInterceptorTest {
|
|||
assertThat(tags.get(0).getValue(), is("http://localhost:8081/original/test"));
|
||||
assertThat(tags.get(1).getValue(), is("GET"));
|
||||
assertThat(tags.get(2).getValue(), is("a=1&b=test"));
|
||||
assertThat(span.transform().getIsError(), is(false));
|
||||
assertThat(span.isExit(), is(true));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ segmentItems:
|
|||
startTime: nq 0
|
||||
endTime: nq 0
|
||||
componentId: 26
|
||||
isError: true
|
||||
isError: false
|
||||
spanType: Exit
|
||||
peer: 127.0.0.1:8080
|
||||
tags:
|
||||
|
|
|
|||
Loading…
Reference in New Issue