@@ -7,8 +7,122 @@ package envoy.api.v2;
77
88import "api/address.proto" ;
99
10+ import "google/protobuf/struct.proto" ;
11+ import "google/protobuf/wrappers.proto" ;
12+
1013import "validate/validate.proto" ;
1114
15+ // Configuration for pluggable stats sinks.
16+ message StatsSink {
17+ // The name of the stats sink to instantiate. The name must match a supported
18+ // stats sink. *envoy.statsd* is a built-in sink suitable for emitting to
19+ // `statsd <https://github.com/etsy/statsd>`_. Any other built-in stats sink
20+ // can be found in `well_known_names.h
21+ // <https://github.com/envoyproxy/envoy/blob/master/source/common/config/well_known_names.h>`_
22+ // in the Envoy repository.
23+ string name = 1 ;
24+
25+ // Stats sink specific configuration which depends on the sink being
26+ // instantiated. See :ref:`StatsdSink <envoy_api_msg_StatsdSink>` for an
27+ // example.
28+ google.protobuf.Struct config = 2 ;
29+ }
30+
31+ // Statistics :ref:`architecture overview <arch_overview_statistics>`.
32+ message StatsConfig {
33+ // Each stat name is iteratively processed through these tag specifiers.
34+ // When a tag is matched, the first capture group is removed from the name so
35+ // later :ref:`TagSpecifiers <envoy_api_msg_TagSpecifier>` cannot match that
36+ // same portion of the match.
37+ repeated TagSpecifier stats_tags = 1 ;
38+
39+ // Use all default tag regexes specified in Envoy. These can be combined with
40+ // custom tags specified in :ref:`stats_tags
41+ // <envoy_api_field_StatsConfig.stats_tags>`. They will be processed before
42+ // the custom tags.
43+ //
44+ // .. note::
45+ //
46+ // If any default tags are specified twice, the config will be considered
47+ // invalid.
48+ //
49+ // See `well_known_names.h
50+ // <https://github.com/envoyproxy/envoy/blob/master/source/common/config/well_known_names.h>`_
51+ // for a list of the default tags in Envoy.
52+ //
53+ // If not provided, the value is assumed to be true.
54+ google.protobuf.BoolValue use_all_default_tags = 2 ;
55+ }
56+
57+ // Designates a tag to strip from the tag extracted name and provide as a named
58+ // tag value for all statistics. This will only occur if any part of the name
59+ // matches the regex provided with one or more capture groups.
60+ message TagSpecifier {
61+ // Attaches an identifier to the tag values to identify the tag being in the
62+ // sink. Envoy has a set of default names and regexes to extract dynamic
63+ // portions of existing stats, which can be found in `well_known_names.h
64+ // <https://github.com/envoyproxy/envoy/blob/master/source/common/config/well_known_names.h>`_
65+ // in the Envoy repository. If a :ref:`tag_name
66+ // <envoy_api_field_TagSpecifier.tag_name>` is provided in the config with an
67+ // empty regex, Envoy will attempt to find that name in its set of defaults
68+ // and use the accompanying regex.
69+ //
70+ // .. note::
71+ //
72+ // If any default tags are specified twice, the config will be considered
73+ // invalid.
74+ string tag_name = 1 ;
75+
76+ // The first capture group identifies the portion of the name to remove. The
77+ // second capture group (which will normally be nested inside the first) will
78+ // designate the value of the tag for the statistic. If no second capture
79+ // group is provided, the first will also be used to set the value of the tag.
80+ // All other capture groups will be ignored.
81+ //
82+ // Take for example, with a stat name ``cluster.foo_cluster.upstream_rq_timeout``
83+ // and
84+ //
85+ // .. code-block:: json
86+ //
87+ // {
88+ // "tag_name": "envoy.cluster_name",
89+ // "regex": "^cluster\.((.+?)\.)"
90+ // }
91+ //
92+ // Note that the regex will remove ``foo_cluster.`` making the tag extracted
93+ // name ``cluster.upstream_rq_timeout`` and the tag value for
94+ // ``envoy.cluster_name`` will be ``foo_cluster`` (note: there will be no
95+ // ``.`` character because of the second capture group).
96+ //
97+ // An example with two regexes and stat name
98+ // ``http.connection_manager_1.user_agent.ios.downstream_cx_total``:
99+ //
100+ // .. code-block:: json
101+ //
102+ // [
103+ // {
104+ // "tag_name": "envoy.http_user_agent",
105+ // "regex": "^http(?=\.).*?\.user_agent\.((.+?)\.)\w+?$"
106+ // },
107+ // {
108+ // "tag_name": "envoy.http_conn_manager_prefix",
109+ // "regex": "^http\.((.*?)\.)"
110+ // }
111+ // ]
112+ //
113+ // The first regex will remove ``ios.``, leaving the tag extracted name
114+ // ``http.connection_manager_1.user_agent.downstream_cx_total``. The tag
115+ // ``envoy.http_user_agent`` will be added with tag value ``ios``.
116+ //
117+ // The second regex will remove ``connection_manager_1.`` from the tag
118+ // extracted name produced by the first regex
119+ // ``http.connection_manager_1.user_agent.downstream_cx_total``, leaving
120+ // ``http.user_agent.downstream_cx_total`` as the tag extracted name. The tag
121+ // ``envoy.http_conn_manager_prefix`` will be added with the tag value
122+ // ``connection_manager_1``.
123+ string regex = 2 ;
124+ }
125+
12126// Stats configuration proto schema for built-in *envoy.statsd* sink.
13127message StatsdSink {
14128 oneof statsd_specifier {
0 commit comments