envoy-types 0.7.3

Collection of protobuf types and other assets to work with the Envoy Proxy through Rust gRPC services.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
// This file is @generated by prost-build.
/// Configuration for pluggable stats sinks.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StatsSink {
    /// The name of the stats sink to instantiate. The name must match a supported
    /// stats sink.
    /// See the :ref:`extensions listed in typed_config below <extension_category_envoy.stats_sinks>` for the default list of available stats sink.
    /// Sinks optionally support tagged/multiple dimensional metrics.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    ///
    /// Stats sink specific configuration which depends on the sink being instantiated. See
    /// : ref:`StatsdSink <envoy_v3_api_msg_config.metrics.v3.StatsdSink>` for an example.
    ///   \[\#extension-category: envoy.stats_sinks\]
    #[prost(oneof = "stats_sink::ConfigType", tags = "3")]
    pub config_type: ::core::option::Option<stats_sink::ConfigType>,
}
/// Nested message and enum types in `StatsSink`.
pub mod stats_sink {
    ///
    /// Stats sink specific configuration which depends on the sink being instantiated. See
    /// : ref:`StatsdSink <envoy_v3_api_msg_config.metrics.v3.StatsdSink>` for an example.
    ///   \[\#extension-category: envoy.stats_sinks\]
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum ConfigType {
        #[prost(message, tag = "3")]
        TypedConfig(super::super::super::super::super::google::protobuf::Any),
    }
}
impl ::prost::Name for StatsSink {
    const NAME: &'static str = "StatsSink";
    const PACKAGE: &'static str = "envoy.config.metrics.v3";
    fn full_name() -> ::prost::alloc::string::String {
        "envoy.config.metrics.v3.StatsSink".into()
    }
    fn type_url() -> ::prost::alloc::string::String {
        "type.googleapis.com/envoy.config.metrics.v3.StatsSink".into()
    }
}
/// Statistics configuration such as tagging.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StatsConfig {
    ///
    /// Each stat name is independently processed through these tag specifiers. When a tag is
    /// matched, the first capture group is not immediately removed from the name, so later
    /// : ref:`TagSpecifiers <envoy_v3_api_msg_config.metrics.v3.TagSpecifier>` can also match that
    ///   same portion of the match. After all tag matching is complete, a tag-extracted version of
    ///   the name is produced and is used in stats sinks that represent tags, such as Prometheus.
    #[prost(message, repeated, tag = "1")]
    pub stats_tags: ::prost::alloc::vec::Vec<TagSpecifier>,
    /// Use all default tag regexes specified in Envoy. These can be combined with
    /// custom tags specified in :ref:`stats_tags  <envoy_v3_api_field_config.metrics.v3.StatsConfig.stats_tags>`. They will be processed before
    /// the custom tags.
    ///
    /// See :repo:`well_known_names.h <source/common/config/well_known_names.h>` for a list of the
    /// default tags in Envoy.
    ///
    /// If not provided, the value is assumed to be true.
    #[prost(message, optional, tag = "2")]
    pub use_all_default_tags: ::core::option::Option<
        super::super::super::super::google::protobuf::BoolValue,
    >,
    /// Inclusion/exclusion matcher for stat name creation. If not provided, all stats are instantiated
    /// as normal. Preventing the instantiation of certain families of stats can improve memory
    /// performance for Envoys running especially large configs.
    ///
    /// .. warning::
    /// Excluding stats may affect Envoy's behavior in undocumented ways. See
    /// `issue #8771 <<https://github.com/envoyproxy/envoy/issues/8771>`\_> for more information.
    /// If any unexpected behavior changes are observed, please open a new issue immediately.
    #[prost(message, optional, tag = "3")]
    pub stats_matcher: ::core::option::Option<StatsMatcher>,
    /// Defines rules for setting the histogram buckets. Rules are evaluated in order, and the first
    /// match is applied. If no match is found (or if no rules are set), the following default buckets
    /// are used:
    ///
    /// .. code-block:: json
    ///
    /// ```text
    /// [
    ///    0.5,
    ///    1,
    ///    5,
    ///    10,
    ///    25,
    ///    50,
    ///    100,
    ///    250,
    ///    500,
    ///    1000,
    ///    2500,
    ///    5000,
    ///    10000,
    ///    30000,
    ///    60000,
    ///    300000,
    ///    600000,
    ///    1800000,
    ///    3600000
    /// ]
    /// ```
    #[prost(message, repeated, tag = "4")]
    pub histogram_bucket_settings: ::prost::alloc::vec::Vec<HistogramBucketSettings>,
}
impl ::prost::Name for StatsConfig {
    const NAME: &'static str = "StatsConfig";
    const PACKAGE: &'static str = "envoy.config.metrics.v3";
    fn full_name() -> ::prost::alloc::string::String {
        "envoy.config.metrics.v3.StatsConfig".into()
    }
    fn type_url() -> ::prost::alloc::string::String {
        "type.googleapis.com/envoy.config.metrics.v3.StatsConfig".into()
    }
}
/// Configuration for disabling stat instantiation.
///
/// The instantiation of stats is unrestricted by default. If the goal is to configure Envoy to
/// instantiate all stats, there is no need to construct a StatsMatcher.
///
/// However, StatsMatcher can be used to limit the creation of families of stats in order to
/// conserve memory. Stats can either be disabled entirely, or they can be
/// limited by either an exclusion or an inclusion list of :ref:`StringMatcher  <envoy_v3_api_msg_type.matcher.v3.StringMatcher>` protos:
///
/// * If `reject_all` is set to `true`, no stats will be instantiated. If `reject_all` is set to
///   `false`, all stats will be instantiated.
///
/// * If an exclusion list is supplied, any stat name matching *any* of the StringMatchers in the
///   list will not instantiate.
///
/// * If an inclusion list is supplied, no stats will instantiate, except those matching *any* of
///   the StringMatchers in the list.
///
/// A StringMatcher can be used to match against an exact string, a suffix / prefix, or a regex.
/// **NB:** For performance reasons, it is highly recommended to use a prefix- or suffix-based
/// matcher rather than a regex-based matcher.
///
/// Example 1. Excluding all stats.
///
/// .. code-block:: json
///
/// {
/// "statsMatcher": {
/// "rejectAll": "true"
/// }
/// }
///
/// Example 2. Excluding all cluster-specific stats, but not cluster-manager stats:
///
/// .. code-block:: json
///
/// {
/// "statsMatcher": {
/// "exclusionList": {
/// "patterns": \[
/// {
/// "prefix": "cluster."
/// }
/// \]
/// }
/// }
/// }
///
/// Example 3. Including only manager-related stats:
///
/// .. code-block:: json
///
/// {
/// "statsMatcher": {
/// "inclusionList": {
/// "patterns": \[
/// {
/// "prefix": "cluster_manager."
/// },
/// {
/// "prefix": "listener_manager."
/// }
/// \]
/// }
/// }
/// }
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StatsMatcher {
    #[prost(oneof = "stats_matcher::StatsMatcher", tags = "1, 2, 3")]
    pub stats_matcher: ::core::option::Option<stats_matcher::StatsMatcher>,
}
/// Nested message and enum types in `StatsMatcher`.
pub mod stats_matcher {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum StatsMatcher {
        /// If `reject_all` is true, then all stats are disabled. If `reject_all` is false, then all
        /// stats are enabled.
        #[prost(bool, tag = "1")]
        RejectAll(bool),
        /// Exclusive match. All stats are enabled except for those matching one of the supplied
        /// StringMatcher protos.
        #[prost(message, tag = "2")]
        ExclusionList(
            super::super::super::super::r#type::matcher::v3::ListStringMatcher,
        ),
        /// Inclusive match. No stats are enabled except for those matching one of the supplied
        /// StringMatcher protos.
        #[prost(message, tag = "3")]
        InclusionList(
            super::super::super::super::r#type::matcher::v3::ListStringMatcher,
        ),
    }
}
impl ::prost::Name for StatsMatcher {
    const NAME: &'static str = "StatsMatcher";
    const PACKAGE: &'static str = "envoy.config.metrics.v3";
    fn full_name() -> ::prost::alloc::string::String {
        "envoy.config.metrics.v3.StatsMatcher".into()
    }
    fn type_url() -> ::prost::alloc::string::String {
        "type.googleapis.com/envoy.config.metrics.v3.StatsMatcher".into()
    }
}
/// Designates a tag name and value pair. The value may be either a fixed value
/// or a regex providing the value via capture groups. The specified tag will be
/// unconditionally set if a fixed value, otherwise it will only be set if one
/// or more capture groups in the regex match.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct TagSpecifier {
    ///
    /// Attaches an identifier to the tag values to identify the tag being in the
    /// sink. Envoy has a set of default names and regexes to extract dynamic
    /// portions of existing stats, which can be found in :repo:`well_known_names.h  <source/common/config/well_known_names.h>` in the Envoy repository. If a :ref:`tag_name  <envoy_v3_api_field_config.metrics.v3.TagSpecifier.tag_name>` is provided in the config and
    /// neither :ref:`regex <envoy_v3_api_field_config.metrics.v3.TagSpecifier.regex>` or
    /// : ref:`fixed_value <envoy_v3_api_field_config.metrics.v3.TagSpecifier.fixed_value>` were specified,
    ///   Envoy will attempt to find that name in its set of defaults and use the accompanying regex.
    ///
    ///
    /// .. note::
    ///
    /// A stat name may be spelled in such a way that it matches two different
    /// tag extractors for the same tag name. In that case, all but one of the
    /// tag values will be dropped. It is not specified which tag value will be
    /// retained. The extraction will only occur for one of the extractors, and
    /// only the matched extraction will be removed from the tag name.
    #[prost(string, tag = "1")]
    pub tag_name: ::prost::alloc::string::String,
    #[prost(oneof = "tag_specifier::TagValue", tags = "2, 3")]
    pub tag_value: ::core::option::Option<tag_specifier::TagValue>,
}
/// Nested message and enum types in `TagSpecifier`.
pub mod tag_specifier {
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum TagValue {
        /// Designates a tag to strip from the tag extracted name and provide as a named
        /// tag value for all statistics. This will only occur if any part of the name
        /// matches the regex provided with one or more capture groups.
        ///
        /// The first capture group identifies the portion of the name to remove. The
        /// second capture group (which will normally be nested inside the first) will
        /// designate the value of the tag for the statistic. If no second capture
        /// group is provided, the first will also be used to set the value of the tag.
        /// All other capture groups will be ignored.
        ///
        /// Example 1. a stat name `cluster.foo_cluster.upstream_rq_timeout` and
        /// one tag specifier:
        ///
        /// .. code-block:: json
        ///
        /// {
        /// "tag_name": "envoy.cluster_name",
        /// "regex": "^cluster\\.((.+?)\\.)"
        /// }
        ///
        /// Note that the regex will remove `foo_cluster.` making the tag extracted
        /// name `cluster.upstream_rq_timeout` and the tag value for
        /// `envoy.cluster_name` will be `foo_cluster` (note: there will be no
        /// `.` character because of the second capture group).
        ///
        /// Example 2. a stat name
        /// `http.connection_manager_1.user_agent.ios.downstream_cx_total` and two
        /// tag specifiers:
        ///
        /// .. code-block:: json
        ///
        /// \[
        /// {
        /// "tag_name": "envoy.http_user_agent",
        /// "regex": "^http(?=\\.).*?\\.user_agent\\.((.+?)\\.)\\w+?$"
        /// },
        /// {
        /// "tag_name": "envoy.http_conn_manager_prefix",
        /// "regex": "^http\\.((.*?)\\.)"
        /// }
        /// \]
        ///
        /// The two regexes of the specifiers will be processed from the elaborated
        /// stat name.
        ///
        /// The first regex will save `ios.` as the tag value for `envoy.http_user_agent`. It will
        /// leave it in the name for potential matching with additional tag specifiers. After all tag
        /// specifiers are processed the tags will be removed from the name.
        ///
        /// The second regex will populate tag `envoy.http_conn_manager_prefix` with value
        /// `connection_manager_1.`, based on the original stat name.
        ///
        /// As a final step, the matched tags are removed, leaving
        /// `http.user_agent.downstream_cx_total` as the tag extracted name.
        #[prost(string, tag = "2")]
        Regex(::prost::alloc::string::String),
        /// Specifies a fixed tag value for the `tag_name`.
        #[prost(string, tag = "3")]
        FixedValue(::prost::alloc::string::String),
    }
}
impl ::prost::Name for TagSpecifier {
    const NAME: &'static str = "TagSpecifier";
    const PACKAGE: &'static str = "envoy.config.metrics.v3";
    fn full_name() -> ::prost::alloc::string::String {
        "envoy.config.metrics.v3.TagSpecifier".into()
    }
    fn type_url() -> ::prost::alloc::string::String {
        "type.googleapis.com/envoy.config.metrics.v3.TagSpecifier".into()
    }
}
/// Specifies a matcher for stats and the buckets that matching stats should use.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HistogramBucketSettings {
    /// The stats that this rule applies to. The match is applied to the original stat name
    /// before tag-extraction, for example `cluster.exampleclustername.upstream_cx_length_ms`.
    #[prost(message, optional, tag = "1")]
    pub r#match: ::core::option::Option<
        super::super::super::r#type::matcher::v3::StringMatcher,
    >,
    /// Each value is the upper bound of a bucket. Each bucket must be greater than 0 and unique.
    /// The order of the buckets does not matter.
    #[prost(double, repeated, packed = "false", tag = "2")]
    pub buckets: ::prost::alloc::vec::Vec<f64>,
    /// Initial number of bins for the `circllhist` thread local histogram per time series. Default value is 100.
    #[prost(message, optional, tag = "3")]
    pub bins: ::core::option::Option<
        super::super::super::super::google::protobuf::UInt32Value,
    >,
}
impl ::prost::Name for HistogramBucketSettings {
    const NAME: &'static str = "HistogramBucketSettings";
    const PACKAGE: &'static str = "envoy.config.metrics.v3";
    fn full_name() -> ::prost::alloc::string::String {
        "envoy.config.metrics.v3.HistogramBucketSettings".into()
    }
    fn type_url() -> ::prost::alloc::string::String {
        "type.googleapis.com/envoy.config.metrics.v3.HistogramBucketSettings".into()
    }
}
/// Stats configuration proto schema for built-in `envoy.stat_sinks.statsd` sink. This sink does not support
/// tagged metrics.
/// \[\#extension: envoy.stat_sinks.statsd\]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StatsdSink {
    /// Optional custom prefix for StatsdSink. If
    /// specified, this will override the default prefix.
    /// For example:
    ///
    /// .. code-block:: json
    ///
    /// {
    /// "prefix" : "envoy-prod"
    /// }
    ///
    /// will change emitted stats to
    ///
    /// .. code-block:: cpp
    ///
    /// envoy-prod.test_counter:1|c
    /// envoy-prod.test_timer:5|ms
    ///
    /// Note that the default prefix, "envoy", will be used if a prefix is not
    /// specified.
    ///
    /// Stats with default prefix:
    ///
    /// .. code-block:: cpp
    ///
    /// envoy.test_counter:1|c
    /// envoy.test_timer:5|ms
    #[prost(string, tag = "3")]
    pub prefix: ::prost::alloc::string::String,
    #[prost(oneof = "statsd_sink::StatsdSpecifier", tags = "1, 2")]
    pub statsd_specifier: ::core::option::Option<statsd_sink::StatsdSpecifier>,
}
/// Nested message and enum types in `StatsdSink`.
pub mod statsd_sink {
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum StatsdSpecifier {
        /// The UDP address of a running `statsd <<https://github.com/etsy/statsd>`\_>
        /// compliant listener. If specified, statistics will be flushed to this
        /// address.
        #[prost(message, tag = "1")]
        Address(super::super::super::core::v3::Address),
        /// The name of a cluster that is running a TCP `statsd  <<https://github.com/etsy/statsd>`\_> compliant listener. If specified,
        /// Envoy will connect to this cluster to flush statistics.
        #[prost(string, tag = "2")]
        TcpClusterName(::prost::alloc::string::String),
    }
}
impl ::prost::Name for StatsdSink {
    const NAME: &'static str = "StatsdSink";
    const PACKAGE: &'static str = "envoy.config.metrics.v3";
    fn full_name() -> ::prost::alloc::string::String {
        "envoy.config.metrics.v3.StatsdSink".into()
    }
    fn type_url() -> ::prost::alloc::string::String {
        "type.googleapis.com/envoy.config.metrics.v3.StatsdSink".into()
    }
}
/// Stats configuration proto schema for built-in `envoy.stat_sinks.dog_statsd` sink.
/// The sink emits stats with `DogStatsD <<https://docs.datadoghq.com/guides/dogstatsd/>`\_>
/// compatible tags. Tags are configurable via :ref:`StatsConfig  <envoy_v3_api_msg_config.metrics.v3.StatsConfig>`.
/// \[\#extension: envoy.stat_sinks.dog_statsd\]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DogStatsdSink {
    /// Optional custom metric name prefix. See :ref:`StatsdSink's prefix field  <envoy_v3_api_field_config.metrics.v3.StatsdSink.prefix>` for more details.
    #[prost(string, tag = "3")]
    pub prefix: ::prost::alloc::string::String,
    /// Optional max datagram size to use when sending UDP messages. By default Envoy
    /// will emit one metric per datagram. By specifying a max-size larger than a single
    /// metric, Envoy will emit multiple, new-line separated metrics. The max datagram
    /// size should not exceed your network's MTU.
    ///
    /// Note that this value may not be respected if smaller than a single metric.
    #[prost(message, optional, tag = "4")]
    pub max_bytes_per_datagram: ::core::option::Option<
        super::super::super::super::google::protobuf::UInt64Value,
    >,
    #[prost(oneof = "dog_statsd_sink::DogStatsdSpecifier", tags = "1")]
    pub dog_statsd_specifier: ::core::option::Option<
        dog_statsd_sink::DogStatsdSpecifier,
    >,
}
/// Nested message and enum types in `DogStatsdSink`.
pub mod dog_statsd_sink {
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum DogStatsdSpecifier {
        /// The UDP address of a running DogStatsD compliant listener. If specified,
        /// statistics will be flushed to this address.
        #[prost(message, tag = "1")]
        Address(super::super::super::core::v3::Address),
    }
}
impl ::prost::Name for DogStatsdSink {
    const NAME: &'static str = "DogStatsdSink";
    const PACKAGE: &'static str = "envoy.config.metrics.v3";
    fn full_name() -> ::prost::alloc::string::String {
        "envoy.config.metrics.v3.DogStatsdSink".into()
    }
    fn type_url() -> ::prost::alloc::string::String {
        "type.googleapis.com/envoy.config.metrics.v3.DogStatsdSink".into()
    }
}
/// Stats configuration proto schema for built-in `envoy.stat_sinks.hystrix` sink.
/// The sink emits stats in `text/event-stream  <<https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events>`\_>
/// formatted stream for use by `Hystrix dashboard  <<https://github.com/Netflix-Skunkworks/hystrix-dashboard/wiki>`\_.>
///
/// Note that only a single HystrixSink should be configured.
///
/// Streaming is started through an admin endpoint :http:get:`/hystrix_event_stream`.
/// \[\#extension: envoy.stat_sinks.hystrix\]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct HystrixSink {
    /// The number of buckets the rolling statistical window is divided into.
    ///
    /// Each time the sink is flushed, all relevant Envoy statistics are sampled and
    /// added to the rolling window (removing the oldest samples in the window
    /// in the process). The sink then outputs the aggregate statistics across the
    /// current rolling window to the event stream(s).
    ///
    /// `rolling_window(ms)` = `stats_flush_interval(ms)` * `num_of_buckets`
    ///
    /// More detailed explanation can be found in `Hystrix wiki  <<https://github.com/Netflix/Hystrix/wiki/Metrics-and-Monitoring#hystrixrollingnumber>`\_.>
    #[prost(int64, tag = "1")]
    pub num_buckets: i64,
}
impl ::prost::Name for HystrixSink {
    const NAME: &'static str = "HystrixSink";
    const PACKAGE: &'static str = "envoy.config.metrics.v3";
    fn full_name() -> ::prost::alloc::string::String {
        "envoy.config.metrics.v3.HystrixSink".into()
    }
    fn type_url() -> ::prost::alloc::string::String {
        "type.googleapis.com/envoy.config.metrics.v3.HystrixSink".into()
    }
}
/// Metrics Service is configured as a built-in `envoy.stat_sinks.metrics_service` :ref:`StatsSink  <envoy_v3_api_msg_config.metrics.v3.StatsSink>`. This opaque configuration will be used to create
/// Metrics Service.
///
/// Example:
///
/// .. code-block:: yaml
///
/// ```text
/// stats_sinks:
///    - name: envoy.stat_sinks.metrics_service
///      typed_config:
///        "@type": type.googleapis.com/envoy.config.metrics.v3.MetricsServiceConfig
/// ```
///
/// \[\#extension: envoy.stat_sinks.metrics_service\]
/// \[\#next-free-field: 7\]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MetricsServiceConfig {
    /// The upstream gRPC cluster that hosts the metrics service.
    #[prost(message, optional, tag = "1")]
    pub grpc_service: ::core::option::Option<super::super::core::v3::GrpcService>,
    /// API version for metric service transport protocol. This describes the metric service gRPC
    /// endpoint and version of messages used on the wire.
    #[prost(enumeration = "super::super::core::v3::ApiVersion", tag = "3")]
    pub transport_api_version: i32,
    /// If true, counters are reported as the delta between flushing intervals. Otherwise, the current
    /// counter value is reported. Defaults to false.
    /// Eventually (<https://github.com/envoyproxy/envoy/issues/10968>) if this value is not set, the
    /// sink will take updates from the :ref:`MetricsResponse <envoy_v3_api_msg_service.metrics.v3.StreamMetricsResponse>`.
    #[prost(message, optional, tag = "2")]
    pub report_counters_as_deltas: ::core::option::Option<
        super::super::super::super::google::protobuf::BoolValue,
    >,
    /// If true, metrics will have their tags emitted as labels on the metrics objects sent to the MetricsService,
    /// and the tag extracted name will be used instead of the full name, which may contain values used by the tag
    /// extractor or additional tags added during stats creation.
    #[prost(bool, tag = "4")]
    pub emit_tags_as_labels: bool,
    /// Specify which metrics types to emit for histograms. Defaults to SUMMARY_AND_HISTOGRAM.
    #[prost(enumeration = "HistogramEmitMode", tag = "5")]
    pub histogram_emit_mode: i32,
    /// The maximum number of metrics to send in a single gRPC message. If not set or set to 0,
    /// all metrics will be sent in a single message (current behavior). When set to a positive value,
    /// metrics will be batched into multiple messages, with each message containing at most batch_size
    /// metric families. This helps avoid hitting gRPC message size limits (typically 4MB) when sending
    /// large numbers of metrics.
    #[prost(uint32, tag = "6")]
    pub batch_size: u32,
}
impl ::prost::Name for MetricsServiceConfig {
    const NAME: &'static str = "MetricsServiceConfig";
    const PACKAGE: &'static str = "envoy.config.metrics.v3";
    fn full_name() -> ::prost::alloc::string::String {
        "envoy.config.metrics.v3.MetricsServiceConfig".into()
    }
    fn type_url() -> ::prost::alloc::string::String {
        "type.googleapis.com/envoy.config.metrics.v3.MetricsServiceConfig".into()
    }
}
/// HistogramEmitMode is used to configure which metric types should be emitted for histograms.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum HistogramEmitMode {
    /// Emit Histogram and Summary metric types.
    SummaryAndHistogram = 0,
    /// Emit only Summary metric types.
    Summary = 1,
    /// Emit only Histogram metric types.
    Histogram = 2,
}
impl HistogramEmitMode {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::SummaryAndHistogram => "SUMMARY_AND_HISTOGRAM",
            Self::Summary => "SUMMARY",
            Self::Histogram => "HISTOGRAM",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "SUMMARY_AND_HISTOGRAM" => Some(Self::SummaryAndHistogram),
            "SUMMARY" => Some(Self::Summary),
            "HISTOGRAM" => Some(Self::Histogram),
            _ => None,
        }
    }
}