FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Instrument vertx client directly by pavolloffay · Pull Request #311 · hypertrace/javaagent · GitHub

Instrument vertx client directly - #311

Merged
pavolloffay merged 8 commits into
hypertrace:mainfrom
pavolloffay:vertx-web-fix
Apr 23, 2021
Merged

Instrument vertx client directly#311
pavolloffay merged 8 commits into
hypertrace:mainfrom
pavolloffay:vertx-web-fix

Conversation

Copy link
Copy Markdown
Member

Resolves #310

Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Dont we want to check if

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Why are we calling this here and in EndRequestAdvice both?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Should we also check if we should capture response body?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
pavolloffay merged commit b8e63cf into hypertrace:main Apr 23, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL