access_loggers: add Fluentd access logger extension (#32320)

* initial fluentd access logger implementation

Signed-off-by: ohadvano <ohadvano@gmail.com>

* fix

Signed-off-by: ohadvano <ohadvano@gmail.com>

* fixes

Signed-off-by: ohadvano <ohadvano@gmail.com>

* fix

Signed-off-by: ohadvano <ohadvano@gmail.com>

* fix format

Signed-off-by: ohadvano <ohadvano@gmail.com>

* fix format

Signed-off-by: ohadvano <ohadvano@gmail.com>

* test

Signed-off-by: ohadvano <ohadvano@gmail.com>

* format

Signed-off-by: ohadvano <ohadvano@gmail.com>

* format and test fix

Signed-off-by: ohadvano <ohadvano@gmail.com>

* revert

Signed-off-by: ohadvano <ohadvano@gmail.com>

* fix compile_time_options

Signed-off-by: ohadvano <ohadvano@gmail.com>

* add docs reference

Signed-off-by: ohadvano <ohadvano@gmail.com>

* use exception safe and add tests

Signed-off-by: ohadvano <ohadvano@gmail.com>

* fix format

Signed-off-by: ohadvano <ohadvano@gmail.com>

* const and extension status

Signed-off-by: ohadvano <ohadvano@gmail.com>

* comment and remove redundant build tags

Signed-off-by: ohadvano <ohadvano@gmail.com>

* fix format

Signed-off-by: ohadvano <ohadvano@gmail.com>

* use weak_ptr and pin

Signed-off-by: ohadvano <ohadvano@gmail.com>

* fix format

Signed-off-by: ohadvano <ohadvano@gmail.com>

* recrate if expired

Signed-off-by: ohadvano <ohadvano@gmail.com>

---------

Signed-off-by: ohadvano <ohadvano@gmail.com>
Signed-off-by: ohadvano <49730675+ohadvano@users.noreply.github.com>

Mirrored from https://github.com/envoyproxy/envoy @ 949c953f91dfa8054c66e191e614bd1d7bee4785
main
update-envoy[bot] 9 months ago
parent 270fad43b5
commit 9cc8fc4eba
  1. 1
      BUILD
  2. 9
      envoy/extensions/access_loggers/fluentd/v3/BUILD
  3. 70
      envoy/extensions/access_loggers/fluentd/v3/fluentd.proto
  4. 1
      versioning/BUILD

@ -134,6 +134,7 @@ proto_library(
"//envoy/data/tap/v3:pkg",
"//envoy/extensions/access_loggers/file/v3:pkg",
"//envoy/extensions/access_loggers/filters/cel/v3:pkg",
"//envoy/extensions/access_loggers/fluentd/v3:pkg",
"//envoy/extensions/access_loggers/grpc/v3:pkg",
"//envoy/extensions/access_loggers/open_telemetry/v3:pkg",
"//envoy/extensions/access_loggers/stream/v3:pkg",

@ -0,0 +1,9 @@
# DO NOT EDIT. This file is generated by tools/proto_format/proto_sync.py.
load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package")
licenses(["notice"]) # Apache 2
api_proto_package(
deps = ["@com_github_cncf_xds//udpa/annotations:pkg"],
)

@ -0,0 +1,70 @@
syntax = "proto3";
package envoy.extensions.access_loggers.fluentd.v3;
import "google/protobuf/duration.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/wrappers.proto";
import "udpa/annotations/status.proto";
import "validate/validate.proto";
option java_package = "io.envoyproxy.envoy.extensions.access_loggers.fluentd.v3";
option java_outer_classname = "FluentdProto";
option java_multiple_files = true;
option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/access_loggers/fluentd/v3;fluentdv3";
option (udpa.annotations.file_status).package_version_status = ACTIVE;
// [#protodoc-title: Fluentd access log]
// Configuration for the *envoy.access_loggers.fluentd* :ref:`AccessLog <envoy_v3_api_msg_config.accesslog.v3.AccessLog>`.
// This access log extension will send the emitted access logs over a TCP connection to an upstream that is accepting
// the Fluentd Forward Protocol as described in: `Fluentd Forward Protocol Specification
// <https://github.com/fluent/fluentd/wiki/Forward-Protocol-Specification-v1>`_.
// [#extension: envoy.access_loggers.fluentd]
// [#next-free-field: 7]
message FluentdAccessLogConfig {
// The upstream cluster to connect to for streaming the Fluentd messages.
string cluster = 1 [(validate.rules).string = {min_len: 1}];
// A tag is a string separated with '.' (e.g. log.type) to categorize events.
// See: https://github.com/fluent/fluentd/wiki/Forward-Protocol-Specification-v1#message-modes
string tag = 2 [(validate.rules).string = {min_len: 1}];
// The prefix to use when emitting :ref:`statistics <config_access_log_stats>`.
string stat_prefix = 3 [(validate.rules).string = {min_len: 1}];
// Interval for flushing access logs to the TCP stream. Logger will flush requests every time
// this interval is elapsed, or when batch size limit is hit, whichever comes first. Defaults to
// 1 second.
google.protobuf.Duration buffer_flush_interval = 4 [(validate.rules).duration = {gt {}}];
// Soft size limit in bytes for access log entries buffer. The logger will buffer requests until
// this limit it hit, or every time flush interval is elapsed, whichever comes first. When the buffer
// limit is hit, the logger will immediately flush the buffer contents. Setting it to zero effectively
// disables the batching. Defaults to 16384.
google.protobuf.UInt32Value buffer_size_bytes = 5;
// A struct that represents the record that is sent for each log entry.
// https://github.com/fluent/fluentd/wiki/Forward-Protocol-Specification-v1#entry
// Values are rendered as strings, numbers, or boolean values as appropriate.
// Nested JSON objects may be produced by some command operators (e.g. FILTER_STATE or DYNAMIC_METADATA).
// See :ref:`format string<config_access_log_format_strings>` documentation for a specific command operator details.
//
// .. validated-code-block:: yaml
// :type-name: envoy.extensions.access_loggers.fluentd.v3.FluentdAccessLogConfig
//
// record:
// status: "%RESPONSE_CODE%"
// message: "%LOCAL_REPLY_BODY%"
//
// The following msgpack record would be created:
//
// .. code-block:: json
//
// {
// "status": 500,
// "message": "My error message"
// }
google.protobuf.Struct record = 6 [(validate.rules).message = {required: true}];
}

@ -72,6 +72,7 @@ proto_library(
"//envoy/data/tap/v3:pkg",
"//envoy/extensions/access_loggers/file/v3:pkg",
"//envoy/extensions/access_loggers/filters/cel/v3:pkg",
"//envoy/extensions/access_loggers/fluentd/v3:pkg",
"//envoy/extensions/access_loggers/grpc/v3:pkg",
"//envoy/extensions/access_loggers/open_telemetry/v3:pkg",
"//envoy/extensions/access_loggers/stream/v3:pkg",

Loading…
Cancel
Save