Skip to content

grpc: adding limits to outbound buffered data for google-gRPC access logs#11072

Merged
htuch merged 6 commits intoenvoyproxy:masterfrom
alyssawilk:grpc_async
May 12, 2020
Merged

grpc: adding limits to outbound buffered data for google-gRPC access logs#11072
htuch merged 6 commits intoenvoyproxy:masterfrom
alyssawilk:grpc_async

Conversation

@alyssawilk
Copy link
Copy Markdown
Contributor

Risk Level: Medium (changes by default)
Testing: new unit tests, new guard also tested
Docs Changes: n/a
Release Notes: yes
Optional Runtime guard: envoy.reloadable_features.allow_unbounded_access_logs
[Optional Fixes #Issue]
Fixes #10764

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
@repokitteh-read-only
Copy link
Copy Markdown

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to api/.
CC @envoyproxy/api-watchers: FYI only for changes made to api/.

🐱

Caused by: #11072 was opened by alyssawilk.

see: more, trace.

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Copy link
Copy Markdown
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

Great, short and elegant!


* access loggers: added GRPC_STATUS operator on logging format.
* access loggers: applied existing buffer limits to the non-google gRPC access logs, as well as :ref:`stats <config_access_log_stats>` for logged / dropped logs.
* access loggers: applied existing buffer limits to access logs, as well as :ref:`stats <config_access_log_stats>` for logged / dropped logs. This can be reverted temporarily by setting runtime feature `envoy.reloadable_features.allow_unbounded_access_logs` to false.
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.

Should this be true? I.e. if we're adding default limits, do allow unbounded logs we should set that to true?

initial_metadata_(config.initial_metadata()), scope_(scope) {
initial_metadata_(config.initial_metadata()), scope_(scope),
per_stream_buffer_limit_bytes_(PROTOBUF_GET_WRAPPED_OR_DEFAULT(
config.google_grpc(), per_stream_buffer_limit_bytes, 1024 * 1024)) {
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: maybe make this a named constant.

alyssawilk added 3 commits May 6, 2020 13:03
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
@alyssawilk
Copy link
Copy Markdown
Contributor Author

Should be merged up again. PTAL when you get a chance.

// gRPC library.
google.protobuf.Struct config = 6;

// How many bytes each steam can buffer internally.
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: s/steam/stream/g

TestUtility::findCounter(stats_store_, "access_logs.grpc_access_log.logs_dropped")->value());
}

TEST_F(GrpcAccessLoggerImplTest, WatermarksLegacy) {
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.

Why is this called legacy? Can you add a one liner // above this test to explain what it does?

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Copy link
Copy Markdown
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

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.

access log: grpc access log grows unboundly if backend is slow

2 participants