Skip to content

Commit aed1ab5

Browse files
committed
update proto
1 parent 0cc7228 commit aed1ab5

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

opentelemetry-proto/src/proto/tonic/opentelemetry.proto.logs.v1.rs

+28
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,13 @@ pub struct LogRecord {
7979
/// Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
8080
/// Value of 0 indicates unknown or missing timestamp.
8181
#[prost(fixed64, tag = "1")]
82+
#[cfg_attr(
83+
feature = "with-serde",
84+
serde(
85+
serialize_with = "crate::proto::serializers::serialize_u64_to_string",
86+
deserialize_with = "crate::proto::serializers::deserialize_string_to_u64"
87+
)
88+
)]
8289
pub time_unix_nano: u64,
8390
/// Time when the event was observed by the collection system.
8491
/// For events that originate in OpenTelemetry (e.g. using OpenTelemetry Logging SDK)
@@ -96,6 +103,13 @@ pub struct LogRecord {
96103
/// Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
97104
/// Value of 0 indicates unknown or missing timestamp.
98105
#[prost(fixed64, tag = "11")]
106+
#[cfg_attr(
107+
feature = "with-serde",
108+
serde(
109+
serialize_with = "crate::proto::serializers::serialize_u64_to_string",
110+
deserialize_with = "crate::proto::serializers::deserialize_string_to_u64"
111+
)
112+
)]
99113
pub observed_time_unix_nano: u64,
100114
/// Numerical value of the severity, normalized to values described in Log Data Model.
101115
/// \[Optional\].
@@ -136,6 +150,13 @@ pub struct LogRecord {
136150
/// - the field is not present,
137151
/// - the field contains an invalid value.
138152
#[prost(bytes = "vec", tag = "9")]
153+
#[cfg_attr(
154+
feature = "with-serde",
155+
serde(
156+
serialize_with = "crate::proto::serializers::serialize_to_hex_string",
157+
deserialize_with = "crate::proto::serializers::deserialize_from_hex_string"
158+
)
159+
)]
139160
pub trace_id: ::prost::alloc::vec::Vec<u8>,
140161
/// A unique identifier for a span within a trace, assigned when the span
141162
/// is created. The ID is an 8-byte array. An ID with all zeroes OR of length
@@ -150,6 +171,13 @@ pub struct LogRecord {
150171
/// - the field is not present,
151172
/// - the field contains an invalid value.
152173
#[prost(bytes = "vec", tag = "10")]
174+
#[cfg_attr(
175+
feature = "with-serde",
176+
serde(
177+
serialize_with = "crate::proto::serializers::serialize_to_hex_string",
178+
deserialize_with = "crate::proto::serializers::deserialize_from_hex_string"
179+
)
180+
)]
153181
pub span_id: ::prost::alloc::vec::Vec<u8>,
154182
}
155183
/// Possible values for LogRecord.SeverityNumber.

opentelemetry-proto/tests/grpc_build.rs

+4
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ fn build_tonic() {
6868
"trace.v1.Span.trace_id",
6969
"trace.v1.Span.span_id",
7070
"trace.v1.Span.parent_span_id",
71+
"logs.v1.LogRecord.span_id",
72+
"logs.v1.LogRecord.trace_id",
7173
] {
7274
builder = builder
7375
.field_attribute(path, "#[cfg_attr(feature = \"with-serde\", serde(serialize_with = \"crate::proto::serializers::serialize_to_hex_string\", deserialize_with = \"crate::proto::serializers::deserialize_from_hex_string\"))]")
@@ -81,6 +83,8 @@ fn build_tonic() {
8183
"trace.v1.Span.start_time_unix_nano",
8284
"trace.v1.Span.end_time_unix_nano",
8385
"trace.v1.Span.Event.time_unix_nano",
86+
"logs.v1.LogRecord.time_unix_nano",
87+
"logs.v1.LogRecord.observed_time_unix_nano",
8488
] {
8589
builder = builder
8690
.field_attribute(path, "#[cfg_attr(feature = \"with-serde\", serde(serialize_with = \"crate::proto::serializers::serialize_u64_to_string\", deserialize_with = \"crate::proto::serializers::deserialize_string_to_u64\"))]")

0 commit comments

Comments
 (0)