Skip to content

Commit

Permalink
Return module
Browse files Browse the repository at this point in the history
  • Loading branch information
nicohrubec committed Jul 26, 2024
1 parent 5aade8a commit 4f394c4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/node/src/integrations/tracing/nest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,18 @@ export class SentryNestInstrumentation extends InstrumentationBase {
/**
*
*/
public init(): void {
public init(): any {
logger.log('init!');
const module = new InstrumentationNodeModuleDefinition(
const nodeModuleDefinition = new InstrumentationNodeModuleDefinition(
SentryNestInstrumentation.COMPONENT,
supportedVersions
)

module.files.push(
nodeModuleDefinition.files.push(
this._getInjectableFileInstrumentation(supportedVersions)
)

return nodeModuleDefinition;
}

/**
Expand All @@ -89,6 +91,7 @@ export class SentryNestInstrumentation extends InstrumentationBase {
'@nestjs/common/decorators/core/injectable.decorator.js',
versions,
(moduleExports: any) => {
console.log(moduleExports);
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
if (isWrapped(moduleExports.Injectable)) {
this._unwrap(moduleExports, 'Injectable');
Expand Down Expand Up @@ -130,6 +133,7 @@ const instrumentNestCore = generateInstrumentOnce('Nest-Core', () => {

const instrumentMiddleware = generateInstrumentOnce('Nest-Middleware', () => {
logger.log('init nest middleware instrumentation');
console.log('init nest middleware instrumentation');
return new SentryNestInstrumentation();
});

Expand Down

0 comments on commit 4f394c4

Please sign in to comment.