diff --git a/.github/workflows/publish-nodejs.yml b/.github/workflows/publish-nodejs.yml index fd40f625f5..0743feb985 100644 --- a/.github/workflows/publish-nodejs.yml +++ b/.github/workflows/publish-nodejs.yml @@ -25,7 +25,7 @@ jobs: with: path: ${{ env.OPENTELEMETRY_JS_CONTRIB_PATH }} repository: coralogix/opentelemetry-js-contrib - ref: refs/heads/troubleshooting + ref: refs/heads/coralogix-autoinstrumentation ssh-key: ${{ secrets.OPENTELEMETRY_CI_GITHUB_KEY }} - uses: actions/checkout@v3 with: diff --git a/nodejs/packages/cx-wrapper/index.ts b/nodejs/packages/cx-wrapper/index.ts index 5de8dff2e6..0861eff94c 100644 --- a/nodejs/packages/cx-wrapper/index.ts +++ b/nodejs/packages/cx-wrapper/index.ts @@ -41,43 +41,31 @@ export const handler = (event: any, context: Context, callback: Callback) => { const patchedHandler = lambdaInstrumentation.getPatchHandler(originalHandler) as any as Handler; diag.debug(`Running CX handler and redirecting to ${process.env.CX_ORIGINAL_HANDLER}`) const maybePromise = patchedHandler(event, context, callback); - diag.debug(`patchedHandler returned`); if (typeof maybePromise?.then === 'function') { - diag.debug(`maybePromise is a promise`); maybePromise.then( value => { - diag.debug(`maybePromise succeeded`); context.callbackWaitsForEmptyEventLoop = false; callback(null, value); - diag.debug(`callback called`); }, (err: Error | string | null | undefined) => { if (err === undefined || err === null) { - diag.debug(`maybePromise failed with no error`); context.callbackWaitsForEmptyEventLoop = false; callback('handled', null); - diag.debug(`callback called`); } else { - diag.debug(`maybePromise failed`); context.callbackWaitsForEmptyEventLoop = false; callback(err, null); - diag.debug(`callback called`); } } ); } } catch (err: any) { - diag.debug(`handler failed synchronously`); context.callbackWaitsForEmptyEventLoop = false; callback(err, null); - diag.debug(`callback called`); } }, (err: Error | string) => { - diag.debug(`loading function failed`); context.callbackWaitsForEmptyEventLoop = false; callback(err, null) - diag.debug(`callback called`); } ); }