Skip to content

accesslog: Restructure gRPC access log implementation#7730

Merged
mattklein123 merged 6 commits intoenvoyproxy:masterfrom
euroelessar:grpc-access-log-refactor
Jul 29, 2019
Merged

accesslog: Restructure gRPC access log implementation#7730
mattklein123 merged 6 commits intoenvoyproxy:masterfrom
euroelessar:grpc-access-log-refactor

Conversation

@euroelessar
Copy link
Copy Markdown
Contributor

Description:

  • Move messaage construction and stream management to per-thread GrpcAccessLogger object
  • Don't silently ignore config changes and/or loggers with different configs
  • De-duplicate loggers based on the exact protobuf config

Risk Level: MEDIUM (logger rewrite)
Testing: updated unit tests, existing integration tests
Docs Changes: n/a
Release Notes: n/a
Updates #7674

* Move messaage construction and stream management to per-thread GrpcAccessLogger object
* Don't silently ignore config changes and/or loggers with different configs

Signed-off-by: Ruslan Nigmatullin <elessar@dropbox.com>
@mattklein123 mattklein123 self-assigned this Jul 26, 2019
Signed-off-by: Ruslan Nigmatullin <elessar@dropbox.com>
Copy link
Copy Markdown
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.

Thanks, this is great. Flushing out a bunch of comments and then will take another pass.

/wait

}
const Grpc::AsyncClientFactoryPtr factory =
async_client_manager_.factoryForGrpcService(config.grpc_service(), scope_, false);
const auto logger = std::static_pointer_cast<GrpcAccessLogger>(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: you shouldn't need a pointer case here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Used explicit type instead with implicit conversion.

virtual ~GrpcAccessLogStreamer() = default;
virtual ~GrpcAccessLogger() = default;

/**
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please bring back interface doc comments. Also, what's your plan for eventually supporting TCP logs? Presumably just have a separate log message that takes a TCP log?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The plan is to have a separate log method which accepts TCP log.
Most of the log function implementation will be moved to flush in next pull request, so http-specific logic is quite small.

});
}

GrpcAccessLoggerSharedPtr GrpcAccessLoggerCacheImpl::getOrCreateLogger(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Technically, you will never delete loggers that are no longer used. In practice, I don't think this is a real issue, but it's something that I would document in a TODO somewhere.

Ruslan Nigmatullin added 2 commits July 26, 2019 13:36
cr
Signed-off-by: Ruslan Nigmatullin <elessar@dropbox.com>
…-log-refactor

Signed-off-by: Ruslan Nigmatullin <elessar@dropbox.com>
@euroelessar
Copy link
Copy Markdown
Contributor Author

@mattklein123 I believe comments are addressed, can you have another look, please?

@mattklein123
Copy link
Copy Markdown
Member

@euroelessar PTAL at clang-tidy CI

Signed-off-by: Ruslan Nigmatullin <elessar@dropbox.com>
@euroelessar
Copy link
Copy Markdown
Contributor Author

Oh, fair, thanks, updated.

Signed-off-by: Ruslan Nigmatullin <elessar@dropbox.com>
@mattklein123
Copy link
Copy Markdown
Member

/azp run envoy-macos

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Copy Markdown
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.

Thank you!

@mattklein123 mattklein123 merged commit a609257 into envoyproxy:master Jul 29, 2019
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