-
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
accesslog: implement TCP gRPC access logger #7941
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
3973210
accesslog: implement TCP gRPC access logger
lizan 9859e92
dedup test
lizan 3b19dee
doc, format
lizan b10b4f4
spell
lizan 0b9937e
fix test
lizan 24a4f03
fix
lizan f64a630
comment
lizan 6920deb
forget to save
lizan 0be589b
comments
lizan 41f6fd9
fix comment
lizan b620d54
Merge remote-tracking branch 'upstream/master' into tcp_grpc_als
lizan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include "extensions/access_loggers/grpc/config_utils.h" | ||
|
||
#include "envoy/singleton/manager.h" | ||
|
||
namespace Envoy { | ||
namespace Extensions { | ||
namespace AccessLoggers { | ||
namespace GrpcCommon { | ||
|
||
// Singleton registration via macro defined in envoy/singleton/manager.h | ||
SINGLETON_MANAGER_REGISTRATION(grpc_access_logger_cache); | ||
|
||
std::shared_ptr<GrpcCommon::GrpcAccessLoggerCache> | ||
getGrpcAccessLoggerCacheSingleton(Server::Configuration::FactoryContext& context) { | ||
return context.singletonManager().getTyped<GrpcCommon::GrpcAccessLoggerCache>( | ||
SINGLETON_MANAGER_REGISTERED_NAME(grpc_access_logger_cache), [&context] { | ||
return std::make_shared<GrpcCommon::GrpcAccessLoggerCacheImpl>( | ||
context.clusterManager().grpcAsyncClientManager(), context.scope(), | ||
context.threadLocal(), context.localInfo()); | ||
}); | ||
} | ||
} // namespace GrpcCommon | ||
} // namespace AccessLoggers | ||
} // namespace Extensions | ||
} // namespace Envoy |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#pragma once | ||
|
||
#include "envoy/server/filter_config.h" | ||
|
||
#include "extensions/access_loggers/grpc/grpc_access_log_impl.h" | ||
|
||
namespace Envoy { | ||
namespace Extensions { | ||
namespace AccessLoggers { | ||
namespace GrpcCommon { | ||
|
||
GrpcAccessLoggerCacheSharedPtr | ||
getGrpcAccessLoggerCacheSingleton(Server::Configuration::FactoryContext& context); | ||
|
||
} // namespace GrpcCommon | ||
} // namespace AccessLoggers | ||
} // namespace Extensions | ||
} // namespace Envoy |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.
Have we thought at all about incremental logging for long-lived TCP streams? I realize this is also an issue for long-lived HTTP sessions, just curious what the long-term direction is going to be 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.
Istio would find this quite useful. Currently, we run a timer and report on connection open/close/timer-firing. I think this might need a change in the filter API though (something like
onRecurrentLog
with a customizable interval). This is also super-useful for bi-di gRPC like xDS.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.
Yes I thought about the incremental logging when I added implementation of this, though that is orthogonal to this PR. And it requires invasive change to
AccessLog
interface and logging points. So I think it worth another issue and should be addressed separately.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.
Can you file some tracking issue for this? Thanks.
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.
#7964