File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 16
16
17
17
import { setupTracing } from './tracer' ;
18
18
19
+ // Initialize tracing before importing other moduless
20
+ const tracer = setupTracing ( 'example-express-client' ) ;
21
+
19
22
import * as api from '@opentelemetry/api' ;
20
23
import * as axios from 'axios' ;
21
24
22
- const tracer = setupTracing ( 'example-express-client' ) ;
23
-
24
25
async function makeRequest ( ) {
25
26
const span = tracer . startSpan ( 'client.makeRequest()' , {
26
27
kind : api . SpanKind . CLIENT ,
Original file line number Diff line number Diff line change 16
16
17
17
import { setupTracing } from './tracer' ;
18
18
19
+ // Initialize tracing before importing other modules
20
+ setupTracing ( 'example-express-server' ) ;
21
+
19
22
// Require in rest of modules
20
23
import * as express from 'express' ;
21
24
import * as axios from 'axios' ;
22
25
import { RequestHandler } from 'express' ;
23
26
24
- setupTracing ( 'example-express-server' ) ;
25
-
26
27
// Setup express
27
28
const app = express ( ) ;
28
29
const PORT = 8080 ;
You can’t perform that action at this time.
0 commit comments