Hey I'm trying to trace outgoing requests from an express app, but I can't get it to work.
When I dont use the AWSXRAY.captureHttpsGlobal function everything works fine with incoming requests and I can see my application in "Service Map" and my incoming request traces coming in on AWS, but I want to trace outgoing requests and as soon as I add AWSXRAY.captureHttpsGlobal then nothing works and I get no exception or anything, and my Daemon doesnt print the usual "Successfully sent batch of 1 segments (0.058 seconds)"
This is my code.
var AWSXRay = require('aws-xray-sdk');
const express = require("express");
var app = express();
app.use(AWSXRay.express.openSegment('MyApp'));
AWSXRay.captureHTTPsGlobal(require('https')); // works when i comment this out
var http = require('https');
app.get('/', function (req, res) {
http.get("https://google.com", (resp) => {
res.send("googlefetched")
});
//res.send("hello world")
});
app.use(AWSXRay.express.closeSegment());
app.listen(3000, () => console.log('Example app listening on port 3000!'))