File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,14 +6,16 @@ import { join } from "jsr:@std/path@^1.0";
66import { context , propagation } from "npm:@opentelemetry/api" ;
77import { W3CBaggagePropagator } from "npm:@opentelemetry/core@1" ;
88
9- // @ts -ignore See https://github.com/denoland/deno/issues/28082
10- if ( globalThis [ Symbol . for ( "opentelemetry.js.api.1" ) ] ) {
11- globalThis [ Symbol . for ( "opentelemetry.js.api.1" ) ] . propagation =
12- new W3CBaggagePropagator ( ) ;
13- }
14-
15- console . log ( "main function started" ) ;
16- console . log ( Deno . version ) ;
9+ addEventListener ( "load" , ( ) => {
10+ console . log ( "main function started" ) ;
11+ console . log ( Deno . version ) ;
12+
13+ // @ts -ignore See https://github.com/denoland/deno/issues/28082
14+ if ( globalThis [ Symbol . for ( "opentelemetry.js.api.1" ) ] ) {
15+ globalThis [ Symbol . for ( "opentelemetry.js.api.1" ) ] . propagation =
16+ new W3CBaggagePropagator ( ) ;
17+ }
18+ } ) ;
1719
1820addEventListener ( "beforeunload" , ( ) => {
1921 console . log ( "main worker exiting" ) ;
You can’t perform that action at this time.
0 commit comments