Skip to content
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

router: implement upstream log #1986

Merged
merged 4 commits into from
Nov 3, 2017

Conversation

zuercher
Copy link
Member

@zuercher zuercher commented Nov 1, 2017

Description:

Adds support for the upstream_log field of the v2 API's Router HTTP filter. The upstream log reuses the existing access log code for configuring and generating logs. The feature is enabled by adding the appropriate log file configuration to the Router object in the v2 API only.

Closes #1927.

API Change: envoyproxy/data-plane-api#211

Risk Level: Medium -- adds code to a heavily used filter.

Testing:
Unit tests to verify that logs are generated when expected and disabled by default.
Additional manual testing with parallel requests.

Release Notes:
Note that api.http.filter.Router upstream_log configuration point is available for use.

Signed-off-by: Stephan Zuercher <stephan@turbinelabs.io>
Signed-off-by: Stephan Zuercher <stephan@turbinelabs.io>
Signed-off-by: Stephan Zuercher <stephan@turbinelabs.io>
@mattklein123
Copy link
Member

@rshriram I'm just going to go ahead and review this, but it would be nice if we could land #1982

Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

This is really neat. Ultimately I think we will want to add other things in here. For example retry count, etc. But this is a great start. Code looks great also per usual. Thanks a lot for putting the tests in a new file since the other one is already huge. Just one small nit that I see. Also, we will need to fix up the docs for access logging in general when we turn on the v2 docs. I guess initially we can just ref back to v1 docs for format info. cc @htuch

config.start_child_span()) {
for (const auto& upstream_log : config.upstream_log()) {
Http::AccessLog::InstanceSharedPtr current_upstream_log =
Http::AccessLog::AccessLogFactory::fromProto(upstream_log, context);
Copy link
Member

Choose a reason for hiding this comment

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

nit: just fold this into the next line

const std::string& stat_prefix,
FactoryContext& context) override;

ProtobufTypes::MessagePtr createEmptyConfigProto() override {
Copy link
Member

Choose a reason for hiding this comment

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

I think this PR has the same issue as @rshriram PR in that this path actually isn't tested. I think he can fix in his other PR since we need to do it for all filters. @htuch not sure if you have any thoughts on how best to test generically.

Signed-off-by: Stephan Zuercher <stephan@turbinelabs.io>
@mattklein123 mattklein123 merged commit 975cbe8 into envoyproxy:master Nov 3, 2017
@zuercher zuercher deleted the implement-upstream-log branch December 8, 2017 18:27
rshriram pushed a commit to rshriram/envoy that referenced this pull request Oct 30, 2018
jpsim pushed a commit that referenced this pull request Nov 28, 2022
Signed-off-by: Jose Nino <jnino@lyft.com>
Signed-off-by: JP Simard <jp@jpsim.com>
jpsim pushed a commit that referenced this pull request Nov 29, 2022
Signed-off-by: Jose Nino <jnino@lyft.com>
Signed-off-by: JP Simard <jp@jpsim.com>
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.

2 participants