Skip to content

Commit 2acb78b

Browse files
committed
Extract stats sink proto
Signed-off-by: Taiki Ono <taiks.4559@gmail.com>
1 parent 2d4b900 commit 2acb78b

5 files changed

Lines changed: 49 additions & 27 deletions

File tree

api/BUILD

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ api_proto_library(
2828
":cds",
2929
":lds",
3030
":sds",
31+
":stats",
3132
],
3233
)
3334

@@ -135,6 +136,14 @@ api_proto_library(
135136
],
136137
)
137138

139+
api_proto_library(
140+
name = "stats",
141+
srcs = ["stats.proto"],
142+
deps = [
143+
":address",
144+
],
145+
)
146+
138147
# TODO(htuch): Grow this to cover everything we want to generate docs for, so we can just invoke
139148
# bazel build //api --aspects tools/protodoc/protodoc.bzl%proto_doc_aspect --output_groups=rst
140149
proto_library(

api/bootstrap.proto

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import "api/base.proto";
1212
import "api/cds.proto";
1313
import "api/lds.proto";
1414
import "api/sds.proto";
15+
import "api/stats.proto";
1516

1617
import "google/protobuf/duration.proto";
1718
import "google/protobuf/struct.proto";
@@ -203,38 +204,12 @@ message ClusterManager {
203204
ApiConfigSource load_stats_config = 4;
204205
}
205206

206-
// Stats configuration proto schema for built-in *envoy.statsd* sink.
207-
message StatsdSink {
208-
oneof statsd_specifier {
209-
option (validate.required) = true;
210-
211-
// The UDP address of a running `statsd <https://github.com/etsy/statsd>`_
212-
// compliant listener. If specified, statistics will be flushed to this
213-
// address.
214-
Address address = 1;
215-
216-
// The name of a cluster that is running a TCP `statsd
217-
// <https://github.com/etsy/statsd>`_ compliant listener. If specified,
218-
// Envoy will connect to this cluster to flush statistics.
219-
string tcp_cluster_name = 2;
220-
}
221-
}
222-
223-
// Stats configuration proto schema for built-in *envoy.dog_statsd* sink.
224-
// The sink emits stats with `DogStatsD <https://docs.datadoghq.com/guides/dogstatsd/>`_
225-
// compatible tags. Tags are configurable via :ref:`StatsConfig <envoy_api_msg_StatsConfig>`.
226-
message DogStatsdSink {
227-
// The UDP address of a running DogStatsD compliant listener. If specified,
228-
// statistics will be flushed to this address.
229-
Address address = 1 [(validate.rules).message.required = true];
230-
}
231-
232207
// Configuration for pluggable stats sinks.
233208
message StatsSink {
234209
// The name of the stats sink to instantiate. The name must match a supported
235210
// stats sink. *envoy.statsd* is a built-in sink suitable for emitting to
236211
// `statsd <https://github.com/etsy/statsd>`_. Any other built-in stats sink
237-
// can be found in
212+
// can be found in :ref:`Stats sinks<envoy_api_file_api/stats.proto>` or
238213
// `well_known_names.h
239214
// <https://github.com/envoyproxy/envoy/blob/master/source/common/config/well_known_names.h>`_
240215
// in the Envoy repository.

api/stats.proto

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// [#protodoc-title: Stats sinks]
2+
// Protos for each pluggable stats sink configuration.
3+
4+
syntax = "proto3";
5+
6+
package envoy.api.v2;
7+
8+
import "api/address.proto";
9+
10+
import "validate/validate.proto";
11+
12+
// Stats configuration proto schema for built-in *envoy.statsd* sink.
13+
message StatsdSink {
14+
oneof statsd_specifier {
15+
option (validate.required) = true;
16+
17+
// The UDP address of a running `statsd <https://github.com/etsy/statsd>`_
18+
// compliant listener. If specified, statistics will be flushed to this
19+
// address.
20+
Address address = 1;
21+
22+
// The name of a cluster that is running a TCP `statsd
23+
// <https://github.com/etsy/statsd>`_ compliant listener. If specified,
24+
// Envoy will connect to this cluster to flush statistics.
25+
string tcp_cluster_name = 2;
26+
}
27+
}
28+
29+
// Stats configuration proto schema for built-in *envoy.dog_statsd* sink.
30+
// The sink emits stats with `DogStatsD <https://docs.datadoghq.com/guides/dogstatsd/>`_
31+
// compatible tags. Tags are configurable via :ref:`StatsConfig <envoy_api_msg_StatsConfig>`.
32+
message DogStatsdSink {
33+
// The UDP address of a running DogStatsD compliant listener. If specified,
34+
// statistics will be flushed to this address.
35+
Address address = 1 [(validate.rules).message.required = true];
36+
}

docs/build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ PROTO_RST="
3737
/api/rds/api/rds.proto.rst
3838
/api/rls/api/rls.proto.rst
3939
/api/sds/api/sds.proto.rst
40+
/api/stats/api/stats.proto.rst
4041
/api/filter/accesslog/accesslog/api/filter/accesslog/accesslog.proto.rst
4142
/api/filter/fault/api/filter/fault.proto.rst
4243
/api/filter/http/buffer/api/filter/http/buffer.proto.rst

docs/root/api-v2/api.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ v2 API reference
1414
health_check.proto
1515
rds.proto
1616
sds.proto
17+
stats.proto
1718
base.proto
1819
address.proto
1920
protocol.proto

0 commit comments

Comments
 (0)