Skip to content

Commit

Permalink
chore: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
baywet committed May 21, 2024
1 parent 37cf2a7 commit 93c51f5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -723,11 +723,10 @@ private Response getHttpResponseMessage(
spanForAttributes.setAttribute(
EXPERIMENTAL_HTTP_RESPONSE_BODY_SIZE, contentLengthHeaderValueAsLong);
}
final String contentTypeHeaderValue =
getHeaderValue(response, CONTENT_TYPE_HEADER_KEY);
final String contentTypeHeaderValue = getHeaderValue(response, CONTENT_TYPE_HEADER_KEY);
if (contentTypeHeaderValue != null && !contentTypeHeaderValue.isEmpty()) {
spanForAttributes.setAttribute(
CUSTOM_HTTP_RESPONSE_CONTENT_TYPE, contentTypeHeaderValue);
CUSTOM_HTTP_RESPONSE_CONTENT_TYPE, contentTypeHeaderValue);
}
spanForAttributes.setAttribute(HTTP_RESPONSE_STATUS_CODE, response.code());
spanForAttributes.setAttribute(
Expand Down Expand Up @@ -895,7 +894,7 @@ public MediaType contentType() {
final String contentType =
contentTypes.toArray(new String[] {})[0];
spanForAttributes.setAttribute(
CUSTOM_HTTP_REQUEST_CONTENT_TYPE, contentType);
CUSTOM_HTTP_REQUEST_CONTENT_TYPE, contentType);
return MediaType.parse(contentType);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ private TelemetrySemanticConventions() {}
public static final AttributeKey<Long> EXPERIMENTAL_HTTP_REQUEST_BODY_SIZE =
longKey("http.request.body.size"); // experimental

public static final AttributeKey<String> CUSTOM_HTTP_RESPONSE_CONTENT_TYPE = stringKey("http.response_content_type"); // custom
public static final AttributeKey<String> CUSTOM_HTTP_REQUEST_CONTENT_TYPE = stringKey("http.request_content_type"); // custom
public static final AttributeKey<String> CUSTOM_HTTP_RESPONSE_CONTENT_TYPE =
stringKey("http.response_content_type"); // custom
public static final AttributeKey<String> CUSTOM_HTTP_REQUEST_CONTENT_TYPE =
stringKey("http.request_content_type"); // custom
}

0 comments on commit 93c51f5

Please sign in to comment.