Common tap configuration
As of Envoy v1.18 the v2 API has been removed and is no longer supported.
If you are upgrading from v2 API config you may wish to view the v2 API documentation:
[config.tap.v3.TapConfig proto]
Tap configuration.
match_config
() The match configuration. If the configuration matches the data source being tapped, a tap will occur, with the result written to the configured output. Exactly one of match and must be set. If both are set, the match will be used.
match
() The match configuration. If the configuration matches the data source being tapped, a tap will occur, with the result written to the configured output. Exactly one of match and must be set. If both are set, the match will be used.
output_config
(, REQUIRED) The tap output configuration. If a match configuration matches a data source being tapped, a tap will occur and the data will be written to the configured output.
config.tap.v3.MatchPredicate
Tap match configuration. This is a recursive structure which allows complex nested match configurations to be built using various logical operators.
"or_match": "{...}",
"not_match": "{...}",
"any_match": "...",
"http_request_headers_match": "{...}",
"http_request_trailers_match": "{...}",
"http_response_headers_match": "{...}",
"http_response_trailers_match": "{...}",
"http_request_generic_body_match": "{...}",
}
or_match
(config.tap.v3.MatchPredicate.MatchSet) A set that describes a logical OR. If any member of the set matches, the match configuration matches.
Precisely one of , and_match, , any_match, , http_request_trailers_match, , http_response_trailers_match, , http_response_generic_body_match must be set.
and_match
() A set that describes a logical AND. If all members of the set match, the match configuration matches.
Precisely one of or_match, , not_match, , http_request_headers_match, , http_response_headers_match, , http_request_generic_body_match, must be set.
not_match
(config.tap.v3.MatchPredicate) A negation match. The match configuration will match if the negated match condition matches.
Precisely one of , and_match, , any_match, , http_request_trailers_match, , http_response_trailers_match, , http_response_generic_body_match must be set.
any_match
() The match configuration will always match.
Precisely one of or_match, , not_match, , http_request_headers_match, , http_response_headers_match, , http_request_generic_body_match, must be set.
http_request_headers_match
(config.tap.v3.HttpHeadersMatch) HTTP request headers match configuration.
Precisely one of , and_match, , any_match, , http_request_trailers_match, , http_response_trailers_match, , http_response_generic_body_match must be set.
http_request_trailers_match
() HTTP request trailers match configuration.
Precisely one of or_match, , not_match, , http_request_headers_match, , http_response_headers_match, , http_request_generic_body_match, must be set.
http_response_headers_match
(config.tap.v3.HttpHeadersMatch) HTTP response headers match configuration.
Precisely one of , and_match, , any_match, , http_request_trailers_match, , http_response_trailers_match, , http_response_generic_body_match must be set.
() HTTP response trailers match configuration.
Precisely one of or_match, , not_match, , http_request_headers_match, , http_response_headers_match, , http_request_generic_body_match, must be set.
http_request_generic_body_match
(config.tap.v3.HttpGenericBodyMatch) HTTP request generic body match configuration.
Precisely one of , and_match, , any_match, , http_request_trailers_match, , http_response_trailers_match, , http_response_generic_body_match must be set.
http_response_generic_body_match
() HTTP response generic body match configuration.
Precisely one of or_match, , not_match, , http_request_headers_match, , http_response_headers_match, , http_request_generic_body_match, must be set.
config.tap.v3.MatchPredicate.MatchSet
A set of match configurations used for logical operations.
{
"rules": []
}
rules
(repeated config.tap.v3.MatchPredicate, REQUIRED) The list of rules that make up the set.
HTTP headers match configuration.
headers
(repeated config.route.v3.HeaderMatcher) HTTP headers to match.
config.tap.v3.HttpGenericBodyMatch
[config.tap.v3.HttpGenericBodyMatch proto]
HTTP generic body match configuration. List of text strings and hex strings to be located in HTTP body. All specified strings must be found in the HTTP body for positive match. The search may be limited to specified number of bytes from the body start.
Attention
Searching for patterns in HTTP body is potentially cpu intensive. For each specified pattern, http body is scanned byte by byte to find a match. If multiple patterns are specified, the process is repeated for each pattern. If location of a pattern is known, bytes_limit
should be specified to scan only part of the http body.
{
"patterns": []
}
bytes_limit
() Limits search to specified number of bytes - default zero (no limit - match entire captured buffer).
patterns
(repeated config.tap.v3.HttpGenericBodyMatch.GenericTextMatch, REQUIRED) List of patterns to match.
config.tap.v3.HttpGenericBodyMatch.GenericTextMatch
[config.tap.v3.HttpGenericBodyMatch.GenericTextMatch proto]
"string_match": "...",
"binary_match": "..."
}
string_match
() Text string to be located in HTTP body.
Precisely one of string_match, must be set.
binary_match
(bytes) Sequence of bytes to be located in HTTP body.
Precisely one of , binary_match must be set.
Tap output configuration.
sinks
max_buffered_rx_bytes
(UInt32Value) For buffered tapping, the maximum amount of received body that will be buffered prior to truncation. If truncation occurs, the field will be set. If not specified, the default is 1KiB.
max_buffered_tx_bytes
(UInt32Value) For buffered tapping, the maximum amount of transmitted body that will be buffered prior to truncation. If truncation occurs, the field will be set. If not specified, the default is 1KiB.
streaming
(bool) Indicates whether taps produce a single buffered message per tap, or multiple streamed messages per tap in the emitted messages. Note that streamed tapping does not mean that no buffering takes place. Buffering may be required if data is processed before a match can be determined. See the HTTP tap filter streaming documentation for more information.
config.tap.v3.OutputSink
[config.tap.v3.OutputSink proto]
Tap output sink configuration.
{
"format": "...",
"streaming_admin": "{...}",
"file_per_tap": "{...}"
}
format
() Sink output format.
streaming_admin
(config.tap.v3.StreamingAdminSink) Tap output will be streamed out the admin endpoint.
Attention
It is only allowed to specify the streaming admin output sink if the tap is being configured from the POST /tap admin endpoint. Thus, if an extension has been configured to receive tap configuration from some other source (e.g., static file, XDS, etc.) configuring the streaming admin output type will fail.
Precisely one of , file_per_tap must be set.
file_per_tap
() Tap output will be written to a file per tap sink.
Precisely one of streaming_admin, must be set.
Enum config.tap.v3.OutputSink.Format
Output format. All output is in the form of one or more TraceWrapper messages. This enumeration indicates how those messages are written. Note that not all sinks support all output formats. See individual sink documentation for more information.
JSON_BODY_AS_BYTES
(DEFAULT) Each message will be written as JSON. Any data will be present in the as_bytes field. This means that body data will be base64 encoded as per the .
JSON_BODY_AS_STRING
Each message will be written as JSON. Any body data will be present in the field. This means that body data will be string encoded as per the proto3 JSON mappings. This format type is useful when it is known that that body is human readable (e.g., JSON over HTTP) and the user wishes to view it directly without being forced to base64 decode the body.
PROTO_BINARY
Binary proto format. Note that binary proto is not self-delimiting. If a sink writes multiple binary messages without any length information the data stream will not be useful. However, for certain sinks that are self-delimiting (e.g., one message per file) this output format makes consumption simpler.
PROTO_BINARY_LENGTH_DELIMITED
Messages are written as a sequence tuples, where each tuple is the message length encoded as a followed by the binary message. The messages can be read back using the language specific protobuf coded stream implementation to obtain the message length and the message.
PROTO_TEXT
Text proto format.
[config.tap.v3.StreamingAdminSink proto]
Streaming admin sink configuration.
config.tap.v3.FilePerTapSink
[config.tap.v3.FilePerTapSink proto]
The file per tap sink outputs a discrete file for every tapped stream.
{
(, REQUIRED) Path prefix. The output file will be of the form <path_prefix>_<id>.pb, where <id> is an identifier distinguishing the recorded trace for stream instances (the Envoy connection ID, HTTP stream ID, etc.).