Skip to content

Commit 9369e85

Browse files
committed
fixed how request content length is populated
1 parent 0538c07 commit 9369e85

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

java-bigquery/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/telemetry/HttpTracingRequestInitializer.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,7 @@ private static void addCommonResponseAttributesToSpan(
121121

122122
static void addRequestBodySizeToSpan(HttpRequest request, Span span) {
123123
try {
124-
long contentLength = request.getContent().getLength();
125-
if (contentLength > 0) {
126-
span.setAttribute(HTTP_REQUEST_BODY_SIZE, contentLength);
127-
}
124+
span.setAttribute(HTTP_REQUEST_BODY_SIZE, request.getContent().getLength());
128125
} catch (Exception e) {
129126
// Ignore - body size not available
130127
}
@@ -135,5 +132,6 @@ static void addResponseBodySizeToSpan(HttpResponse response, Span span) {
135132
if (contentLength != null && contentLength > 0) {
136133
span.setAttribute(HTTP_RESPONSE_BODY_SIZE, contentLength);
137134
}
135+
// TODO handle chunked responses
138136
}
139137
}

0 commit comments

Comments
 (0)