-
Notifications
You must be signed in to change notification settings - Fork 927
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide a way to access a parent log from a child log #2599
Conversation
Motivation: `RequestId` is used for tracking the request and the response pair. A request can be executed multiple times by `RetryingClient`. It is difficult to group and trace all retried requests without the request ID of the original request. By accessing the parent log from the current request context, we are able to log the parent and current request ID pair. Modifications: - Add `parent()` to `RequestLogAccess` - Include the request ID of parent to `toString()` Results: - You can now access a parent log from a child log. - `DefaultClientRequest.toString()` contains a parent request ID if available. - Fixes line#2588
core/src/main/java/com/linecorp/armeria/client/ClientRequestContextWrapper.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/common/logging/DefaultRequestLog.java
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/client/DefaultClientRequestContext.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once @trustin's comments are addressed.
core/src/main/java/com/linecorp/armeria/client/DefaultClientRequestContext.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/client/DefaultClientRequestContext.java
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #2599 +/- ##
============================================
- Coverage 73.34% 73.32% -0.03%
+ Complexity 11049 11043 -6
============================================
Files 970 971 +1
Lines 42523 42527 +4
Branches 5294 5300 +6
============================================
- Hits 31188 31181 -7
- Misses 8625 8633 +8
- Partials 2710 2713 +3 Continue to review full report at Codecov.
|
Thanks a lot, @ikhoon ! |
Thanks for reviewing! |
Motivation: `RequestId` is used for tracking the request and the response pair. A request can be executed multiple times by `RetryingClient`. It is difficult to group and trace all retried requests without the request ID of the original request. By accessing the parent log from the current request context, we are able to log the parent and current request ID pair. Modifications: - Add `parent()` to `RequestLogAccess` - Include the request ID of parent to `toString()` Results: - You can now access a parent log from a child log. - `DefaultClientRequest.toString()` contains a parent request ID if available. - Fixes line#2588
Motivation:
RequestId
is used for tracking the request and the response pair.A request can be executed multiple times by
RetryingClient
.It is difficult to group and trace all retried requests without the request ID of the original request.
By accessing the parent log from the current request context, we are able to log the parent and current request ID pair.
Modifications:
parent()
toRequestLogAccess
toString()
inDefaultClientRequestContext
Results:
DefaultClientRequest.toString()
contains a parent request ID if available.