File tree Expand file tree Collapse file tree 2 files changed +2
-0
lines changed
main/java/com/google/api/client/http
test/java/com/google/api/client/http Expand file tree Collapse file tree 2 files changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -1012,6 +1012,7 @@ public HttpResponse execute() throws IOException {
1012
1012
LowLevelHttpResponse lowLevelHttpResponse = lowLevelHttpRequest .execute ();
1013
1013
if (lowLevelHttpResponse != null ) {
1014
1014
OpenCensusUtils .recordReceivedMessageEvent (span , lowLevelHttpResponse .getContentLength ());
1015
+ span .putAttribute (HttpTraceAttributeConstants .HTTP_STATUS_CODE , AttributeValue .longAttributeValue (lowLevelHttpResponse .getStatusCode ()));
1015
1016
}
1016
1017
// Flag used to indicate if an exception is thrown before the response is constructed.
1017
1018
boolean responseConstructed = false ;
Original file line number Diff line number Diff line change @@ -80,6 +80,7 @@ public void executeCreatesSpan() throws IOException {
80
80
assertAttributeEquals (span , "http.host" , "google.com" );
81
81
assertAttributeEquals (span , "http.url" , "https://google.com/" );
82
82
assertAttributeEquals (span , "http.method" , "GET" );
83
+ assertAttributeEquals (span , "http.status_code" , "200" );
83
84
84
85
// Ensure we have a single annotation for starting the first attempt
85
86
assertEquals (1 , span .getAnnotations ().getEvents ().size ());
You can’t perform that action at this time.
0 commit comments