Extract request info to a class#2615
Closed
bianpengyuan wants to merge 1 commit intoistio:masterfrom
Closed
Conversation
Contributor
Author
|
@mandarjog @kyessenov May I get some feedback on this? This is more like an intermediate state before CEL is added. Without this, log will be useless since not enough information is fetched from host. |
Contributor
Author
mandarjog
reviewed
Jan 14, 2020
| namespace { | ||
|
|
||
| // Extract service name from service host. | ||
| void extractServiceName(const std::string& host, |
Contributor
There was a problem hiding this comment.
Is this new code or only moved around?
mandarjog
reviewed
Jan 14, 2020
| } | ||
|
|
||
| const std::string& RequestInfoImpl::urlPath() { | ||
| if (!request_info_.has_url_path()) { |
Contributor
There was a problem hiding this comment.
What is this call fails?
mandarjog
reviewed
Jan 14, 2020
| return; | ||
| } | ||
|
|
||
| auto namespace_pos = host.find_first_of(".:", name_pos + 1); |
Contributor
There was a problem hiding this comment.
Can you add low level unit tests for request_info.cc?
Which part specifically fix the SD log correlation issues?
Contributor
Author
|
Superseded by #2625 |
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extract out request info to a separate class, which lazily load request attributes. It uses a request info proto to cache the attributes that are already fetched from host. This is to avoid unnecessary copy if some filters want to use a subset of attributes. This change also added some attributes that are useful for access logging. The request info protocol does not schematize any thing. It is just an internal proto to keep track of fetched attributes.
To minimize the diff, this code change has some duplicated code from context.cc. �They will be cleaned up when real usage is added. Usage of this class is like master...bianpengyuan:n