-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Add ExtProc Logging Bits for Immediate Response, Continue and Replace #41602
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
base: main
Are you sure you want to change the base?
Changes from 16 commits
24f4ffa
99fe980
88f22ba
771a10f
169a016
493ca5e
ac73fc1
90801e8
eee4503
4793698
6b0269b
616f481
662e55b
2b6b8bc
d69b7c2
d1d97e1
a88b4ba
8a0fc73
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -89,13 +89,16 @@ class ExtProcLoggingInfo : public Envoy::StreamInfo::FilterState::Object { | |
| std::unique_ptr<GrpcCall> header_stats_; | ||
| std::unique_ptr<GrpcCall> trailer_stats_; | ||
| std::unique_ptr<GrpcCallBody> body_stats_; | ||
| bool continue_and_replace_; | ||
| }; | ||
|
|
||
| using GrpcCalls = struct GrpcCallStats; | ||
|
|
||
| void recordGrpcCall(std::chrono::microseconds latency, Grpc::Status::GrpcStatus call_status, | ||
| ProcessorState::CallbackState callback_state, | ||
| envoy::config::core::v3::TrafficDirection traffic_direction); | ||
| envoy::config::core::v3::TrafficDirection traffic_direction, | ||
| bool continue_and_replace = false); | ||
| void setImmediateResponse() { immediate_response_ = true; } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe change this into setImmediateResponse(bool immediate_response) {immediate_response_ = immediate_response; } ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Personally, I like it it the way it is. Since the default value is false when the variable is created ext_proc.h L 151 (https://github.com/envoyproxy/envoy/pull/41602/files#diff-d95000cdea207e2cf306d30b1706750b57a8228c25f01b0f8b4df0f22bf033c7R151) I think it makes more sense that "set" implies you are changing the value to true. However, this is not a very strong opinion and I am happy to make the change if you feel strongly it should take in a variable.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just thought do you ever need to call setImmediateResponse() to set it to false. Small thing, up to you |
||
| void setBytesSent(uint64_t bytes_sent) { bytes_sent_ = bytes_sent; } | ||
| void setBytesReceived(uint64_t bytes_received) { bytes_received_ = bytes_received; } | ||
| void setClusterInfo(absl::optional<Upstream::ClusterInfoConstSharedPtr> cluster_info) { | ||
|
|
@@ -134,8 +137,8 @@ class ExtProcLoggingInfo : public Envoy::StreamInfo::FilterState::Object { | |
|
|
||
| private: | ||
| GrpcCalls& grpcCalls(envoy::config::core::v3::TrafficDirection traffic_direction); | ||
| GrpcCalls decoding_processor_grpc_calls_; | ||
| GrpcCalls encoding_processor_grpc_calls_; | ||
| GrpcCalls decoding_processor_grpc_calls_{}; | ||
| GrpcCalls encoding_processor_grpc_calls_{}; | ||
| const Envoy::Protobuf::Struct filter_metadata_; | ||
| // The following stats are populated for ext_proc filters using Envoy gRPC only. | ||
| // The bytes sent and received are for the entire stream. | ||
|
|
@@ -144,6 +147,8 @@ class ExtProcLoggingInfo : public Envoy::StreamInfo::FilterState::Object { | |
| Upstream::HostDescriptionConstSharedPtr upstream_host_; | ||
| // The status details of the underlying HTTP/2 stream. Envoy gRPC only. | ||
| std::string http_response_code_details_; | ||
| // True if an immediate response is sent. | ||
| bool immediate_response_{false}; | ||
| }; | ||
|
|
||
| class ThreadLocalStreamManager; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.