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 1616
1717import { setupTracing } from './tracer' ;
1818
19+ // Initialize tracing before importing other moduless
20+ const tracer = setupTracing ( 'example-express-client' ) ;
21+
1922import * as api from '@opentelemetry/api' ;
2023import * as axios from 'axios' ;
2124
22- const tracer = setupTracing ( 'example-express-client' ) ;
23-
2425async function makeRequest ( ) {
2526 const span = tracer . startSpan ( 'client.makeRequest()' , {
2627 kind : api . SpanKind . CLIENT ,
Original file line number Diff line number Diff line change 1616
1717import { setupTracing } from './tracer' ;
1818
19+ // Initialize tracing before importing other modules
20+ setupTracing ( 'example-express-server' ) ;
21+
1922// Require in rest of modules
2023import * as express from 'express' ;
2124import * as axios from 'axios' ;
2225import { RequestHandler } from 'express' ;
2326
24- setupTracing ( 'example-express-server' ) ;
25-
2627// Setup express
2728const app = express ( ) ;
2829const PORT = 8080 ;
You can’t perform that action at this time.
0 commit comments