This repository has been archived by the owner on Oct 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 94
/
stats.proto
138 lines (113 loc) · 4.85 KB
/
stats.proto
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
// Copyright 2016-18, OpenCensus Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package opencensus.proto.stats.v1;
import "google/protobuf/timestamp.proto";
option go_package = "github.com/census-instrumentation/opencensus-proto/gen-go/stats/v1";
option java_multiple_files = true;
option java_package = "io.opencensus.proto.stats.v1";
option java_outer_classname = "StatsProto";
option ruby_package = "OpenCensus::Proto::Stats::V1";
// TODO(bdrutu): Consider if this should be moved to a "tags" directory to match the API structure.
message Tag {
string key = 1;
string value = 2;
}
// Measure .
message Measure {
// A string by which the measure will be referred to, e.g. "rpc_server_latency". Names MUST be
// unique within the library.
string name = 1;
// Describes the measure, e.g. "RPC latency in seconds".
string description = 2;
// Describes the unit used for the Measure. Follows the format described by
// http://unitsofmeasure.org/ucum.html.
string unit = 3;
enum Type {
// Unknown type.
TYPE_UNSPECIFIED = 0;
// Indicates an int64 Measure.
INT64 = 1;
// Indicates a double Measure.
DOUBLE = 2;
}
// The type used for this Measure.
Type type = 4;
}
message View {
// A string by which the View will be referred to, e.g. "rpc_latency". Names MUST be unique
// within the library.
string name = 1;
// Describes the view, e.g. "RPC latency distribution"
string description = 2;
// The Measure to which this view is applied.
Measure measure = 3;
// An array of tag keys. These values associated with tags of this name form the basis by which
// individual stats will be aggregated (one aggregation per unique tag value). If none are
// provided, then all data is recorded in a single aggregation.
repeated string columns = 4;
// The description of the aggregation used for this view which describes how data collected are
// aggregated.
oneof aggregation {
// Counts the number of measurements recorded.
CountAggregation count_aggregation = 5;
// Indicates that data collected and aggregated with this Aggregation will be summed up.
SumAggregation sum_aggregation = 6;
// Indicates that data collected and aggregated with this Aggregation will represent the last
// recorded value. This is useful to support Gauges.
LastValueAggregation last_value_aggregation = 7;
// Indicates that the desired Aggregation is a histogram distribution. A distribution
// Aggregation may contain a histogram of the values in the population. User should define the
// bucket boundaries for that histogram (see DistributionAggregation).
DistributionAggregation distribution_aggregation = 8;
}
}
message CountAggregation {}
message SumAggregation {}
message LastValueAggregation {}
message DistributionAggregation {
// A Distribution may optionally contain a histogram of the values in the
// population. The bucket boundaries for that histogram are described by
// `bucket_bounds`. This defines `size(bucket_bounds) + 1` (= N)
// buckets. The boundaries for bucket index i are:
//
// (-infinity, bucket_bounds[i]) for i == 0
// [bucket_bounds[i-1], bucket_bounds[i]) for 0 < i < N-2
// [bucket_bounds[i-1], +infinity) for i == N-1
//
// i.e. an underflow bucket (number 0), zero or more finite buckets (1
// through N - 2, and an overflow bucket (N - 1), with inclusive lower
// bounds and exclusive upper bounds.
//
// If `bucket_bounds` has no elements (zero size), then there is no
// histogram associated with the Distribution. If `bucket_bounds` has only
// one element, there are no finite buckets, and that single element is the
// common boundary of the overflow and underflow buckets. The values must
// be monotonically increasing.
repeated double bucket_bounds = 1;
}
// Describes a data point to be collected for a Measure.
message Measurement {
repeated Tag tags = 1;
// The name of the measure to which the value is applied.
string measure_name = 2;
// The recorded value, MUST have the appropriate type to match the Measure.
oneof value {
double double_value = 3;
int64 int_value = 4;
}
// The time when this measurement was recorded. If the implementation uses a async buffer to
// record measurements this may be the time when the measurement was read from the buffer.
google.protobuf.Timestamp time = 5;
}