8
8
///
9
9
/// When new fields are added into this message, the OTLP request MUST be updated
10
10
/// as well.
11
+ #[ cfg_attr( feature = "with-schemars" , derive( schemars:: JsonSchema ) ) ]
11
12
#[ cfg_attr( feature = "with-serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
12
13
#[ allow( clippy:: derive_partial_eq_without_eq) ]
13
14
#[ derive( Clone , PartialEq , :: prost:: Message ) ]
@@ -21,6 +22,7 @@ pub struct MetricsData {
21
22
pub resource_metrics : :: prost:: alloc:: vec:: Vec < ResourceMetrics > ,
22
23
}
23
24
/// A collection of ScopeMetrics from a Resource.
25
+ #[ cfg_attr( feature = "with-schemars" , derive( schemars:: JsonSchema ) ) ]
24
26
#[ cfg_attr( feature = "with-serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
25
27
#[ allow( clippy:: derive_partial_eq_without_eq) ]
26
28
#[ derive( Clone , PartialEq , :: prost:: Message ) ]
@@ -38,6 +40,7 @@ pub struct ResourceMetrics {
38
40
pub schema_url : :: prost:: alloc:: string:: String ,
39
41
}
40
42
/// A collection of Metrics produced by an Scope.
43
+ #[ cfg_attr( feature = "with-schemars" , derive( schemars:: JsonSchema ) ) ]
41
44
#[ cfg_attr( feature = "with-serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
42
45
#[ allow( clippy:: derive_partial_eq_without_eq) ]
43
46
#[ derive( Clone , PartialEq , :: prost:: Message ) ]
@@ -139,6 +142,7 @@ pub struct ScopeMetrics {
139
142
/// to support correct rate calculation. Although it may be omitted
140
143
/// when the start time is truly unknown, setting StartTimeUnixNano is
141
144
/// strongly encouraged.
145
+ #[ cfg_attr( feature = "with-schemars" , derive( schemars:: JsonSchema ) ) ]
142
146
#[ cfg_attr( feature = "with-serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
143
147
#[ allow( clippy:: derive_partial_eq_without_eq) ]
144
148
#[ derive( Clone , PartialEq , :: prost:: Message ) ]
@@ -164,6 +168,7 @@ pub mod metric {
164
168
/// Data determines the aggregation type (if any) of the metric, what is the
165
169
/// reported value type for the data points, as well as the relatationship to
166
170
/// the time interval over which they are reported.
171
+ #[ cfg_attr( feature = "with-schemars" , derive( schemars:: JsonSchema ) ) ]
167
172
#[ cfg_attr( feature = "with-serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
168
173
#[ allow( clippy:: derive_partial_eq_without_eq) ]
169
174
#[ derive( Clone , PartialEq , :: prost:: Oneof ) ]
@@ -189,6 +194,7 @@ pub mod metric {
189
194
/// aggregation, regardless of aggregation temporalities. Therefore,
190
195
/// AggregationTemporality is not included. Consequently, this also means
191
196
/// "StartTimeUnixNano" is ignored for all data points.
197
+ #[ cfg_attr( feature = "with-schemars" , derive( schemars:: JsonSchema ) ) ]
192
198
#[ cfg_attr( feature = "with-serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
193
199
#[ allow( clippy:: derive_partial_eq_without_eq) ]
194
200
#[ derive( Clone , PartialEq , :: prost:: Message ) ]
@@ -198,6 +204,7 @@ pub struct Gauge {
198
204
}
199
205
/// Sum represents the type of a scalar metric that is calculated as a sum of all
200
206
/// reported measurements over a time interval.
207
+ #[ cfg_attr( feature = "with-schemars" , derive( schemars:: JsonSchema ) ) ]
201
208
#[ cfg_attr( feature = "with-serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
202
209
#[ allow( clippy:: derive_partial_eq_without_eq) ]
203
210
#[ derive( Clone , PartialEq , :: prost:: Message ) ]
@@ -214,6 +221,7 @@ pub struct Sum {
214
221
}
215
222
/// Histogram represents the type of a metric that is calculated by aggregating
216
223
/// as a Histogram of all reported measurements over a time interval.
224
+ #[ cfg_attr( feature = "with-schemars" , derive( schemars:: JsonSchema ) ) ]
217
225
#[ cfg_attr( feature = "with-serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
218
226
#[ allow( clippy:: derive_partial_eq_without_eq) ]
219
227
#[ derive( Clone , PartialEq , :: prost:: Message ) ]
@@ -227,6 +235,7 @@ pub struct Histogram {
227
235
}
228
236
/// ExponentialHistogram represents the type of a metric that is calculated by aggregating
229
237
/// as a ExponentialHistogram of all reported double measurements over a time interval.
238
+ #[ cfg_attr( feature = "with-schemars" , derive( schemars:: JsonSchema ) ) ]
230
239
#[ cfg_attr( feature = "with-serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
231
240
#[ allow( clippy:: derive_partial_eq_without_eq) ]
232
241
#[ derive( Clone , PartialEq , :: prost:: Message ) ]
@@ -244,6 +253,7 @@ pub struct ExponentialHistogram {
244
253
/// data type. These data points cannot always be merged in a meaningful way.
245
254
/// While they can be useful in some applications, histogram data points are
246
255
/// recommended for new applications.
256
+ #[ cfg_attr( feature = "with-schemars" , derive( schemars:: JsonSchema ) ) ]
247
257
#[ cfg_attr( feature = "with-serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
248
258
#[ allow( clippy:: derive_partial_eq_without_eq) ]
249
259
#[ derive( Clone , PartialEq , :: prost:: Message ) ]
@@ -253,6 +263,7 @@ pub struct Summary {
253
263
}
254
264
/// NumberDataPoint is a single data point in a timeseries that describes the
255
265
/// time-varying scalar value of a metric.
266
+ #[ cfg_attr( feature = "with-schemars" , derive( schemars:: JsonSchema ) ) ]
256
267
#[ cfg_attr( feature = "with-serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
257
268
#[ allow( clippy:: derive_partial_eq_without_eq) ]
258
269
#[ derive( Clone , PartialEq , :: prost:: Message ) ]
@@ -293,6 +304,7 @@ pub struct NumberDataPoint {
293
304
pub mod number_data_point {
294
305
/// The value itself. A point is considered invalid when one of the recognized
295
306
/// value fields is not present inside this oneof.
307
+ #[ cfg_attr( feature = "with-schemars" , derive( schemars:: JsonSchema ) ) ]
296
308
#[ cfg_attr( feature = "with-serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
297
309
#[ allow( clippy:: derive_partial_eq_without_eq) ]
298
310
#[ derive( Clone , PartialEq , :: prost:: Oneof ) ]
@@ -313,6 +325,7 @@ pub mod number_data_point {
313
325
/// If the histogram does not contain the distribution of values, then both
314
326
/// "explicit_bounds" and "bucket_counts" must be omitted and only "count" and
315
327
/// "sum" are known.
328
+ #[ cfg_attr( feature = "with-schemars" , derive( schemars:: JsonSchema ) ) ]
316
329
#[ cfg_attr( feature = "with-serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
317
330
#[ allow( clippy:: derive_partial_eq_without_eq) ]
318
331
#[ derive( Clone , PartialEq , :: prost:: Message ) ]
@@ -395,6 +408,7 @@ pub struct HistogramDataPoint {
395
408
/// summary statistics for a population of values, it may optionally contain the
396
409
/// distribution of those values across a set of buckets.
397
410
///
411
+ #[ cfg_attr( feature = "with-schemars" , derive( schemars:: JsonSchema ) ) ]
398
412
#[ cfg_attr( feature = "with-serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
399
413
#[ allow( clippy:: derive_partial_eq_without_eq) ]
400
414
#[ derive( Clone , PartialEq , :: prost:: Message ) ]
@@ -493,6 +507,7 @@ pub struct ExponentialHistogramDataPoint {
493
507
pub mod exponential_histogram_data_point {
494
508
/// Buckets are a set of bucket counts, encoded in a contiguous array
495
509
/// of counts.
510
+ #[ cfg_attr( feature = "with-schemars" , derive( schemars:: JsonSchema ) ) ]
496
511
#[ cfg_attr( feature = "with-serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
497
512
#[ allow( clippy:: derive_partial_eq_without_eq) ]
498
513
#[ derive( Clone , PartialEq , :: prost:: Message ) ]
@@ -517,6 +532,7 @@ pub mod exponential_histogram_data_point {
517
532
}
518
533
/// SummaryDataPoint is a single data point in a timeseries that describes the
519
534
/// time-varying values of a Summary metric.
535
+ #[ cfg_attr( feature = "with-schemars" , derive( schemars:: JsonSchema ) ) ]
520
536
#[ cfg_attr( feature = "with-serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
521
537
#[ allow( clippy:: derive_partial_eq_without_eq) ]
522
538
#[ derive( Clone , PartialEq , :: prost:: Message ) ]
@@ -572,6 +588,7 @@ pub mod summary_data_point {
572
588
///
573
589
/// See the following issue for more context:
574
590
/// <https://github.com/open-telemetry/opentelemetry-proto/issues/125>
591
+ #[ cfg_attr( feature = "with-schemars" , derive( schemars:: JsonSchema ) ) ]
575
592
#[ cfg_attr( feature = "with-serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
576
593
#[ allow( clippy:: derive_partial_eq_without_eq) ]
577
594
#[ derive( Clone , PartialEq , :: prost:: Message ) ]
@@ -591,6 +608,7 @@ pub mod summary_data_point {
591
608
/// Exemplars also hold information about the environment when the measurement
592
609
/// was recorded, for example the span and trace ID of the active span when the
593
610
/// exemplar was recorded.
611
+ #[ cfg_attr( feature = "with-schemars" , derive( schemars:: JsonSchema ) ) ]
594
612
#[ cfg_attr( feature = "with-serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
595
613
#[ allow( clippy:: derive_partial_eq_without_eq) ]
596
614
#[ derive( Clone , PartialEq , :: prost:: Message ) ]
@@ -629,6 +647,7 @@ pub mod exemplar {
629
647
/// The value of the measurement that was recorded. An exemplar is
630
648
/// considered invalid when one of the recognized value fields is not present
631
649
/// inside this oneof.
650
+ #[ cfg_attr( feature = "with-schemars" , derive( schemars:: JsonSchema ) ) ]
632
651
#[ cfg_attr( feature = "with-serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
633
652
#[ allow( clippy:: derive_partial_eq_without_eq) ]
634
653
#[ derive( Clone , PartialEq , :: prost:: Oneof ) ]
@@ -642,6 +661,7 @@ pub mod exemplar {
642
661
/// AggregationTemporality defines how a metric aggregator reports aggregated
643
662
/// values. It describes how those values relate to the time interval over
644
663
/// which they are aggregated.
664
+ #[ cfg_attr( feature = "with-schemars" , derive( schemars:: JsonSchema ) ) ]
645
665
#[ cfg_attr( feature = "with-serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
646
666
#[ derive( Clone , Copy , Debug , PartialEq , Eq , Hash , PartialOrd , Ord , :: prost:: Enumeration ) ]
647
667
#[ repr( i32 ) ]
@@ -739,6 +759,7 @@ impl AggregationTemporality {
739
759
///
740
760
/// (point.flags & DATA_POINT_FLAGS_NO_RECORDED_VALUE_MASK) == DATA_POINT_FLAGS_NO_RECORDED_VALUE_MASK
741
761
///
762
+ #[ cfg_attr( feature = "with-schemars" , derive( schemars:: JsonSchema ) ) ]
742
763
#[ cfg_attr( feature = "with-serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
743
764
#[ derive( Clone , Copy , Debug , PartialEq , Eq , Hash , PartialOrd , Ord , :: prost:: Enumeration ) ]
744
765
#[ repr( i32 ) ]
0 commit comments