File tree 2 files changed +10
-0
lines changed
2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
37
37
let tracer = tracer_provider. tracer ( "stdout-test" ) ;
38
38
let mut span = tracer. start ( "test_span" ) ;
39
39
span. set_attribute ( KeyValue :: new ( "test_key" , "test_value" ) ) ;
40
+ span. add_event (
41
+ "test_event" ,
42
+ vec ! [ KeyValue :: new( "test_event_key" , "test_event_value" ) ] ,
43
+ ) ;
40
44
span. end ( ) ;
41
45
42
46
let meter = meter_provider. meter ( "stdout-test" ) ;
Original file line number Diff line number Diff line change @@ -154,6 +154,10 @@ struct Event {
154
154
name : Cow < ' static , str > ,
155
155
attributes : Vec < KeyValue > ,
156
156
dropped_attributes_count : u32 ,
157
+ #[ serde( serialize_with = "as_unix_nano" ) ]
158
+ time_unix_nano : SystemTime ,
159
+ #[ serde( serialize_with = "as_human_readable" ) ]
160
+ time : SystemTime ,
157
161
}
158
162
159
163
impl From < opentelemetry:: trace:: Event > for Event {
@@ -162,6 +166,8 @@ impl From<opentelemetry::trace::Event> for Event {
162
166
name : value. name ,
163
167
attributes : value. attributes . into_iter ( ) . map ( Into :: into) . collect ( ) ,
164
168
dropped_attributes_count : value. dropped_attributes_count ,
169
+ time_unix_nano : value. timestamp ,
170
+ time : value. timestamp ,
165
171
}
166
172
}
167
173
}
You can’t perform that action at this time.
0 commit comments