Skip to content

Commit 7ee4f1e

Browse files
committed
Move all stats related messages into stats.proto
Signed-off-by: Taiki Ono <[email protected]>
1 parent 2ffc033 commit 7ee4f1e

File tree

2 files changed

+114
-112
lines changed

2 files changed

+114
-112
lines changed

api/bootstrap.proto

Lines changed: 0 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -204,118 +204,6 @@ message ClusterManager {
204204
ApiConfigSource load_stats_config = 4;
205205
}
206206

207-
// Configuration for pluggable stats sinks.
208-
message StatsSink {
209-
// The name of the stats sink to instantiate. The name must match a supported
210-
// stats sink. *envoy.statsd* is a built-in sink suitable for emitting to
211-
// `statsd <https://github.com/etsy/statsd>`_. Any other built-in stats sink
212-
// can be found in :ref:`Stats sinks<envoy_api_file_api/stats.proto>` or
213-
// `well_known_names.h
214-
// <https://github.com/envoyproxy/envoy/blob/master/source/common/config/well_known_names.h>`_
215-
// in the Envoy repository.
216-
string name = 1;
217-
218-
// Stats sink specific configuration which depends on the sink being
219-
// instantiated. See :ref:`StatsdSink <envoy_api_msg_StatsdSink>` for an
220-
// example.
221-
google.protobuf.Struct config = 2;
222-
}
223-
224-
// Statistics :ref:`architecture overview <arch_overview_statistics>`.
225-
message StatsConfig {
226-
// Each stat name is iteratively processed through these tag specifiers.
227-
// When a tag is matched, the first capture group is removed from the name so
228-
// later :ref:`TagSpecifiers <envoy_api_msg_TagSpecifier>` cannot match that
229-
// same portion of the match.
230-
repeated TagSpecifier stats_tags = 1;
231-
232-
// Use all default tag regexes specified in Envoy. These can be combined with
233-
// custom tags specified in :ref:`stats_tags
234-
// <envoy_api_field_StatsConfig.stats_tags>`. They will be processed before
235-
// the custom tags.
236-
//
237-
// .. note::
238-
//
239-
// If any default tags are specified twice, the config will be considered
240-
// invalid.
241-
//
242-
// See `well_known_names.h
243-
// <https://github.com/envoyproxy/envoy/blob/master/source/common/config/well_known_names.h>`_
244-
// for a list of the default tags in Envoy.
245-
//
246-
// If not provided, the value is assumed to be true.
247-
google.protobuf.BoolValue use_all_default_tags = 2;
248-
}
249-
250-
// Designates a tag to strip from the tag extracted name and provide as a named
251-
// tag value for all statistics. This will only occur if any part of the name
252-
// matches the regex provided with one or more capture groups.
253-
message TagSpecifier {
254-
// Attaches an identifier to the tag values to identify the tag being in the
255-
// sink. Envoy has a set of default names and regexes to extract dynamic
256-
// portions of existing stats, which can be found in `well_known_names.h
257-
// <https://github.com/envoyproxy/envoy/blob/master/source/common/config/well_known_names.h>`_
258-
// in the Envoy repository. If a :ref:`tag_name
259-
// <envoy_api_field_TagSpecifier.tag_name>` is provided in the config with an
260-
// empty regex, Envoy will attempt to find that name in its set of defaults
261-
// and use the accompanying regex.
262-
//
263-
// .. note::
264-
//
265-
// If any default tags are specified twice, the config will be considered
266-
// invalid.
267-
string tag_name = 1;
268-
269-
// The first capture group identifies the portion of the name to remove. The
270-
// second capture group (which will normally be nested inside the first) will
271-
// designate the value of the tag for the statistic. If no second capture
272-
// group is provided, the first will also be used to set the value of the tag.
273-
// All other capture groups will be ignored.
274-
//
275-
// Take for example, with a stat name ``cluster.foo_cluster.upstream_rq_timeout``
276-
// and
277-
//
278-
// .. code-block:: json
279-
//
280-
// {
281-
// "tag_name": "envoy.cluster_name",
282-
// "regex": "^cluster\.((.+?)\.)"
283-
// }
284-
//
285-
// Note that the regex will remove ``foo_cluster.`` making the tag extracted
286-
// name ``cluster.upstream_rq_timeout`` and the tag value for
287-
// ``envoy.cluster_name`` will be ``foo_cluster`` (note: there will be no
288-
// ``.`` character because of the second capture group).
289-
//
290-
// An example with two regexes and stat name
291-
// ``http.connection_manager_1.user_agent.ios.downstream_cx_total``:
292-
//
293-
// .. code-block:: json
294-
//
295-
// [
296-
// {
297-
// "tag_name": "envoy.http_user_agent",
298-
// "regex": "^http(?=\.).*?\.user_agent\.((.+?)\.)\w+?$"
299-
// },
300-
// {
301-
// "tag_name": "envoy.http_conn_manager_prefix",
302-
// "regex": "^http\.((.*?)\.)"
303-
// }
304-
// ]
305-
//
306-
// The first regex will remove ``ios.``, leaving the tag extracted name
307-
// ``http.connection_manager_1.user_agent.downstream_cx_total``. The tag
308-
// ``envoy.http_user_agent`` will be added with tag value ``ios``.
309-
//
310-
// The second regex will remove ``connection_manager_1.`` from the tag
311-
// extracted name produced by the first regex
312-
// ``http.connection_manager_1.user_agent.downstream_cx_total``, leaving
313-
// ``http.user_agent.downstream_cx_total`` as the tag extracted name. The tag
314-
// ``envoy.http_conn_manager_prefix`` will be added with the tag value
315-
// ``connection_manager_1``.
316-
string regex = 2;
317-
}
318-
319207
// Envoy process watchdog configuration. When configured, this monitors for
320208
// nonresponsive threads and kills the process after the configured thresholds.
321209
message Watchdog {

api/stats.proto

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,122 @@ package envoy.api.v2;
77

88
import "api/address.proto";
99

10+
import "google/protobuf/struct.proto";
11+
import "google/protobuf/wrappers.proto";
12+
1013
import "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.
13127
message StatsdSink {
14128
oneof statsd_specifier {

0 commit comments

Comments
 (0)