Skip to content

working directly with client (node) integrations not working. #1770

@jacoor

Description

@jacoor

Sentry node on AWS Lambda

Version: latest

I am trying to get integrations to work as below, but I don't get anything in console for console logs.
Please advice.

const sentry = new Sentry.NodeClient({
    dsn: sentry_url,
    integrations: Sentry.defaultIntegrations,
    debug: true
});

const hub = new Sentry.Hub(sentry);
hub.withScope(scope => {
    scope.setExtra("level", log.type);
   ....
    hub.captureMessage(log.message);
    hub.getClient().close(2000).then(function(result) {
            if (!result) {
                // timeout reached, need to log event to sendToSQS
                // https://github.com/getsentry/sentry-javascript/issues/1449#issuecomment-419352636
                callback(true);
            } else {
                callback();
            }
        }
    );
});

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions