@opentelemetry/otlp-grpc-exporter-base 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +31 -0
  3. package/build/protos/opentelemetry/proto/collector/README.md +9 -0
  4. package/build/protos/opentelemetry/proto/collector/logs/v1/logs_service.proto +48 -0
  5. package/build/protos/opentelemetry/proto/collector/metrics/v1/metrics_service.proto +45 -0
  6. package/build/protos/opentelemetry/proto/collector/trace/v1/trace_service.proto +45 -0
  7. package/build/protos/opentelemetry/proto/common/v1/common.proto +77 -0
  8. package/build/protos/opentelemetry/proto/logs/v1/logs.proto +131 -0
  9. package/build/protos/opentelemetry/proto/metrics/experimental/configservice.proto +102 -0
  10. package/build/protos/opentelemetry/proto/metrics/v1/metrics.proto +569 -0
  11. package/build/protos/opentelemetry/proto/resource/v1/resource.proto +34 -0
  12. package/build/protos/opentelemetry/proto/trace/v1/trace.proto +315 -0
  13. package/build/protos/opentelemetry/proto/trace/v1/trace_config.proto +78 -0
  14. package/build/src/OTLPGRPCExporterNodeBase.d.ts +23 -0
  15. package/build/src/OTLPGRPCExporterNodeBase.js +89 -0
  16. package/build/src/OTLPGRPCExporterNodeBase.js.map +1 -0
  17. package/build/src/index.d.ts +4 -0
  18. package/build/src/index.js +35 -0
  19. package/build/src/index.js.map +1 -0
  20. package/build/src/types.d.ts +30 -0
  21. package/build/src/types.js +24 -0
  22. package/build/src/types.js.map +1 -0
  23. package/build/src/util.d.ts +15 -0
  24. package/build/src/util.js +127 -0
  25. package/build/src/util.js.map +1 -0
  26. package/build/src/version.d.ts +2 -0
  27. package/build/src/version.js +21 -0
  28. package/build/src/version.js.map +1 -0
  29. package/package.json +80 -0
