Skip to content

Commit 655b5af

Browse files
authored
Update opentelemetry-proto definitions to v0.14.0 (open-telemetry#768)
1 parent 11af0ae commit 655b5af

File tree

10 files changed

+1527
-2455
lines changed

10 files changed

+1527
-2455
lines changed

opentelemetry-otlp/src/transform/metrics.rs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ pub(crate) mod tonic {
1414
ArrayAggregator, HistogramAggregator, LastValueAggregator, MinMaxSumCountAggregator,
1515
SumAggregator,
1616
};
17+
use opentelemetry_proto::tonic::metrics::v1::DataPointFlags;
1718
use opentelemetry_proto::tonic::FromNumber;
1819
use opentelemetry_proto::tonic::{
1920
collector::metrics::v1::ExportMetricsServiceRequest,
@@ -58,8 +59,8 @@ pub(crate) mod tonic {
5859
data_points: points
5960
.into_iter()
6061
.map(|val| NumberDataPoint {
62+
flags: DataPointFlags::FlagNone as u32,
6163
attributes: attributes.clone(),
62-
labels: vec![],
6364
start_time_unix_nano: to_nanos(*record.start_time()),
6465
time_unix_nano: to_nanos(*record.end_time()),
6566
value: Some(number_data_point::Value::from_number(val, kind)),
@@ -77,8 +78,8 @@ pub(crate) mod tonic {
7778
let (val, sample_time) = last_value.last_value()?;
7879
Data::Gauge(Gauge {
7980
data_points: vec![NumberDataPoint {
81+
flags: DataPointFlags::FlagNone as u32,
8082
attributes,
81-
labels: vec![],
8283
start_time_unix_nano: to_nanos(*record.start_time()),
8384
time_unix_nano: to_nanos(sample_time),
8485
value: Some(number_data_point::Value::from_number(val, kind)),
@@ -91,8 +92,8 @@ pub(crate) mod tonic {
9192
let val = sum.sum()?;
9293
Data::Sum(Sum {
9394
data_points: vec![NumberDataPoint {
95+
flags: DataPointFlags::FlagNone as u32,
9496
attributes,
95-
labels: vec![],
9697
start_time_unix_nano: to_nanos(*record.start_time()),
9798
time_unix_nano: to_nanos(*record.end_time()),
9899
value: Some(number_data_point::Value::from_number(val, kind)),
@@ -110,8 +111,8 @@ pub(crate) mod tonic {
110111
(histogram.sum()?, histogram.count()?, histogram.histogram()?);
111112
Data::Histogram(Histogram {
112113
data_points: vec![HistogramDataPoint {
114+
flags: DataPointFlags::FlagNone as u32,
113115
attributes,
114-
labels: vec![],
115116
start_time_unix_nano: to_nanos(*record.start_time()),
116117
time_unix_nano: to_nanos(*record.end_time()),
117118
count,
@@ -143,8 +144,8 @@ pub(crate) mod tonic {
143144
let bounds = vec![0.0, 100.0];
144145
Data::Histogram(Histogram {
145146
data_points: vec![HistogramDataPoint {
147+
flags: DataPointFlags::FlagNone as u32,
146148
attributes,
147-
labels: vec![],
148149
start_time_unix_nano: to_nanos(*record.start_time()),
149150
time_unix_nano: to_nanos(*record.end_time()),
150151
count,
@@ -288,6 +289,7 @@ mod tests {
288289
histogram, last_value, min_max_sum_count, SumAggregator,
289290
};
290291
use opentelemetry::sdk::{InstrumentationLibrary, Resource};
292+
use opentelemetry_proto::tonic::metrics::v1::DataPointFlags;
291293
use opentelemetry_proto::tonic::{
292294
common::v1::{any_value, AnyValue, KeyValue},
293295
metrics::v1::{
@@ -340,11 +342,11 @@ mod tests {
340342
value: i64,
341343
) -> NumberDataPoint {
342344
NumberDataPoint {
345+
flags: DataPointFlags::FlagNone as u32,
343346
attributes: attributes
344347
.into_iter()
345348
.map(|(key, value)| key_value(key, value))
346349
.collect::<Vec<KeyValue>>(),
347-
labels: vec![],
348350
start_time_unix_nano: start_time,
349351
time_unix_nano: end_time,
350352
value: Some(number_data_point::Value::from_number(
@@ -507,8 +509,8 @@ mod tests {
507509
unit: "".to_string(),
508510
data: Some(Data::Sum(Sum {
509511
data_points: vec![NumberDataPoint {
512+
flags: DataPointFlags::FlagNone as u32,
510513
attributes: str_kv_attributes.clone(),
511-
labels: vec![],
512514
start_time_unix_nano: 1608891000000000000,
513515
time_unix_nano: 1608891030000000000,
514516
value: Some(i64_to_value(12i64)),
@@ -554,8 +556,8 @@ mod tests {
554556
unit: "".to_string(),
555557
data: Some(Data::Gauge(Gauge {
556558
data_points: vec![NumberDataPoint {
559+
flags: DataPointFlags::FlagNone as u32,
557560
attributes: str_kv_attributes.clone(),
558-
labels: vec![],
559561
start_time_unix_nano: 1608891000000000000,
560562
time_unix_nano: if let Data::Gauge(gauge) = metric.data.clone().unwrap()
561563
{
@@ -606,8 +608,8 @@ mod tests {
606608
unit: "".to_string(),
607609
data: Some(Data::Histogram(Histogram {
608610
data_points: vec![HistogramDataPoint {
611+
flags: DataPointFlags::FlagNone as u32,
609612
attributes: str_kv_attributes.clone(),
610-
labels: vec![],
611613
start_time_unix_nano: 1608891000000000000,
612614
time_unix_nano: 1608891030000000000,
613615
count: 3,
@@ -656,8 +658,8 @@ mod tests {
656658
unit: "".to_string(),
657659
data: Some(Data::Histogram(Histogram {
658660
data_points: vec![HistogramDataPoint {
661+
flags: DataPointFlags::FlagNone as u32,
659662
attributes: str_kv_attributes,
660-
labels: vec![],
661663
start_time_unix_nano: 1608891000000000000,
662664
time_unix_nano: 1608891030000000000,
663665
count: 3,

opentelemetry-proto/src/proto/grpcio/common.rs

Lines changed: 4 additions & 210 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,210 +1134,6 @@ impl ::protobuf::reflect::ProtobufValue for KeyValue {
11341134
}
11351135
}
11361136

1137-
#[derive(PartialEq,Clone,Default)]
1138-
#[cfg_attr(feature = "with-serde", derive(::serde::Serialize, ::serde::Deserialize))]
1139-
pub struct StringKeyValue {
1140-
// message fields
1141-
pub key: ::std::string::String,
1142-
pub value: ::std::string::String,
1143-
// special fields
1144-
#[cfg_attr(feature = "with-serde", serde(skip))]
1145-
pub unknown_fields: ::protobuf::UnknownFields,
1146-
#[cfg_attr(feature = "with-serde", serde(skip))]
1147-
pub cached_size: ::protobuf::CachedSize,
1148-
}
1149-
1150-
impl<'a> ::std::default::Default for &'a StringKeyValue {
1151-
fn default() -> &'a StringKeyValue {
1152-
<StringKeyValue as ::protobuf::Message>::default_instance()
1153-
}
1154-
}
1155-
1156-
impl StringKeyValue {
1157-
pub fn new() -> StringKeyValue {
1158-
::std::default::Default::default()
1159-
}
1160-
1161-
// string key = 1;
1162-
1163-
1164-
pub fn get_key(&self) -> &str {
1165-
&self.key
1166-
}
1167-
pub fn clear_key(&mut self) {
1168-
self.key.clear();
1169-
}
1170-
1171-
// Param is passed by value, moved
1172-
pub fn set_key(&mut self, v: ::std::string::String) {
1173-
self.key = v;
1174-
}
1175-
1176-
// Mutable pointer to the field.
1177-
// If field is not initialized, it is initialized with default value first.
1178-
pub fn mut_key(&mut self) -> &mut ::std::string::String {
1179-
&mut self.key
1180-
}
1181-
1182-
// Take field
1183-
pub fn take_key(&mut self) -> ::std::string::String {
1184-
::std::mem::replace(&mut self.key, ::std::string::String::new())
1185-
}
1186-
1187-
// string value = 2;
1188-
1189-
1190-
pub fn get_value(&self) -> &str {
1191-
&self.value
1192-
}
1193-
pub fn clear_value(&mut self) {
1194-
self.value.clear();
1195-
}
1196-
1197-
// Param is passed by value, moved
1198-
pub fn set_value(&mut self, v: ::std::string::String) {
1199-
self.value = v;
1200-
}
1201-
1202-
// Mutable pointer to the field.
1203-
// If field is not initialized, it is initialized with default value first.
1204-
pub fn mut_value(&mut self) -> &mut ::std::string::String {
1205-
&mut self.value
1206-
}
1207-
1208-
// Take field
1209-
pub fn take_value(&mut self) -> ::std::string::String {
1210-
::std::mem::replace(&mut self.value, ::std::string::String::new())
1211-
}
1212-
}
1213-
1214-
impl ::protobuf::Message for StringKeyValue {
1215-
fn is_initialized(&self) -> bool {
1216-
true
1217-
}
1218-
1219-
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
1220-
while !is.eof()? {
1221-
let (field_number, wire_type) = is.read_tag_unpack()?;
1222-
match field_number {
1223-
1 => {
1224-
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.key)?;
1225-
},
1226-
2 => {
1227-
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.value)?;
1228-
},
1229-
_ => {
1230-
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
1231-
},
1232-
};
1233-
}
1234-
::std::result::Result::Ok(())
1235-
}
1236-
1237-
// Compute sizes of nested messages
1238-
#[allow(unused_variables)]
1239-
fn compute_size(&self) -> u32 {
1240-
let mut my_size = 0;
1241-
if !self.key.is_empty() {
1242-
my_size += ::protobuf::rt::string_size(1, &self.key);
1243-
}
1244-
if !self.value.is_empty() {
1245-
my_size += ::protobuf::rt::string_size(2, &self.value);
1246-
}
1247-
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
1248-
self.cached_size.set(my_size);
1249-
my_size
1250-
}
1251-
1252-
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
1253-
if !self.key.is_empty() {
1254-
os.write_string(1, &self.key)?;
1255-
}
1256-
if !self.value.is_empty() {
1257-
os.write_string(2, &self.value)?;
1258-
}
1259-
os.write_unknown_fields(self.get_unknown_fields())?;
1260-
::std::result::Result::Ok(())
1261-
}
1262-
1263-
fn get_cached_size(&self) -> u32 {
1264-
self.cached_size.get()
1265-
}
1266-
1267-
fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
1268-
&self.unknown_fields
1269-
}
1270-
1271-
fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
1272-
&mut self.unknown_fields
1273-
}
1274-
1275-
fn as_any(&self) -> &dyn (::std::any::Any) {
1276-
self as &dyn (::std::any::Any)
1277-
}
1278-
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
1279-
self as &mut dyn (::std::any::Any)
1280-
}
1281-
fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
1282-
self
1283-
}
1284-
1285-
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
1286-
Self::descriptor_static()
1287-
}
1288-
1289-
fn new() -> StringKeyValue {
1290-
StringKeyValue::new()
1291-
}
1292-
1293-
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
1294-
static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
1295-
descriptor.get(|| {
1296-
let mut fields = ::std::vec::Vec::new();
1297-
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
1298-
"key",
1299-
|m: &StringKeyValue| { &m.key },
1300-
|m: &mut StringKeyValue| { &mut m.key },
1301-
));
1302-
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
1303-
"value",
1304-
|m: &StringKeyValue| { &m.value },
1305-
|m: &mut StringKeyValue| { &mut m.value },
1306-
));
1307-
::protobuf::reflect::MessageDescriptor::new_pb_name::<StringKeyValue>(
1308-
"StringKeyValue",
1309-
fields,
1310-
file_descriptor_proto()
1311-
)
1312-
})
1313-
}
1314-
1315-
fn default_instance() -> &'static StringKeyValue {
1316-
static instance: ::protobuf::rt::LazyV2<StringKeyValue> = ::protobuf::rt::LazyV2::INIT;
1317-
instance.get(StringKeyValue::new)
1318-
}
1319-
}
1320-
1321-
impl ::protobuf::Clear for StringKeyValue {
1322-
fn clear(&mut self) {
1323-
self.key.clear();
1324-
self.value.clear();
1325-
self.unknown_fields.clear();
1326-
}
1327-
}
1328-
1329-
impl ::std::fmt::Debug for StringKeyValue {
1330-
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
1331-
::protobuf::text_format::fmt(self, f)
1332-
}
1333-
}
1334-
1335-
impl ::protobuf::reflect::ProtobufValue for StringKeyValue {
1336-
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
1337-
::protobuf::reflect::ReflectValueRef::Message(self)
1338-
}
1339-
}
1340-
13411137
#[derive(PartialEq,Clone,Default)]
13421138
#[cfg_attr(feature = "with-serde", derive(::serde::Serialize, ::serde::Deserialize))]
13431139
pub struct InstrumentationLibrary {
@@ -1557,12 +1353,10 @@ static file_descriptor_proto_data: &'static [u8] = b"\
15571353
\x20\x03(\x0b2'.opentelemetry.proto.common.v1.KeyValueR\x06values\"[\n\
15581354
\x08KeyValue\x12\x10\n\x03key\x18\x01\x20\x01(\tR\x03key\x12=\n\x05value\
15591355
\x18\x02\x20\x01(\x0b2'.opentelemetry.proto.common.v1.AnyValueR\x05value\
1560-
\"<\n\x0eStringKeyValue\x12\x10\n\x03key\x18\x01\x20\x01(\tR\x03key\x12\
1561-
\x14\n\x05value\x18\x02\x20\x01(\tR\x05value:\x02\x18\x01\"F\n\x16Instru\
1562-
mentationLibrary\x12\x12\n\x04name\x18\x01\x20\x01(\tR\x04name\x12\x18\n\
1563-
\x07version\x18\x02\x20\x01(\tR\x07versionBq\n\x20io.opentelemetry.proto\
1564-
.common.v1B\x0bCommonProtoP\x01Z>github.com/open-telemetry/opentelemetry\
1565-
-proto/gen/go/common/v1b\x06proto3\
1356+
\"F\n\x16InstrumentationLibrary\x12\x12\n\x04name\x18\x01\x20\x01(\tR\
1357+
\x04name\x12\x18\n\x07version\x18\x02\x20\x01(\tR\x07versionB[\n\x20io.o\
1358+
pentelemetry.proto.common.v1B\x0bCommonProtoP\x01Z(go.opentelemetry.io/p\
1359+
roto/otlp/common/v1b\x06proto3\
15661360
";
15671361

15681362
static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;

0 commit comments

Comments
 (0)