Skip to content

Conversation

@pavolloffay
Copy link
Member

Resolves #310

Signed-off-by: Pavol Loffay <[email protected]>
@pavolloffay pavolloffay requested a review from shashank11p April 22, 2021 13:33
BoundedCharArrayWriter buffer =
InstrumentationContext.get(MultiMap.class, BoundedCharArrayWriter.class)
.get(request.headers());
if (buffer != null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dont we want to check if

(HypertraceConfig.get().getDataCapture().getHttpBody().getRequest().getValue()
          && ContentTypeUtils.shouldCapture(contentType))
          

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't have to check it here bc the buffer is null if the body shouldn't be captured.

buffer = BoundedBuffersFactory.createWriter();
contextStore.put(request.headers(), buffer);
}
buffer.write(chunk);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we calling this here and in EndRequestAdvice both?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, this writes a chunk and in the end method it as well writes a chunk and sends the request.

public void handle(Buffer event) {
String responseBody = event.getString(0, event.length());
if (span.isRecording()) {
span.setAttribute(HypertraceSemanticAttributes.HTTP_RESPONSE_BODY, responseBody);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also check if we should capture response body?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed as this is reached only after the check from the previous instrumentation point.

Signed-off-by: Pavol Loffay <[email protected]>
Signed-off-by: Pavol Loffay <[email protected]>
Signed-off-by: Pavol Loffay <[email protected]>
Signed-off-by: Pavol Loffay <[email protected]>
Signed-off-by: Pavol Loffay <[email protected]>
Signed-off-by: Pavol Loffay <[email protected]>
@pavolloffay pavolloffay merged commit b8e63cf into hypertrace:main Apr 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vertx client instrumentation is broken in 1.1

2 participants