xds_api/generated/envoy.config.tap.v3.rs
1// This file is @generated by prost-build.
2/// Tap configuration.
3///
4/// \[#comment:TODO(mattklein123): Rate limiting\]
5#[derive(Clone, PartialEq, ::prost::Message)]
6pub struct TapConfig {
7 /// The match configuration. If the configuration matches the data source being tapped, a tap will
8 /// occur, with the result written to the configured output.
9 /// Exactly one of :ref:`match <envoy_v3_api_field_config.tap.v3.TapConfig.match>` and
10 /// :ref:`match_config <envoy_v3_api_field_config.tap.v3.TapConfig.match_config>` must be set. If both
11 /// are set, the :ref:`match <envoy_v3_api_field_config.tap.v3.TapConfig.match>` will be used.
12 #[deprecated]
13 #[prost(message, optional, tag = "1")]
14 pub match_config: ::core::option::Option<MatchPredicate>,
15 /// The match configuration. If the configuration matches the data source being tapped, a tap will
16 /// occur, with the result written to the configured output.
17 /// Exactly one of :ref:`match <envoy_v3_api_field_config.tap.v3.TapConfig.match>` and
18 /// :ref:`match_config <envoy_v3_api_field_config.tap.v3.TapConfig.match_config>` must be set. If both
19 /// are set, the :ref:`match <envoy_v3_api_field_config.tap.v3.TapConfig.match>` will be used.
20 #[prost(message, optional, tag = "4")]
21 pub r#match: ::core::option::Option<
22 super::super::common::matcher::v3::MatchPredicate,
23 >,
24 /// The tap output configuration. If a match configuration matches a data source being tapped,
25 /// a tap will occur and the data will be written to the configured output.
26 #[prost(message, optional, tag = "2")]
27 pub output_config: ::core::option::Option<OutputConfig>,
28 /// \[#not-implemented-hide:\] Specify if Tap matching is enabled. The % of requests\connections for
29 /// which the tap matching is enabled. When not enabled, the request\connection will not be
30 /// recorded.
31 ///
32 /// .. note::
33 ///
34 /// This field defaults to 100/:ref:`HUNDRED
35 /// <envoy_v3_api_enum_type.v3.FractionalPercent.DenominatorType>`.
36 #[prost(message, optional, tag = "3")]
37 pub tap_enabled: ::core::option::Option<
38 super::super::core::v3::RuntimeFractionalPercent,
39 >,
40}
41impl ::prost::Name for TapConfig {
42 const NAME: &'static str = "TapConfig";
43 const PACKAGE: &'static str = "envoy.config.tap.v3";
44 fn full_name() -> ::prost::alloc::string::String {
45 "envoy.config.tap.v3.TapConfig".into()
46 }
47 fn type_url() -> ::prost::alloc::string::String {
48 "type.googleapis.com/envoy.config.tap.v3.TapConfig".into()
49 }
50}
51/// Tap match configuration. This is a recursive structure which allows complex nested match
52/// configurations to be built using various logical operators.
53/// \[#next-free-field: 11\]
54#[derive(Clone, PartialEq, ::prost::Message)]
55pub struct MatchPredicate {
56 #[prost(oneof = "match_predicate::Rule", tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10")]
57 pub rule: ::core::option::Option<match_predicate::Rule>,
58}
59/// Nested message and enum types in `MatchPredicate`.
60pub mod match_predicate {
61 /// A set of match configurations used for logical operations.
62 #[derive(Clone, PartialEq, ::prost::Message)]
63 pub struct MatchSet {
64 /// The list of rules that make up the set.
65 #[prost(message, repeated, tag = "1")]
66 pub rules: ::prost::alloc::vec::Vec<super::MatchPredicate>,
67 }
68 impl ::prost::Name for MatchSet {
69 const NAME: &'static str = "MatchSet";
70 const PACKAGE: &'static str = "envoy.config.tap.v3";
71 fn full_name() -> ::prost::alloc::string::String {
72 "envoy.config.tap.v3.MatchPredicate.MatchSet".into()
73 }
74 fn type_url() -> ::prost::alloc::string::String {
75 "type.googleapis.com/envoy.config.tap.v3.MatchPredicate.MatchSet".into()
76 }
77 }
78 #[derive(Clone, PartialEq, ::prost::Oneof)]
79 pub enum Rule {
80 /// A set that describes a logical OR. If any member of the set matches, the match configuration
81 /// matches.
82 #[prost(message, tag = "1")]
83 OrMatch(MatchSet),
84 /// A set that describes a logical AND. If all members of the set match, the match configuration
85 /// matches.
86 #[prost(message, tag = "2")]
87 AndMatch(MatchSet),
88 /// A negation match. The match configuration will match if the negated match condition matches.
89 #[prost(message, tag = "3")]
90 NotMatch(::prost::alloc::boxed::Box<super::MatchPredicate>),
91 /// The match configuration will always match.
92 #[prost(bool, tag = "4")]
93 AnyMatch(bool),
94 /// HTTP request headers match configuration.
95 #[prost(message, tag = "5")]
96 HttpRequestHeadersMatch(super::HttpHeadersMatch),
97 /// HTTP request trailers match configuration.
98 #[prost(message, tag = "6")]
99 HttpRequestTrailersMatch(super::HttpHeadersMatch),
100 /// HTTP response headers match configuration.
101 #[prost(message, tag = "7")]
102 HttpResponseHeadersMatch(super::HttpHeadersMatch),
103 /// HTTP response trailers match configuration.
104 #[prost(message, tag = "8")]
105 HttpResponseTrailersMatch(super::HttpHeadersMatch),
106 /// HTTP request generic body match configuration.
107 #[prost(message, tag = "9")]
108 HttpRequestGenericBodyMatch(super::HttpGenericBodyMatch),
109 /// HTTP response generic body match configuration.
110 #[prost(message, tag = "10")]
111 HttpResponseGenericBodyMatch(super::HttpGenericBodyMatch),
112 }
113}
114impl ::prost::Name for MatchPredicate {
115 const NAME: &'static str = "MatchPredicate";
116 const PACKAGE: &'static str = "envoy.config.tap.v3";
117 fn full_name() -> ::prost::alloc::string::String {
118 "envoy.config.tap.v3.MatchPredicate".into()
119 }
120 fn type_url() -> ::prost::alloc::string::String {
121 "type.googleapis.com/envoy.config.tap.v3.MatchPredicate".into()
122 }
123}
124/// HTTP headers match configuration.
125#[derive(Clone, PartialEq, ::prost::Message)]
126pub struct HttpHeadersMatch {
127 /// HTTP headers to match.
128 #[prost(message, repeated, tag = "1")]
129 pub headers: ::prost::alloc::vec::Vec<super::super::route::v3::HeaderMatcher>,
130}
131impl ::prost::Name for HttpHeadersMatch {
132 const NAME: &'static str = "HttpHeadersMatch";
133 const PACKAGE: &'static str = "envoy.config.tap.v3";
134 fn full_name() -> ::prost::alloc::string::String {
135 "envoy.config.tap.v3.HttpHeadersMatch".into()
136 }
137 fn type_url() -> ::prost::alloc::string::String {
138 "type.googleapis.com/envoy.config.tap.v3.HttpHeadersMatch".into()
139 }
140}
141/// HTTP generic body match configuration.
142/// List of text strings and hex strings to be located in HTTP body.
143/// All specified strings must be found in the HTTP body for positive match.
144/// The search may be limited to specified number of bytes from the body start.
145///
146/// .. attention::
147///
148/// 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.
149/// If multiple patterns are specified, the process is repeated for each pattern. If location of a pattern is known, ``bytes_limit`` should be specified
150/// to scan only part of the http body.
151#[derive(Clone, PartialEq, ::prost::Message)]
152pub struct HttpGenericBodyMatch {
153 /// Limits search to specified number of bytes - default zero (no limit - match entire captured buffer).
154 #[prost(uint32, tag = "1")]
155 pub bytes_limit: u32,
156 /// List of patterns to match.
157 #[prost(message, repeated, tag = "2")]
158 pub patterns: ::prost::alloc::vec::Vec<http_generic_body_match::GenericTextMatch>,
159}
160/// Nested message and enum types in `HttpGenericBodyMatch`.
161pub mod http_generic_body_match {
162 #[derive(Clone, PartialEq, ::prost::Message)]
163 pub struct GenericTextMatch {
164 #[prost(oneof = "generic_text_match::Rule", tags = "1, 2")]
165 pub rule: ::core::option::Option<generic_text_match::Rule>,
166 }
167 /// Nested message and enum types in `GenericTextMatch`.
168 pub mod generic_text_match {
169 #[derive(Clone, PartialEq, ::prost::Oneof)]
170 pub enum Rule {
171 /// Text string to be located in HTTP body.
172 #[prost(string, tag = "1")]
173 StringMatch(::prost::alloc::string::String),
174 /// Sequence of bytes to be located in HTTP body.
175 #[prost(bytes, tag = "2")]
176 BinaryMatch(::prost::alloc::vec::Vec<u8>),
177 }
178 }
179 impl ::prost::Name for GenericTextMatch {
180 const NAME: &'static str = "GenericTextMatch";
181 const PACKAGE: &'static str = "envoy.config.tap.v3";
182 fn full_name() -> ::prost::alloc::string::String {
183 "envoy.config.tap.v3.HttpGenericBodyMatch.GenericTextMatch".into()
184 }
185 fn type_url() -> ::prost::alloc::string::String {
186 "type.googleapis.com/envoy.config.tap.v3.HttpGenericBodyMatch.GenericTextMatch"
187 .into()
188 }
189 }
190}
191impl ::prost::Name for HttpGenericBodyMatch {
192 const NAME: &'static str = "HttpGenericBodyMatch";
193 const PACKAGE: &'static str = "envoy.config.tap.v3";
194 fn full_name() -> ::prost::alloc::string::String {
195 "envoy.config.tap.v3.HttpGenericBodyMatch".into()
196 }
197 fn type_url() -> ::prost::alloc::string::String {
198 "type.googleapis.com/envoy.config.tap.v3.HttpGenericBodyMatch".into()
199 }
200}
201/// Tap output configuration.
202#[derive(Clone, PartialEq, ::prost::Message)]
203pub struct OutputConfig {
204 /// Output sinks for tap data. Currently a single sink is allowed in the list. Once multiple
205 /// sink types are supported this constraint will be relaxed.
206 #[prost(message, repeated, tag = "1")]
207 pub sinks: ::prost::alloc::vec::Vec<OutputSink>,
208 /// For buffered tapping, the maximum amount of received body that will be buffered prior to
209 /// truncation. If truncation occurs, the :ref:`truncated
210 /// <envoy_v3_api_field_data.tap.v3.Body.truncated>` field will be set. If not specified, the
211 /// default is 1KiB.
212 #[prost(message, optional, tag = "2")]
213 pub max_buffered_rx_bytes: ::core::option::Option<
214 super::super::super::super::google::protobuf::UInt32Value,
215 >,
216 /// For buffered tapping, the maximum amount of transmitted body that will be buffered prior to
217 /// truncation. If truncation occurs, the :ref:`truncated
218 /// <envoy_v3_api_field_data.tap.v3.Body.truncated>` field will be set. If not specified, the
219 /// default is 1KiB.
220 #[prost(message, optional, tag = "3")]
221 pub max_buffered_tx_bytes: ::core::option::Option<
222 super::super::super::super::google::protobuf::UInt32Value,
223 >,
224 /// Indicates whether taps produce a single buffered message per tap, or multiple streamed
225 /// messages per tap in the emitted :ref:`TraceWrapper
226 /// <envoy_v3_api_msg_data.tap.v3.TraceWrapper>` messages. Note that streamed tapping does not
227 /// mean that no buffering takes place. Buffering may be required if data is processed before a
228 /// match can be determined. See the HTTP tap filter :ref:`streaming
229 /// <config_http_filters_tap_streaming>` documentation for more information.
230 #[prost(bool, tag = "4")]
231 pub streaming: bool,
232}
233impl ::prost::Name for OutputConfig {
234 const NAME: &'static str = "OutputConfig";
235 const PACKAGE: &'static str = "envoy.config.tap.v3";
236 fn full_name() -> ::prost::alloc::string::String {
237 "envoy.config.tap.v3.OutputConfig".into()
238 }
239 fn type_url() -> ::prost::alloc::string::String {
240 "type.googleapis.com/envoy.config.tap.v3.OutputConfig".into()
241 }
242}
243/// Tap output sink configuration.
244/// \[#next-free-field: 7\]
245#[derive(Clone, PartialEq, ::prost::Message)]
246pub struct OutputSink {
247 /// Sink output format.
248 #[prost(enumeration = "output_sink::Format", tag = "1")]
249 pub format: i32,
250 #[prost(oneof = "output_sink::OutputSinkType", tags = "2, 3, 4, 5, 6")]
251 pub output_sink_type: ::core::option::Option<output_sink::OutputSinkType>,
252}
253/// Nested message and enum types in `OutputSink`.
254pub mod output_sink {
255 /// Output format. All output is in the form of one or more :ref:`TraceWrapper
256 /// <envoy_v3_api_msg_data.tap.v3.TraceWrapper>` messages. This enumeration indicates
257 /// how those messages are written. Note that not all sinks support all output formats. See
258 /// individual sink documentation for more information.
259 #[derive(
260 Clone,
261 Copy,
262 Debug,
263 PartialEq,
264 Eq,
265 Hash,
266 PartialOrd,
267 Ord,
268 ::prost::Enumeration
269 )]
270 #[repr(i32)]
271 pub enum Format {
272 /// Each message will be written as JSON. Any :ref:`body <envoy_v3_api_msg_data.tap.v3.Body>`
273 /// data will be present in the :ref:`as_bytes
274 /// <envoy_v3_api_field_data.tap.v3.Body.as_bytes>` field. This means that body data will be
275 /// base64 encoded as per the `proto3 JSON mappings
276 /// <<https://developers.google.com/protocol-buffers/docs/proto3#json>`_.>
277 JsonBodyAsBytes = 0,
278 /// Each message will be written as JSON. Any :ref:`body <envoy_v3_api_msg_data.tap.v3.Body>`
279 /// data will be present in the :ref:`as_string
280 /// <envoy_v3_api_field_data.tap.v3.Body.as_string>` field. This means that body data will be
281 /// string encoded as per the `proto3 JSON mappings
282 /// <<https://developers.google.com/protocol-buffers/docs/proto3#json>`_.> This format type is
283 /// useful when it is known that that body is human readable (e.g., JSON over HTTP) and the
284 /// user wishes to view it directly without being forced to base64 decode the body.
285 JsonBodyAsString = 1,
286 /// Binary proto format. Note that binary proto is not self-delimiting. If a sink writes
287 /// multiple binary messages without any length information the data stream will not be
288 /// useful. However, for certain sinks that are self-delimiting (e.g., one message per file)
289 /// this output format makes consumption simpler.
290 ProtoBinary = 2,
291 /// Messages are written as a sequence tuples, where each tuple is the message length encoded
292 /// as a `protobuf 32-bit varint
293 /// <<https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.io.coded_stream>`_>
294 /// followed by the binary message. The messages can be read back using the language specific
295 /// protobuf coded stream implementation to obtain the message length and the message.
296 ProtoBinaryLengthDelimited = 3,
297 /// Text proto format.
298 ProtoText = 4,
299 }
300 impl Format {
301 /// String value of the enum field names used in the ProtoBuf definition.
302 ///
303 /// The values are not transformed in any way and thus are considered stable
304 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
305 pub fn as_str_name(&self) -> &'static str {
306 match self {
307 Self::JsonBodyAsBytes => "JSON_BODY_AS_BYTES",
308 Self::JsonBodyAsString => "JSON_BODY_AS_STRING",
309 Self::ProtoBinary => "PROTO_BINARY",
310 Self::ProtoBinaryLengthDelimited => "PROTO_BINARY_LENGTH_DELIMITED",
311 Self::ProtoText => "PROTO_TEXT",
312 }
313 }
314 /// Creates an enum from field names used in the ProtoBuf definition.
315 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
316 match value {
317 "JSON_BODY_AS_BYTES" => Some(Self::JsonBodyAsBytes),
318 "JSON_BODY_AS_STRING" => Some(Self::JsonBodyAsString),
319 "PROTO_BINARY" => Some(Self::ProtoBinary),
320 "PROTO_BINARY_LENGTH_DELIMITED" => Some(Self::ProtoBinaryLengthDelimited),
321 "PROTO_TEXT" => Some(Self::ProtoText),
322 _ => None,
323 }
324 }
325 }
326 #[derive(Clone, PartialEq, ::prost::Oneof)]
327 pub enum OutputSinkType {
328 /// Tap output will be streamed out the :http:post:`/tap` admin endpoint.
329 ///
330 /// .. attention::
331 ///
332 /// It is only allowed to specify the streaming admin output sink if the tap is being
333 /// configured from the :http:post:`/tap` admin endpoint. Thus, if an extension has
334 /// been configured to receive tap configuration from some other source (e.g., static
335 /// file, XDS, etc.) configuring the streaming admin output type will fail.
336 #[prost(message, tag = "2")]
337 StreamingAdmin(super::StreamingAdminSink),
338 /// Tap output will be written to a file per tap sink.
339 #[prost(message, tag = "3")]
340 FilePerTap(super::FilePerTapSink),
341 /// \[#not-implemented-hide:\]
342 /// GrpcService to stream data to. The format argument must be PROTO_BINARY.
343 /// \[#comment: TODO(samflattery): remove cleanup in uber_per_filter.cc once implemented\]
344 #[prost(message, tag = "4")]
345 StreamingGrpc(super::StreamingGrpcSink),
346 /// Tap output will be buffered in a single block before flushing to the :http:post:`/tap` admin endpoint
347 ///
348 /// .. attention::
349 ///
350 /// It is only allowed to specify the buffered admin output sink if the tap is being
351 /// configured from the :http:post:`/tap` admin endpoint. Thus, if an extension has
352 /// been configured to receive tap configuration from some other source (e.g., static
353 /// file, XDS, etc.) configuring the buffered admin output type will fail.
354 #[prost(message, tag = "5")]
355 BufferedAdmin(super::BufferedAdminSink),
356 /// Tap output filter will be defined by an extension type
357 #[prost(message, tag = "6")]
358 CustomSink(super::super::super::core::v3::TypedExtensionConfig),
359 }
360}
361impl ::prost::Name for OutputSink {
362 const NAME: &'static str = "OutputSink";
363 const PACKAGE: &'static str = "envoy.config.tap.v3";
364 fn full_name() -> ::prost::alloc::string::String {
365 "envoy.config.tap.v3.OutputSink".into()
366 }
367 fn type_url() -> ::prost::alloc::string::String {
368 "type.googleapis.com/envoy.config.tap.v3.OutputSink".into()
369 }
370}
371/// Streaming admin sink configuration.
372#[derive(Clone, Copy, PartialEq, ::prost::Message)]
373pub struct StreamingAdminSink {}
374impl ::prost::Name for StreamingAdminSink {
375 const NAME: &'static str = "StreamingAdminSink";
376 const PACKAGE: &'static str = "envoy.config.tap.v3";
377 fn full_name() -> ::prost::alloc::string::String {
378 "envoy.config.tap.v3.StreamingAdminSink".into()
379 }
380 fn type_url() -> ::prost::alloc::string::String {
381 "type.googleapis.com/envoy.config.tap.v3.StreamingAdminSink".into()
382 }
383}
384/// BufferedAdminSink configures a tap output to collect traces without returning them until
385/// one of multiple criteria are satisfied.
386/// Similar to StreamingAdminSink, it is only allowed to specify the buffered admin output
387/// sink if the tap is being configured from the ``/tap`` admin endpoint.
388#[derive(Clone, Copy, PartialEq, ::prost::Message)]
389pub struct BufferedAdminSink {
390 /// Stop collecting traces when the specified number are collected.
391 /// If other criteria for ending collection are reached first, this value will not be used.
392 #[prost(uint64, tag = "1")]
393 pub max_traces: u64,
394 /// Acts as a fallback to prevent the client from waiting for long periods of time.
395 /// After timeout has occurred, a buffer flush will be triggered, returning the traces buffered so far.
396 /// This may result in returning fewer traces than were requested, and in the case that no traces are
397 /// buffered during this time, no traces will be returned.
398 /// Specifying 0 for the timeout value (or not specifying a value at all) indicates an infinite timeout.
399 #[prost(message, optional, tag = "2")]
400 pub timeout: ::core::option::Option<
401 super::super::super::super::google::protobuf::Duration,
402 >,
403}
404impl ::prost::Name for BufferedAdminSink {
405 const NAME: &'static str = "BufferedAdminSink";
406 const PACKAGE: &'static str = "envoy.config.tap.v3";
407 fn full_name() -> ::prost::alloc::string::String {
408 "envoy.config.tap.v3.BufferedAdminSink".into()
409 }
410 fn type_url() -> ::prost::alloc::string::String {
411 "type.googleapis.com/envoy.config.tap.v3.BufferedAdminSink".into()
412 }
413}
414/// The file per tap sink outputs a discrete file for every tapped stream.
415#[derive(Clone, PartialEq, ::prost::Message)]
416pub struct FilePerTapSink {
417 /// Path prefix. The output file will be of the form <path_prefix>_<id>.pb, where <id> is an
418 /// identifier distinguishing the recorded trace for stream instances (the Envoy
419 /// connection ID, HTTP stream ID, etc.).
420 #[prost(string, tag = "1")]
421 pub path_prefix: ::prost::alloc::string::String,
422}
423impl ::prost::Name for FilePerTapSink {
424 const NAME: &'static str = "FilePerTapSink";
425 const PACKAGE: &'static str = "envoy.config.tap.v3";
426 fn full_name() -> ::prost::alloc::string::String {
427 "envoy.config.tap.v3.FilePerTapSink".into()
428 }
429 fn type_url() -> ::prost::alloc::string::String {
430 "type.googleapis.com/envoy.config.tap.v3.FilePerTapSink".into()
431 }
432}
433/// \[#not-implemented-hide:\] Streaming gRPC sink configuration sends the taps to an external gRPC
434/// server.
435#[derive(Clone, PartialEq, ::prost::Message)]
436pub struct StreamingGrpcSink {
437 /// Opaque identifier, that will be sent back to the streaming grpc server.
438 #[prost(string, tag = "1")]
439 pub tap_id: ::prost::alloc::string::String,
440 /// The gRPC server that hosts the Tap Sink Service.
441 #[prost(message, optional, tag = "2")]
442 pub grpc_service: ::core::option::Option<super::super::core::v3::GrpcService>,
443}
444impl ::prost::Name for StreamingGrpcSink {
445 const NAME: &'static str = "StreamingGrpcSink";
446 const PACKAGE: &'static str = "envoy.config.tap.v3";
447 fn full_name() -> ::prost::alloc::string::String {
448 "envoy.config.tap.v3.StreamingGrpcSink".into()
449 }
450 fn type_url() -> ::prost::alloc::string::String {
451 "type.googleapis.com/envoy.config.tap.v3.StreamingGrpcSink".into()
452 }
453}