Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions extensions/common/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ constexpr std::string_view kClose = "CLOSE";
std::string_view AuthenticationPolicyString(ServiceAuthenticationPolicy policy);
std::string_view TCPConnectionStateString(TCPConnectionState state);

// None response flag.
const std::string NONE = "-";

// RequestInfo represents the information collected from filter stream
// callbacks. This is used to fill metrics and logs.
struct RequestInfo {
Expand Down
5 changes: 3 additions & 2 deletions extensions/common/util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

#include <string>

#include "extensions/common/context.h"

namespace Wasm {
namespace Common {

Expand All @@ -24,7 +26,6 @@ namespace {
// access API does not support returning response flags as a short string since
// it is not owned by any object and always generated on demand:
// https://github.com/envoyproxy/envoy/blob/v1.12.0/source/common/stream_info/utility.cc#L8
const std::string NONE = "-";
const std::string DOWNSTREAM_CONNECTION_TERMINATION = "DC";
const std::string FAILED_LOCAL_HEALTH_CHECK = "LH";
const std::string NO_HEALTHY_UPSTREAM = "UH";
Expand Down Expand Up @@ -163,7 +164,7 @@ const std::string parseResponseFlag(uint64_t response_flag) {
appendString(result, std::to_string(response_flag));
}

return result.empty() ? NONE : result;
return result.empty() ? ::Wasm::Common::NONE : result;
}

} // namespace Common
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,23 @@ package stackdriver.config.v1alpha1;
import "google/protobuf/duration.proto";
import "google/protobuf/wrappers.proto";

// next id: 10
// next id: 12
message PluginConfig {
// Types of Access logs to export.
enum AccessLogging {
// No Logs.
NONE = 0;
// All logs including both success and error logs.
FULL = 1;
// All error logs. This is currently only available for outbound/client side
// logs. A request is classified as error when `status>=400 or
// response_flag != "-"`
ERRORS_ONLY = 2;
};

// Optional. Controls whether to export server access log.
bool disable_server_access_logging = 1;
// This is deprecated in favor of AccessLogging enum.
bool disable_server_access_logging = 1 [deprecated = true];

// Optional. FQDN of destination service that the request routed to, e.g.
// productpage.default.svc.cluster.local. If not provided, request host header
Expand Down Expand Up @@ -71,4 +84,7 @@ message PluginConfig {

// Optional. Allows enabling log compression for stackdriver access logs.
google.protobuf.BoolValue enable_log_compression = 9;

// Optional. Controls what type of logs to export..
AccessLogging access_logging = 10;
}
Loading