File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ export class Tracer {
1616 [ SemanticResourceAttributes . SERVICE_NAME ] : 'dbos' ,
1717 } ) ,
1818 } ) ;
19- this . tracer . register ( ) ;
19+ this . tracer . register ( ) ; // this is a no-op if another tracer provider was already registered
2020 this . applicationID = globalParams . appID ;
2121 this . executorID = globalParams . executorID ; // for consistency with src/context.ts
2222 }
@@ -39,12 +39,14 @@ export class Tracer {
3939 }
4040
4141 endSpan ( span : Span ) {
42- span . end ( hrTime ( performance . now ( ) ) ) ;
43- span . attributes . applicationID = this . applicationID ;
44- span . attributes . applicationVersion = globalParams . appVersion ;
45- if ( ! ( 'executorID' in span . attributes ) ) {
46- span . attributes . executorID = this . executorID ;
42+ span . setAttributes ( {
43+ applicationID : this . applicationID ,
44+ applicationVersion : globalParams . appVersion ,
45+ } ) ;
46+ if ( span . attributes && ! ( 'executorID' in span . attributes ) ) {
47+ span . setAttribute ( 'executorID' , this . executorID ) ;
4748 }
49+ span . end ( hrTime ( performance . now ( ) ) ) ;
4850 this . telemetryCollector . push ( span as ReadableSpan ) ;
4951 }
5052}
You can’t perform that action at this time.
0 commit comments