-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
access log: add support for %UPSTREAM_CONNECTION_ID% #31920
access log: add support for %UPSTREAM_CONNECTION_ID% #31920
Conversation
Signed-off-by: deveshkandpal1224 <deveshkandpal1224@gmail.com>
Signed-off-by: deveshkandpal1224 <deveshkandpal1224@gmail.com>
Signed-off-by: deveshkandpal1224 <deveshkandpal1224@gmail.com>
/retest |
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.
Thanks for you contributions. One comment is added.
[](const std::string&, absl::optional<size_t>) { | ||
return std::make_unique<StreamInfoUInt64FormatterProvider>( | ||
[](const StreamInfo::StreamInfo& stream_info) { | ||
return stream_info.upstreamInfo()->upstreamConnectionId().value_or(0); |
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.
if (stream_info.upstreamInfo().has_value()) {
return stream_info.upstreamInfo()->upstreamConnectionId().value_or(0);
}
return 0;
Signed-off-by: deveshkandpal1224 <deveshkandpal1224@gmail.com>
Signed-off-by: deveshkandpal1224 <deveshkandpal1224@gmail.com>
@@ -889,7 +889,11 @@ const StreamInfoFormatterProviderLookupTable& getKnownStreamInfoFormatterProvide | |||
[](const std::string&, absl::optional<size_t>) { | |||
return std::make_unique<StreamInfoUInt64FormatterProvider>( | |||
[](const StreamInfo::StreamInfo& stream_info) { | |||
return stream_info.upstreamInfo()->upstreamConnectionId().value_or(0); | |||
unsigned long result = 0; |
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.
We rarely use the type name unsigned long
, may be uint64_t
would be better here.
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.
@wbpcode - fixed. CI seems to be failing for an unrelated test and I can't seem to restart the test using /retest
. Ran the same failing test locally and its succeeding, so i'm guessing its flaky ?
bazel test //test/extensions/filters/http/alternate_protocols_cache:filter_integration_test
Signed-off-by: deveshkandpal1224 <deveshkandpal1224@gmail.com>
/retest |
Signed-off-by: deveshkandpal1224 <deveshkandpal1224@gmail.com>
Signed-off-by: deveshkandpal1224 <deveshkandpal1224@gmail.com>
Signed-off-by: deveshkandpal1224 <deveshkandpal1224@gmail.com>
/retest |
Signed-off-by: deveshkandpal1224 <deveshkandpal1224@gmail.com>
Signed-off-by: deveshkandpal1224 <deveshkandpal1224@gmail.com>
.. _config_access_log_format_upstream_connection_id: | ||
|
||
%UPSTREAM_CONNECTION_ID% | ||
An identifier for the upstream connection. | ||
|
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.
Thanks for you in timely update 😄 . This LGTM overall. Please supplement more context about the new command in the docs. I think this description should almost same with the CONNECTION_ID
except it's used to tell the upstream connection id.
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.
done :)
/wait |
Signed-off-by: deveshkandpal1224 <deveshkandpal1224@gmail.com>
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. Thanks.
…lows (#35950) Additional Description: The following PR: #31920, added support for ``%UPSTREAM_CONNECTION_ID`` substitution string for access logs. However, it's only supported for HTTP flows. Adding support for UDP and TCP tunneling Risk Level: low Testing: unit tests, integration tests Docs Changes: none Release Notes: none Platform Specific Features: none --------- Signed-off-by: Ohad Vano <ohadvano@gmail.com>
Add support to print
%UPSTREAM_CONNECTION_ID%
in access log. Currently,%CONNECTION_ID%
is supported which prints downstream connection id in access log. Primary motivation for add this is to easily debug reuse of an existing connection while debugging communication between client -> server especially during draining of upstream envoy.Commit Message: Add support for %UPSTREAM_CONNECTION_ID% in access log
Additional Description: Primary motivation for add this is to easily reason reuse of an existing connection while debugging communication between client -> server.
Risk Level: low
Testing: unit testing
Docs Changes: updated
Release Notes: updated