Noddin
Noddin

Reputation: 11

How to send lambda's offline traces to a local xray daemon with serverless offline?

I can locally execute the lambda with serverless offline, I've set AWS_DAEMON_ADRESS to '127.0.0.1:2000' in the .env file, but the running daemon listening to this port do not receive any data from the execution. The trouble is that the same code executed with an online lambda works, and the xray service map is correctly feed. Did I miss something in the offline configuration ?

This is a nodeJS 8.10 lambda, triggered with Postman on localhost:3000. I've tried to set the daemon adress (127.0.0.1) directly in the lambda's function code, and when sls receive the call it says the deamon adress is already configured (with the .env variable).

I've activated the tracing on apiGateway and lambda in serverless.yml file, and the daemon receives info when I echo anything to /dev/udp/127.0.0.1/2000

const xray = require('aws-xray-sdk')
const aws = require('aws-sdk')
xray.captureAWS(aws)

I except the local daemon to receive some info from the offline lambda execution but nothing happens

Upvotes: 1

Views: 1012

Answers (1)

AWSSandra
AWSSandra

Reputation: 384

Are you using SAM local? Unfortunately, they do not have the hook-ups for X-Ray at the moment. https://github.com/awslabs/aws-sam-cli/issues/217

Upvotes: 1

Related Questions