-
Notifications
You must be signed in to change notification settings - Fork 5.3k
quic: deferred logging of roundtrip response time #23648
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
Changes from all commits
e8a80ff
dd13f85
bebc3a2
a13b24f
ed44a5e
b9d9c14
e9da2a2
002cd98
4b2abad
e04f8ce
b63b4e0
acb45ba
3ba2841
c28cebf
888818c
7564cf0
d512366
3108180
33275d0
a605ccf
423b984
46aa544
c7bc1ac
d03985d
8424a37
21c64f6
51f2123
b5771a5
3ba8d59
d29a9b9
a3e30ca
e1490c7
c55f5b8
ca4d8f5
33e3be5
2b228cf
63205e5
9b31dcd
8257a37
f5f469f
613f1c3
8fc0384
826b143
148e199
f19f6f2
479f2b1
9faa827
39d9c7a
154ca1b
ecbb802
5b0aca1
82efea7
7c65613
fc87b2e
db5fe39
f3817ca
6ed652e
22b72f5
26f3cf4
fa2ddad
763f0b6
4dda7d1
e870fb9
fb91bee
0182d16
91e8aee
82096d6
4579a5a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -192,7 +192,7 @@ class ConnectionManagerImpl : Logger::Loggable<Logger::Id::http>, | |||
| void maybeEndDecode(bool end_stream); | ||||
|
|
||||
| // Http::RequestDecoder | ||||
| void decodeHeaders(RequestHeaderMapPtr&& headers, bool end_stream) override; | ||||
| void decodeHeaders(RequestHeaderMapSharedPtr&& headers, bool end_stream) override; | ||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this interface change needed? It can take a unique_ptr and store the pointee in a shared_ptr.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed that keeping the interface unchanged is preferable. I tried changing the interface back to accept a unique ptr, and leaving the member variable as a shared ptr, but ran into the problem that in ActiveStream::RecreateStream we call decodeHeaders on the request_headers_ member variable: envoy/source/common/http/conn_manager_impl.cc Line 1788 in 3752119
|
||||
| void decodeTrailers(RequestTrailerMapPtr&& trailers) override; | ||||
| StreamInfo::StreamInfo& streamInfo() override { return filter_manager_.streamInfo(); } | ||||
| void sendLocalReply(Code code, absl::string_view body, | ||||
|
|
@@ -201,6 +201,20 @@ class ConnectionManagerImpl : Logger::Loggable<Logger::Id::http>, | |||
| absl::string_view details) override { | ||||
| return filter_manager_.sendLocalReply(code, body, modify_headers, grpc_status, details); | ||||
| } | ||||
| std::list<AccessLog::InstanceSharedPtr> accessLogHandlers() override { | ||||
| return filter_manager_.accessLogHandlers(); | ||||
| } | ||||
| // Hand off headers/trailers and stream info to the codec's response encoder, for logging later | ||||
| // (i.e. possibly after this stream has been destroyed). | ||||
| // | ||||
| // TODO(paulsohn): Investigate whether we can move the headers/trailers and stream info required | ||||
| // for logging instead of copying them (as is currently done in the HTTP/3 implementation) or | ||||
| // using a shared pointer. See | ||||
| // https://github.com/envoyproxy/envoy/pull/23648#discussion_r1066095564 for more details. | ||||
| void deferHeadersAndTrailers() { | ||||
| response_encoder_->setDeferredLoggingHeadersAndTrailers(request_headers_, response_headers_, | ||||
| response_trailers_, streamInfo()); | ||||
| } | ||||
|
|
||||
| // ScopeTrackedObject | ||||
| void dumpState(std::ostream& os, int indent_level = 0) const override { | ||||
|
|
@@ -371,12 +385,12 @@ class ConnectionManagerImpl : Logger::Loggable<Logger::Id::http>, | |||
| // both locations, then refer to the FM when doing stream logs. | ||||
| const uint64_t stream_id_; | ||||
|
|
||||
| RequestHeaderMapPtr request_headers_; | ||||
| RequestHeaderMapSharedPtr request_headers_; | ||||
| RequestTrailerMapPtr request_trailers_; | ||||
|
|
||||
| ResponseHeaderMapPtr informational_headers_; | ||||
| ResponseHeaderMapPtr response_headers_; | ||||
| ResponseTrailerMapPtr response_trailers_; | ||||
| ResponseHeaderMapSharedPtr response_headers_; | ||||
| ResponseTrailerMapSharedPtr response_trailers_; | ||||
|
|
||||
| // Note: The FM must outlive the above headers, as they are possibly accessed during filter | ||||
| // destruction. | ||||
|
|
||||
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.
A drive-by comment:
Should this return a reference to the list?
Additionally, should this be const?
Looking at the uses of this method below I think the answer to the above 2 questions may be yes, and may avoid unnecessary copies.