How to use the aws-xray-sdk-core.setDaemonAddress function in aws-xray-sdk-core

To help you get started, we’ve selected a few aws-xray-sdk-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github terodox / aws-xray-lambda-promise-subsegment / demo / index.js View on Github external
return new Promise(resolve => {
        AWSXRay.setDaemonAddress('127.0.0.1:2000');
        AWSXRay.enableAutomaticMode();

        const segment = new AWSXRay.Segment('aws-xray-lambda-promise-subsegment');
        const namespace = AWSXRay.getNamespace();

        namespace.run(async function () {
            AWSXRay.setSegment(segment);
console.log('segment', segment);
            try {
                await functionToHaveTraced(segment);
                segment.close();
            } catch (error) {
                console.error(error);
                segment.close(error);
            }
            resolve();