@@ -101,12 +101,12 @@ pub mod tonic {
101101 schema_url : resource. schema_url . clone ( ) . unwrap_or_default ( ) ,
102102 scope_spans : vec ! [ ScopeSpans {
103103 schema_url: source_span
104- . instrumentation_lib
104+ . instrumentation_scope
105105 . schema_url
106106 . as_ref( )
107107 . map( ToString :: to_string)
108108 . unwrap_or_default( ) ,
109- scope: Some ( ( source_span. instrumentation_lib , None ) . into( ) ) ,
109+ scope: Some ( ( source_span. instrumentation_scope , None ) . into( ) ) ,
110110 spans: vec![ Span {
111111 trace_id: source_span. span_context. trace_id( ) . to_bytes( ) . to_vec( ) ,
112112 span_id: source_span. span_context. span_id( ) . to_bytes( ) . to_vec( ) ,
@@ -155,12 +155,11 @@ pub mod tonic {
155155 spans : Vec < SpanData > ,
156156 resource : & ResourceAttributesWithSchema ,
157157 ) -> Vec < ResourceSpans > {
158- // Group spans by their instrumentation library
158+ // Group spans by their instrumentation scope
159159 let scope_map = spans. iter ( ) . fold (
160160 HashMap :: new ( ) ,
161- |mut scope_map : HashMap < & opentelemetry_sdk:: InstrumentationLibrary , Vec < & SpanData > > ,
162- span| {
163- let instrumentation = & span. instrumentation_lib ;
161+ |mut scope_map : HashMap < & opentelemetry:: InstrumentationScope , Vec < & SpanData > > , span| {
162+ let instrumentation = & span. instrumentation_scope ;
164163 scope_map. entry ( instrumentation) . or_default ( ) . push ( span) ;
165164 scope_map
166165 } ,
@@ -198,11 +197,11 @@ mod tests {
198197 use opentelemetry:: trace:: {
199198 SpanContext , SpanId , SpanKind , Status , TraceFlags , TraceId , TraceState ,
200199 } ;
200+ use opentelemetry:: InstrumentationScope ;
201201 use opentelemetry:: KeyValue ;
202202 use opentelemetry_sdk:: export:: trace:: SpanData ;
203203 use opentelemetry_sdk:: resource:: Resource ;
204204 use opentelemetry_sdk:: trace:: { SpanEvents , SpanLinks } ;
205- use opentelemetry_sdk:: InstrumentationLibrary ;
206205 use std:: borrow:: Cow ;
207206 use std:: time:: { Duration , SystemTime } ;
208207
@@ -227,7 +226,7 @@ mod tests {
227226 events : SpanEvents :: default ( ) ,
228227 links : SpanLinks :: default ( ) ,
229228 status : Status :: Unset ,
230- instrumentation_lib : InstrumentationLibrary :: builder ( instrumentation_name) . build ( ) ,
229+ instrumentation_scope : InstrumentationScope :: builder ( instrumentation_name) . build ( ) ,
231230 }
232231 }
233232
0 commit comments