@@ -27,17 +27,17 @@ impl From<&opentelemetry_sdk::Resource> for ResourceAttributesWithSchema {
2727
2828impl
2929 From < (
30- opentelemetry_sdk :: InstrumentationLibrary ,
30+ opentelemetry :: InstrumentationScope ,
3131 Option < Cow < ' static , str > > ,
3232 ) > for InstrumentationScope
3333{
3434 fn from (
3535 data : (
36- opentelemetry_sdk :: InstrumentationLibrary ,
36+ opentelemetry :: InstrumentationScope ,
3737 Option < Cow < ' static , str > > ,
3838 ) ,
3939 ) -> Self {
40- let ( library , target) = data;
40+ let ( scope , target) = data;
4141 if let Some ( t) = target {
4242 InstrumentationScope {
4343 name : t. to_string ( ) ,
4646 ..Default :: default ( )
4747 }
4848 } else {
49+ let Attributes ( attributes) =
50+ Attributes :: from ( scope. attributes ( ) . cloned ( ) . collect :: < Vec < _ > > ( ) ) ;
4951 InstrumentationScope {
50- name : library . name . into_owned ( ) ,
51- version : library . version . map ( Cow :: into_owned ) . unwrap_or_default ( ) ,
52- attributes : Attributes :: from ( library . attributes ) . 0 ,
52+ name : scope . name ( ) . to_string ( ) ,
53+ version : scope . version ( ) . map ( ToString :: to_string ) . unwrap_or_default ( ) ,
54+ attributes,
5355 ..Default :: default ( )
5456 }
5557 }
5860
5961impl
6062 From < (
61- & opentelemetry_sdk :: InstrumentationLibrary ,
63+ & opentelemetry :: InstrumentationScope ,
6264 Option < Cow < ' static , str > > ,
6365 ) > for InstrumentationScope
6466{
6567 fn from (
6668 data : (
67- & opentelemetry_sdk :: InstrumentationLibrary ,
69+ & opentelemetry :: InstrumentationScope ,
6870 Option < Cow < ' static , str > > ,
6971 ) ,
7072 ) -> Self {
71- let ( library , target) = data;
73+ let ( scope , target) = data;
7274 if let Some ( t) = target {
7375 InstrumentationScope {
7476 name : t. to_string ( ) ,
7779 ..Default :: default ( )
7880 }
7981 } else {
82+ let Attributes ( attributes) =
83+ Attributes :: from ( scope. attributes ( ) . cloned ( ) . collect :: < Vec < _ > > ( ) ) ;
8084 InstrumentationScope {
81- name : library. name . to_string ( ) ,
82- version : library
83- . version
84- . as_ref ( )
85- . map ( ToString :: to_string)
86- . unwrap_or_default ( ) ,
87- attributes : Attributes :: from ( library. attributes . clone ( ) ) . 0 ,
85+ name : scope. name ( ) . to_string ( ) ,
86+ version : scope. version ( ) . map ( ToString :: to_string) . unwrap_or_default ( ) ,
87+ attributes,
8888 ..Default :: default ( )
8989 }
9090 }
@@ -121,7 +121,9 @@ impl From<Value> for AnyValue {
121121 Array :: I64 ( vals) => array_into_proto ( vals) ,
122122 Array :: F64 ( vals) => array_into_proto ( vals) ,
123123 Array :: String ( vals) => array_into_proto ( vals) ,
124+ _ => ArrayValue :: default ( ) ,
124125 } ) ) ,
126+ _ => None ,
125127 } ,
126128 }
127129 }
0 commit comments