@@ -0,0 +1,102 @@
1
+ // Copyright 2019, OpenTelemetry Authors
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ syntax = "proto3";
16
+
17
+ package opentelemetry.proto.metrics.experimental;
18
+
19
+ import "opentelemetry/proto/resource/v1/resource.proto";
20
+
21
+ option java_multiple_files = true;
22
+ option java_package = "io.opentelemetry.proto.metrics.experimental";
23
+ option java_outer_classname = "MetricConfigServiceProto";
24
+ option go_package = "github.com/open-telemetry/opentelemetry-proto/gen/go/metrics/experimental";
25
+
26
+ // MetricConfig is a service that enables updating metric schedules, trace
27
+ // parameters, and other configurations on the SDK without having to restart the
28
+ // instrumented application. The collector can also serve as the configuration
29
+ // service, acting as a bridge between third-party configuration services and
30
+ // the SDK, piping updated configs from a third-party source to an instrumented
31
+ // application.
32
+ service MetricConfig {
33
+ rpc GetMetricConfig (MetricConfigRequest) returns (MetricConfigResponse);
34
+ }
35
+
36
+ message MetricConfigRequest{
37
+
38
+ // Required. The resource for which configuration should be returned.
39
+ opentelemetry.proto.resource.v1.Resource resource = 1;
40
+
41
+ // Optional. The value of MetricConfigResponse.fingerprint for the last
42
+ // configuration that the caller received and successfully applied.
43
+ bytes last_known_fingerprint = 2;
44
+ }
45
+
46
+ message MetricConfigResponse {
47
+
48
+ // Optional. The fingerprint associated with this MetricConfigResponse. Each
49
+ // change in configs yields a different fingerprint. The resource SHOULD copy
50
+ // this value to MetricConfigRequest.last_known_fingerprint for the next
51
+ // configuration request. If there are no changes between fingerprint and
52
+ // MetricConfigRequest.last_known_fingerprint, then all other fields besides
53
+ // fingerprint in the response are optional, or the same as the last update if
54
+ // present.
55
+ //
56
+ // The exact mechanics of generating the fingerprint is up to the
57
+ // implementation. However, a fingerprint must be deterministically determined
58
+ // by the configurations -- the same configuration will generate the same
59
+ // fingerprint on any instance of an implementation. Hence using a timestamp is
60
+ // unacceptable, but a deterministic hash is fine.
61
+ bytes fingerprint = 1;
62
+
63
+ // A Schedule is used to apply a particular scheduling configuration to
64
+ // a metric. If a metric name matches a schedule's patterns, then the metric
65
+ // adopts the configuration specified by the schedule.
66
+ message Schedule {
67
+
68
+ // A light-weight pattern that can match 1 or more
69
+ // metrics, for which this schedule will apply. The string is used to
70
+ // match against metric names. It should not exceed 100k characters.
71
+ message Pattern {
72
+ oneof match {
73
+ string equals = 1; // matches the metric name exactly
74
+ string starts_with = 2; // prefix-matches the metric name
75
+ }
76
+ }
77
+
78
+ // Metrics with names that match a rule in the inclusion_patterns are
79
+ // targeted by this schedule. Metrics that match the exclusion_patterns
80
+ // are not targeted for this schedule, even if they match an inclusion
81
+ // pattern.
82
+ repeated Pattern exclusion_patterns = 1;
83
+ repeated Pattern inclusion_patterns = 2;
84
+
85
+ // Describes the collection period for each metric in seconds.
86
+ // A period of 0 means to not export.
87
+ int32 period_sec = 3;
88
+ }
89
+
90
+ // A single metric may match multiple schedules. In such cases, the schedule
91
+ // that specifies the smallest period is applied.
92
+ //
93
+ // Note, for optimization purposes, it is recommended to use as few schedules
94
+ // as possible to capture all required metric updates. Where you can be
95
+ // conservative, do take full advantage of the inclusion/exclusion patterns to
96
+ // capture as much of your targeted metrics.
97
+ repeated Schedule schedules = 2;
98
+
99
+ // Optional. The client is suggested to wait this long (in seconds) before
100
+ // pinging the configuration service again.
101
+ int32 suggested_wait_time_sec = 3;
102
+ }
@@ -0,0 +1,569 @@
1
+ // Copyright 2019, OpenTelemetry Authors
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ syntax = "proto3";
16
+
17
+ package opentelemetry.proto.metrics.v1;
18
+
19
+ import "opentelemetry/proto/common/v1/common.proto";
20
+ import "opentelemetry/proto/resource/v1/resource.proto";
21
+
22
+ option java_multiple_files = true;
23
+ option java_package = "io.opentelemetry.proto.metrics.v1";
24
+ option java_outer_classname = "MetricsProto";
25
+ option go_package = "github.com/open-telemetry/opentelemetry-proto/gen/go/metrics/v1";
26
+
27
+ // A collection of InstrumentationLibraryMetrics from a Resource.
28
+ message ResourceMetrics {
29
+ // The resource for the metrics in this message.
30
+ // If this field is not set then no resource info is known.
31
+ opentelemetry.proto.resource.v1.Resource resource = 1;
32
+
33
+ // A list of metrics that originate from a resource.
34
+ repeated InstrumentationLibraryMetrics instrumentation_library_metrics = 2;
35
+ }
36
+
37
+ // A collection of Metrics produced by an InstrumentationLibrary.
38
+ message InstrumentationLibraryMetrics {
39
+ // The instrumentation library information for the metrics in this message.
40
+ // If this field is not set then no library info is known.
41
+ opentelemetry.proto.common.v1.InstrumentationLibrary instrumentation_library = 1;
42
+
43
+ // A list of metrics that originate from an instrumentation library.
44
+ repeated Metric metrics = 2;
45
+ }
46
+
47
+ // Defines a Metric which has one or more timeseries.
48
+ //
49
+ // The data model and relation between entities is shown in the
50
+ // diagram below. Here, "DataPoint" is the term used to refer to any
51
+ // one of the specific data point value types, and "points" is the term used
52
+ // to refer to any one of the lists of points contained in the Metric.
53
+ //
54
+ // - Metric is composed of a metadata and data.
55
+ // - Metadata part contains a name, description, unit.
56
+ // - Data is one of the possible types (Gauge, Sum, Histogram, etc.).
57
+ // - DataPoint contains timestamps, labels, and one of the possible value type
58
+ // fields.
59
+ //
60
+ // Metric
61
+ // +------------+
62
+ // |name |
63
+ // |description |
64
+ // |unit | +---------------------------+
65
+ // |data |---> |Gauge, Sum, Histogram, ... |
66
+ // +------------+ +---------------------------+
67
+ //
68
+ // Data [One of Gauge, Sum, Histogram, ...]
69
+ // +-----------+
70
+ // |... | // Metadata about the Data.
71
+ // |points |--+
72
+ // +-----------+ |
73
+ // | +---------------------------+
74
+ // | |DataPoint 1 |
75
+ // v |+------+------+ +------+ |
76
+ // +-----+ ||label |label |...|label | |
77
+ // | 1 |-->||value1|value2|...|valueN| |
78
+ // +-----+ |+------+------+ +------+ |
79
+ // | . | |+-----+ |
80
+ // | . | ||value| |
81
+ // | . | |+-----+ |
82
+ // | . | +---------------------------+
83
+ // | . | .
84
+ // | . | .
85
+ // | . | .
86
+ // | . | +---------------------------+
87
+ // | . | |DataPoint M |
88
+ // +-----+ |+------+------+ +------+ |
89
+ // | M |-->||label |label |...|label | |
90
+ // +-----+ ||value1|value2|...|valueN| |
91
+ // |+------+------+ +------+ |
92
+ // |+-----+ |
93
+ // ||value| |
94
+ // |+-----+ |
95
+ // +---------------------------+
96
+ //
97
+ // All DataPoint types have three common fields:
98
+ // - Labels zero or more key-value pairs associated with the data point.
99
+ // - StartTimeUnixNano MUST be set to the start of the interval when the data's
100
+ // type includes an AggregationTemporality. This field is not set otherwise.
101
+ // - TimeUnixNano MUST be set to:
102
+ // - the moment when an aggregation is reported (independent of the
103
+ // aggregation temporality).
104
+ // - the instantaneous time of the event.
105
+ message Metric {
106
+ // name of the metric, including its DNS name prefix. It must be unique.
107
+ string name = 1;
108
+
109
+ // description of the metric, which can be used in documentation.
110
+ string description = 2;
111
+
112
+ // unit in which the metric value is reported. Follows the format
113
+ // described by http://unitsofmeasure.org/ucum.html.
114
+ string unit = 3;
115
+
116
+ // TODO: Decide if support for RawMeasurements (measurements recorded using
117
+ // the synchronous instruments) is necessary. It can be used to delegate the
118
+ // aggregation from the application to the agent/collector. See
119
+ // https://github.com/open-telemetry/opentelemetry-specification/issues/617
120
+
121
+ // Data determines the aggregation type (if any) of the metric, what is the
122
+ // reported value type for the data points, as well as the relatationship to
123
+ // the time interval over which they are reported.
124
+ //
125
+ // TODO: Update table after the decision on:
126
+ // https://github.com/open-telemetry/opentelemetry-specification/issues/731.
127
+ // By default, metrics recording using the OpenTelemetry API are exported as
128
+ // (the table does not include MeasurementValueType to avoid extra rows):
129
+ //
130
+ // Instrument Type
131
+ // ----------------------------------------------
132
+ // Counter Sum(aggregation_temporality=delta;is_monotonic=true)
133
+ // UpDownCounter Sum(aggregation_temporality=delta;is_monotonic=false)
134
+ // ValueRecorder TBD
135
+ // SumObserver Sum(aggregation_temporality=cumulative;is_monotonic=true)
136
+ // UpDownSumObserver Sum(aggregation_temporality=cumulative;is_monotonic=false)
137
+ // ValueObserver Gauge()
138
+ oneof data {
139
+ IntGauge int_gauge = 4;
140
+ DoubleGauge double_gauge = 5;
141
+ IntSum int_sum = 6;
142
+ DoubleSum double_sum = 7;
143
+ IntHistogram int_histogram = 8;
144
+ DoubleHistogram double_histogram = 9;
145
+ }
146
+ }
147
+
148
+ // Gauge represents the type of a int scalar metric that always exports the
149
+ // "current value" for every data point. It should be used for an "unknown"
150
+ // aggregation.
151
+ //
152
+ // A Gauge does not support different aggregation temporalities. Given the
153
+ // aggregation is unknown, points cannot be combined using the same
154
+ // aggregation, regardless of aggregation temporalities. Therefore,
155
+ // AggregationTemporality is not included. Consequently, this also means
156
+ // "StartTimeUnixNano" is ignored for all data points.
157
+ message IntGauge {
158
+ repeated IntDataPoint data_points = 1;
159
+ }
160
+
161
+ // Gauge represents the type of a double scalar metric that always exports the
162
+ // "current value" for every data point. It should be used for an "unknown"
163
+ // aggregation.
164
+ //
165
+ // A Gauge does not support different aggregation temporalities. Given the
166
+ // aggregation is unknown, points cannot be combined using the same
167
+ // aggregation, regardless of aggregation temporalities. Therefore,
168
+ // AggregationTemporality is not included. Consequently, this also means
169
+ // "StartTimeUnixNano" is ignored for all data points.
170
+ message DoubleGauge {
171
+ repeated DoubleDataPoint data_points = 1;
172
+ }
173
+
174
+ // Sum represents the type of a numeric int scalar metric that is calculated as
175
+ // a sum of all reported measurements over a time interval.
176
+ message IntSum {
177
+ repeated IntDataPoint data_points = 1;
178
+
179
+ // aggregation_temporality describes if the aggregator reports delta changes
180
+ // since last report time, or cumulative changes since a fixed start time.
181
+ AggregationTemporality aggregation_temporality = 2;
182
+
183
+ // If "true" means that the sum is monotonic.
184
+ bool is_monotonic = 3;
185
+ }
186
+
187
+ // Sum represents the type of a numeric double scalar metric that is calculated
188
+ // as a sum of all reported measurements over a time interval.
189
+ message DoubleSum {
190
+ repeated DoubleDataPoint data_points = 1;
191
+
192
+ // aggregation_temporality describes if the aggregator reports delta changes
193
+ // since last report time, or cumulative changes since a fixed start time.
194
+ AggregationTemporality aggregation_temporality = 2;
195
+
196
+ // If "true" means that the sum is monotonic.
197
+ bool is_monotonic = 3;
198
+ }
199
+
200
+ // Represents the type of a metric that is calculated by aggregating as a
201
+ // Histogram of all reported int measurements over a time interval.
202
+ message IntHistogram {
203
+ repeated IntHistogramDataPoint data_points = 1;
204
+
205
+ // aggregation_temporality describes if the aggregator reports delta changes
206
+ // since last report time, or cumulative changes since a fixed start time.
207
+ AggregationTemporality aggregation_temporality = 2;
208
+ }
209
+
210
+ // Represents the type of a metric that is calculated by aggregating as a
211
+ // Histogram of all reported double measurements over a time interval.
212
+ message DoubleHistogram {
213
+ repeated DoubleHistogramDataPoint data_points = 1;
214
+
215
+ // aggregation_temporality describes if the aggregator reports delta changes
216
+ // since last report time, or cumulative changes since a fixed start time.
217
+ AggregationTemporality aggregation_temporality = 2;
218
+ }
219
+
220
+ // AggregationTemporality defines how a metric aggregator reports aggregated
221
+ // values. It describes how those values relate to the time interval over
222
+ // which they are aggregated.
223
+ enum AggregationTemporality {
224
+ // UNSPECIFIED is the default AggregationTemporality, it MUST not be used.
225
+ AGGREGATION_TEMPORALITY_UNSPECIFIED = 0;
226
+
227
+ // DELTA is an AggregationTemporality for a metric aggregator which reports
228
+ // changes since last report time. Successive metrics contain aggregation of
229
+ // values from continuous and non-overlapping intervals.
230
+ //
231
+ // The values for a DELTA metric are based only on the time interval
232
+ // associated with one measurement cycle. There is no dependency on
233
+ // previous measurements like is the case for CUMULATIVE metrics.
234
+ //
235
+ // For example, consider a system measuring the number of requests that
236
+ // it receives and reports the sum of these requests every second as a
237
+ // DELTA metric:
238
+ //
239
+ // 1. The system starts receiving at time=t_0.
240
+ // 2. A request is received, the system measures 1 request.
241
+ // 3. A request is received, the system measures 1 request.
242
+ // 4. A request is received, the system measures 1 request.
243
+ // 5. The 1 second collection cycle ends. A metric is exported for the
244
+ // number of requests received over the interval of time t_0 to
245
+ // t_0+1 with a value of 3.
246
+ // 6. A request is received, the system measures 1 request.
247
+ // 7. A request is received, the system measures 1 request.
248
+ // 8. The 1 second collection cycle ends. A metric is exported for the
249
+ // number of requests received over the interval of time t_0+1 to
250
+ // t_0+2 with a value of 2.
251
+ AGGREGATION_TEMPORALITY_DELTA = 1;
252
+
253
+ // CUMULATIVE is an AggregationTemporality for a metic aggregator which
254
+ // reports changes since a fixed start time. This means that current values
255
+ // of a CUMULATIVE metric depend on all previous measurements since the
256
+ // start time. Because of this, the sender is required to retain this state
257
+ // in some form. If this state is lost or invalidated, the CUMULATIVE metric
258
+ // values MUST be reset and a new fixed start time following the last
259
+ // reported measurement time sent MUST be used.
260
+ //
261
+ // For example, consider a system measuring the number of requests that
262
+ // it receives and reports the sum of these requests every second as a
263
+ // CUMULATIVE metric:
264
+ //
265
+ // 1. The system starts receiving at time=t_0.
266
+ // 2. A request is received, the system measures 1 request.
267
+ // 3. A request is received, the system measures 1 request.
268
+ // 4. A request is received, the system measures 1 request.
269
+ // 5. The 1 second collection cycle ends. A metric is exported for the
270
+ // number of requests received over the interval of time t_0 to
271
+ // t_0+1 with a value of 3.
272
+ // 6. A request is received, the system measures 1 request.
273
+ // 7. A request is received, the system measures 1 request.
274
+ // 8. The 1 second collection cycle ends. A metric is exported for the
275
+ // number of requests received over the interval of time t_0 to
276
+ // t_0+2 with a value of 5.
277
+ // 9. The system experiences a fault and loses state.
278
+ // 10. The system recovers and resumes receiving at time=t_1.
279
+ // 11. A request is received, the system measures 1 request.
280
+ // 12. The 1 second collection cycle ends. A metric is exported for the
281
+ // number of requests received over the interval of time t_1 to
282
+ // t_0+1 with a value of 1.
283
+ //
284
+ // Note: Even though, when reporting changes since last report time, using
285
+ // CUMULATIVE is valid, it is not recommended. This may cause problems for
286
+ // systems that do not use start_time to determine when the aggregation
287
+ // value was reset (e.g. Prometheus).
288
+ AGGREGATION_TEMPORALITY_CUMULATIVE = 2;
289
+ }
290
+
291
+ // IntDataPoint is a single data point in a timeseries that describes the
292
+ // time-varying values of a int64 metric.
293
+ message IntDataPoint {
294
+ // The set of labels that uniquely identify this timeseries.
295
+ repeated opentelemetry.proto.common.v1.StringKeyValue labels = 1;
296
+
297
+ // start_time_unix_nano is the last time when the aggregation value was reset
298
+ // to "zero". For some metric types this is ignored, see data types for more
299
+ // details.
300
+ //
301
+ // The aggregation value is over the time interval (start_time_unix_nano,
302
+ // time_unix_nano].
303
+ //
304
+ // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
305
+ // 1970.
306
+ //
307
+ // Value of 0 indicates that the timestamp is unspecified. In that case the
308
+ // timestamp may be decided by the backend.
309
+ fixed64 start_time_unix_nano = 2;
310
+
311
+ // time_unix_nano is the moment when this aggregation value was reported.
312
+ //
313
+ // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
314
+ // 1970.
315
+ fixed64 time_unix_nano = 3;
316
+
317
+ // value itself.
318
+ sfixed64 value = 4;
319
+
320
+ // (Optional) List of exemplars collected from
321
+ // measurements that were used to form the data point
322
+ repeated IntExemplar exemplars = 5;
323
+ }
324
+
325
+ // DoubleDataPoint is a single data point in a timeseries that describes the
326
+ // time-varying value of a double metric.
327
+ message DoubleDataPoint {
328
+ // The set of labels that uniquely identify this timeseries.
329
+ repeated opentelemetry.proto.common.v1.StringKeyValue labels = 1;
330
+
331
+ // start_time_unix_nano is the last time when the aggregation value was reset
332
+ // to "zero". For some metric types this is ignored, see data types for more
333
+ // details.
334
+ //
335
+ // The aggregation value is over the time interval (start_time_unix_nano,
336
+ // time_unix_nano].
337
+ //
338
+ // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
339
+ // 1970.
340
+ //
341
+ // Value of 0 indicates that the timestamp is unspecified. In that case the
342
+ // timestamp may be decided by the backend.
343
+ fixed64 start_time_unix_nano = 2;
344
+
345
+ // time_unix_nano is the moment when this aggregation value was reported.
346
+ //
347
+ // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
348
+ // 1970.
349
+ fixed64 time_unix_nano = 3;
350
+
351
+ // value itself.
352
+ double value = 4;
353
+
354
+ // (Optional) List of exemplars collected from
355
+ // measurements that were used to form the data point
356
+ repeated DoubleExemplar exemplars = 5;
357
+ }
358
+
359
+ // IntHistogramDataPoint is a single data point in a timeseries that describes
360
+ // the time-varying values of a Histogram of int values. A Histogram contains
361
+ // summary statistics for a population of values, it may optionally contain
362
+ // the distribution of those values across a set of buckets.
363
+ message IntHistogramDataPoint {
364
+ // The set of labels that uniquely identify this timeseries.
365
+ repeated opentelemetry.proto.common.v1.StringKeyValue labels = 1;
366
+
367
+ // start_time_unix_nano is the last time when the aggregation value was reset
368
+ // to "zero". For some metric types this is ignored, see data types for more
369
+ // details.
370
+ //
371
+ // The aggregation value is over the time interval (start_time_unix_nano,
372
+ // time_unix_nano].
373
+ //
374
+ // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
375
+ // 1970.
376
+ //
377
+ // Value of 0 indicates that the timestamp is unspecified. In that case the
378
+ // timestamp may be decided by the backend.
379
+ fixed64 start_time_unix_nano = 2;
380
+
381
+ // time_unix_nano is the moment when this aggregation value was reported.
382
+ //
383
+ // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
384
+ // 1970.
385
+ fixed64 time_unix_nano = 3;
386
+
387
+ // count is the number of values in the population. Must be non-negative. This
388
+ // value must be equal to the sum of the "count" fields in buckets if a
389
+ // histogram is provided.
390
+ fixed64 count = 4;
391
+
392
+ // sum of the values in the population. If count is zero then this field
393
+ // must be zero. This value must be equal to the sum of the "sum" fields in
394
+ // buckets if a histogram is provided.
395
+ sfixed64 sum = 5;
396
+
397
+ // bucket_counts is an optional field contains the count values of histogram
398
+ // for each bucket.
399
+ //
400
+ // The sum of the bucket_counts must equal the value in the count field.
401
+ //
402
+ // The number of elements in bucket_counts array must be by one greater than
403
+ // the number of elements in explicit_bounds array.
404
+ repeated fixed64 bucket_counts = 6;
405
+
406
+ // A histogram may optionally contain the distribution of the values in the population.
407
+ // In that case one of the option fields below and "buckets" field both must be defined.
408
+ // Otherwise all option fields and "buckets" field must be omitted in which case the
409
+ // distribution of values in the histogram is unknown and only the total count and sum are known.
410
+
411
+ // explicit_bounds is the only supported bucket option currently.
412
+ // TODO: Add more bucket options.
413
+
414
+ // explicit_bounds specifies buckets with explicitly defined bounds for values.
415
+ // The bucket boundaries are described by "bounds" field.
416
+ //
417
+ // This defines size(bounds) + 1 (= N) buckets. The boundaries for bucket
418
+ // at index i are:
419
+ //
420
+ // (-infinity, bounds[i]) for i == 0
421
+ // [bounds[i-1], bounds[i]) for 0 < i < N-1
422
+ // [bounds[i], +infinity) for i == N-1
423
+ // The values in bounds array must be strictly increasing.
424
+ //
425
+ // Note: only [a, b) intervals are currently supported for each bucket except the first one.
426
+ // If we decide to also support (a, b] intervals we should add support for these by defining
427
+ // a boolean value which decides what type of intervals to use.
428
+ repeated double explicit_bounds = 7;
429
+
430
+ // (Optional) List of exemplars collected from
431
+ // measurements that were used to form the data point
432
+ repeated IntExemplar exemplars = 8;
433
+ }
434
+
435
+ // HistogramDataPoint is a single data point in a timeseries that describes the
436
+ // time-varying values of a Histogram of double values. A Histogram contains
437
+ // summary statistics for a population of values, it may optionally contain the
438
+ // distribution of those values across a set of buckets.
439
+ message DoubleHistogramDataPoint {
440
+ // The set of labels that uniquely identify this timeseries.
441
+ repeated opentelemetry.proto.common.v1.StringKeyValue labels = 1;
442
+
443
+ // start_time_unix_nano is the last time when the aggregation value was reset
444
+ // to "zero". For some metric types this is ignored, see data types for more
445
+ // details.
446
+ //
447
+ // The aggregation value is over the time interval (start_time_unix_nano,
448
+ // time_unix_nano].
449
+ //
450
+ // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
451
+ // 1970.
452
+ //
453
+ // Value of 0 indicates that the timestamp is unspecified. In that case the
454
+ // timestamp may be decided by the backend.
455
+ fixed64 start_time_unix_nano = 2;
456
+
457
+ // time_unix_nano is the moment when this aggregation value was reported.
458
+ //
459
+ // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
460
+ // 1970.
461
+ fixed64 time_unix_nano = 3;
462
+
463
+ // count is the number of values in the population. Must be non-negative. This
464
+ // value must be equal to the sum of the "count" fields in buckets if a
465
+ // histogram is provided.
466
+ fixed64 count = 4;
467
+
468
+ // sum of the values in the population. If count is zero then this field
469
+ // must be zero. This value must be equal to the sum of the "sum" fields in
470
+ // buckets if a histogram is provided.
471
+ double sum = 5;
472
+
473
+ // bucket_counts is an optional field contains the count values of histogram
474
+ // for each bucket.
475
+ //
476
+ // The sum of the bucket_counts must equal the value in the count field.
477
+ //
478
+ // The number of elements in bucket_counts array must be by one greater than
479
+ // the number of elements in explicit_bounds array.
480
+ repeated fixed64 bucket_counts = 6;
481
+
482
+ // A histogram may optionally contain the distribution of the values in the population.
483
+ // In that case one of the option fields below and "buckets" field both must be defined.
484
+ // Otherwise all option fields and "buckets" field must be omitted in which case the
485
+ // distribution of values in the histogram is unknown and only the total count and sum are known.
486
+
487
+ // explicit_bounds is the only supported bucket option currently.
488
+ // TODO: Add more bucket options.
489
+
490
+ // explicit_bounds specifies buckets with explicitly defined bounds for values.
491
+ // The bucket boundaries are described by "bounds" field.
492
+ //
493
+ // This defines size(bounds) + 1 (= N) buckets. The boundaries for bucket
494
+ // at index i are:
495
+ //
496
+ // (-infinity, bounds[i]) for i == 0
497
+ // [bounds[i-1], bounds[i]) for 0 < i < N-1
498
+ // [bounds[i], +infinity) for i == N-1
499
+ // The values in bounds array must be strictly increasing.
500
+ //
501
+ // Note: only [a, b) intervals are currently supported for each bucket except the first one.
502
+ // If we decide to also support (a, b] intervals we should add support for these by defining
503
+ // a boolean value which decides what type of intervals to use.
504
+ repeated double explicit_bounds = 7;
505
+
506
+ // (Optional) List of exemplars collected from
507
+ // measurements that were used to form the data point
508
+ repeated DoubleExemplar exemplars = 8;
509
+ }
510
+
511
+ // A representation of an exemplar, which is a sample input int measurement.
512
+ // Exemplars also hold information about the environment when the measurement
513
+ // was recorded, for example the span and trace ID of the active span when the
514
+ // exemplar was recorded.
515
+ message IntExemplar {
516
+ // The set of labels that were filtered out by the aggregator, but recorded
517
+ // alongside the original measurement. Only labels that were filtered out
518
+ // by the aggregator should be included
519
+ repeated opentelemetry.proto.common.v1.StringKeyValue filtered_labels = 1;
520
+
521
+ // time_unix_nano is the exact time when this exemplar was recorded
522
+ //
523
+ // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
524
+ // 1970.
525
+ fixed64 time_unix_nano = 2;
526
+
527
+ // Numerical int value of the measurement that was recorded.
528
+ sfixed64 value = 3;
529
+
530
+ // (Optional) Span ID of the exemplar trace.
531
+ // span_id may be missing if the measurement is not recorded inside a trace
532
+ // or if the trace is not sampled.
533
+ bytes span_id = 4;
534
+
535
+ // (Optional) Trace ID of the exemplar trace.
536
+ // trace_id may be missing if the measurement is not recorded inside a trace
537
+ // or if the trace is not sampled.
538
+ bytes trace_id = 5;
539
+ }
540
+
541
+ // A representation of an exemplar, which is a sample input double measurement.
542
+ // Exemplars also hold information about the environment when the measurement
543
+ // was recorded, for example the span and trace ID of the active span when the
544
+ // exemplar was recorded.
545
+ message DoubleExemplar {
546
+ // The set of labels that were filtered out by the aggregator, but recorded
547
+ // alongside the original measurement. Only labels that were filtered out
548
+ // by the aggregator should be included
549
+ repeated opentelemetry.proto.common.v1.StringKeyValue filtered_labels = 1;
550
+
551
+ // time_unix_nano is the exact time when this exemplar was recorded
552
+ //
553
+ // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
554
+ // 1970.
555
+ fixed64 time_unix_nano = 2;
556
+
557
+ // Numerical double value of the measurement that was recorded.
558
+ double value = 3;
559
+
560
+ // (Optional) Span ID of the exemplar trace.
561
+ // span_id may be missing if the measurement is not recorded inside a trace
562
+ // or if the trace is not sampled.
563
+ bytes span_id = 4;
564
+
565
+ // (Optional) Trace ID of the exemplar trace.
566
+ // trace_id may be missing if the measurement is not recorded inside a trace
567
+ // or if the trace is not sampled.
568
+ bytes trace_id = 5;
569
+ }