Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.

Commit 8ca5a12

Browse files
author
Bogdan Drutu
authored
Allow MetricDescriptor to be sent only the first time. (#78)
1 parent 554e673 commit 8ca5a12

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

opencensus/proto/metrics/v1/metrics.proto

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,22 @@ option java_outer_classname = "MetricsProto";
3131

3232
// Defines a Metric which has one or more timeseries.
3333
message Metric {
34-
// The definition of the Metric. For now, we send the full MetricDescriptor
35-
// every time in order to keep the protocol stateless, but this is one of the
36-
// places where we can make future changes to make the protocol more
37-
// efficient.
38-
MetricDescriptor metric_descriptor = 1;
34+
// The descriptor of the Metric. This is an optimization for network wire
35+
// size, from data-model perspective a Metric contains always a
36+
// MetricDescriptor.
37+
oneof descriptor {
38+
// In case of a stream reporting request can be sent only the first time
39+
// a metric is reported to save network traffic.
40+
MetricDescriptor metric_descriptor = 1;
41+
42+
// In case of a stream reporting request this can be sent for metrics that
43+
// already sent the MetricDescriptor once.
44+
string name = 2;
45+
}
3946

4047
// One or more timeseries for a single metric, where each timeseries has
4148
// one or more points.
42-
repeated TimeSeries timeseries = 2;
49+
repeated TimeSeries timeseries = 3;
4350
}
4451

4552
// Defines a metric type and its schema.

0 commit comments

Comments
 (0)