@@ -77,7 +77,8 @@ export class StackdriverTraceExporter implements Exporter {
7777 const spanList : Span [ ] = [ ] ;
7878 rootSpans . forEach ( rootSpan => {
7979 // RootSpan data
80- spanList . push ( this . createSpan ( rootSpan , resourceLabel ) ) ;
80+ spanList . push (
81+ this . createSpan ( rootSpan , resourceLabel , rootSpan . numberOfChildren ) ) ;
8182 rootSpan . spans . forEach ( span => {
8283 // Builds spans data
8384 spanList . push ( this . createSpan ( span , resourceLabel ) ) ;
@@ -87,7 +88,8 @@ export class StackdriverTraceExporter implements Exporter {
8788 }
8889
8990 private createSpan (
90- span : OCSpan , resourceLabels : Record < string , AttributeValue > ) : Span {
91+ span : OCSpan , resourceLabels : Record < string , AttributeValue > ,
92+ numberOfChildren = 0 ) : Span {
9193 const spanName =
9294 `projects/${ this . projectId } /traces/${ span . traceId } /spans/${ span . id } ` ;
9395
@@ -105,8 +107,8 @@ export class StackdriverTraceExporter implements Exporter {
105107 links : createLinks ( span . links , span . droppedLinksCount ) ,
106108 status : { code : span . status . code } ,
107109 sameProcessAsParentSpan : ! span . remoteParent ,
108- childSpanCount : null , // TODO: Consider to add count after pull/332
109- stackTrace : null , // Unsupported by nodejs
110+ childSpanCount : numberOfChildren ,
111+ stackTrace : null , // Unsupported by nodejs
110112 } ;
111113 if ( span . parentSpanId ) {
112114 spanBuilder . parentSpanId = span . parentSpanId ;
0 commit comments