X-ray Daemon didn't receive data from ECS container

0

I have set up a node app following the guide here https://docs.aws.amazon.com/xray/latest/devguide/xray-daemon-ecs.html

Both containers are running but the X-ray daemon didn't receive data from the nodejs app. I check the x-ray daemon logs and found the below logs. Can anyone help with what I missed please?

[Error] Get instance id metadata failed: RequestError: send request failed
caused by: Get http://169.254.169.254/latest/meta-data/instance-id: dial tcp 169.254.169.254:80: connect: invalid argument
asked 2 years ago933 views
1 Answer
0

I've seen that same error message for an application that is able to send traces from the app to X-Ray.

2022-03-30T20:12:33Z [Info] Initializing AWS X-Ray daemon 3.3.3
2022-03-30T20:12:33Z [Info] Using buffer memory limit of 79 MB
2022-03-30T20:12:33Z [Info] 1264 segment buffers allocated
2022-03-30T20:12:34Z [Info] Using region: us-west-2
2022-03-30T20:12:34Z [Error] Get instance id metadata failed: RequestError: send request failed
    caused by: Get "http://169.254.169.254/latest/meta-data/instance-id": dial tcp 169.254.169.254:80: connect: invalid argument
2022-03-30T20:12:34Z [Info] HTTP Proxy server using X-Ray Endpoint : https://xray.us-west-2.amazonaws.com
2022-03-30T20:12:34Z [Info] Starting proxy http server on 0.0.0.0:2000
2022-03-30T20:14:40Z [Info] Successfully sent batch of 1 segments (0.028 seconds)

Check to see that your X-Ray sidecar container has a port-mapping for 2000 UDP. It should show up in the JSON representation of the task definition like this:

      "portMappings": [
        {
          "hostPort": 2000,
          "protocol": "udp",
          "containerPort": 2000
        }
profile pictureAWS
Corey
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions