Skip to content

Commit

Permalink
fix(mongodb-example): Ensure instrumentation is setup before mongoDB …
Browse files Browse the repository at this point in the history
…client is import (#1851)

I wasn't getting any MongoDB info, turned on diag logging and it warned the client was being imported before instrumentation was setup...reordered the imports and started to get spans!

Co-authored-by: Amir Blum <[email protected]>
  • Loading branch information
NicholasGWK and blumamir authored Jan 13, 2024
1 parent 577a291 commit c54e9b6
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import * as api from '@opentelemetry/api';

import { setupTracing } from './tracer';

import { accessDB } from './utils';

setupTracing('example-mongodb-server')

import { accessDB } from './utils';

import * as http from 'http';
import { IncomingMessage, ServerResponse } from 'http';
import * as mongodb from 'mongodb';
Expand Down

0 comments on commit c54e9b6

Please sign in to comment.