@@ -85,7 +85,8 @@ const spanKindToEnum =
8585 * @param attributes Attributes
8686 * @returns opencensus.proto.trace.v1.Span.Attributes
8787 */
88- const adaptAttributes = ( attributes : Attributes ) :
88+ const adaptAttributes = ( attributes : Attributes ,
89+ droppedAttributesCount : number ) :
8990 opencensus . proto . trace . v1 . Span . Attributes | null => {
9091 if ( ! attributes ) {
9192 return null ;
@@ -122,7 +123,7 @@ const adaptAttributes = (attributes: Attributes):
122123 attributeMap [ name ] = { stringValue, intValue, boolValue} ;
123124 } ) ;
124125
125- return { attributeMap, droppedAttributesCount : null } ;
126+ return { attributeMap, droppedAttributesCount} ;
126127} ;
127128
128129/**
@@ -167,7 +168,7 @@ const adaptTimeEvents =
167168 time : null ,
168169 annotation : {
169170 description : stringToTruncatableString ( annotation . description ) ,
170- attributes : adaptAttributes ( annotation . attributes )
171+ attributes : adaptAttributes ( annotation . attributes , 0 )
171172 }
172173 } ) ;
173174 } ) ;
@@ -235,7 +236,7 @@ const adaptLink = (link: Link): opencensus.proto.trace.v1.Span.Link => {
235236 }
236237 }
237238
238- const attributes = adaptAttributes ( link . attributes ) ;
239+ const attributes = adaptAttributes ( link . attributes , 0 ) ;
239240
240241 return { traceId, spanId, type, attributes} ;
241242} ;
@@ -272,7 +273,7 @@ export const adaptSpan = (span: Span): opencensus.proto.trace.v1.Span => {
272273 kind : spanKindToEnum ( span . kind ) ,
273274 startTime : millisToTimestamp ( span . startTime ) ,
274275 endTime : millisToTimestamp ( span . endTime ) ,
275- attributes : adaptAttributes ( span . attributes ) ,
276+ attributes : adaptAttributes ( span . attributes , span . droppedAttributesCount ) ,
276277 stackTrace : null , // Unsupported by nodejs
277278 timeEvents : adaptTimeEvents ( span . annotations , span . messageEvents ) ,
278279 links : adaptLinks ( span . links ) ,
0 commit comments