Description
Hi,
I've been searching a ton for a solution to this problem, but no luck tracking down my issue.
I'm using Java and Spring Boot inside a docker container on elastic beanstalk. I added the code to expose the ports for xray.
EXPOSE 2000/tcp
EXPOSE 2000/udp
I added my ebextensions config file with this:
Files:
"/opt/elasticbeanstalk/tasks/taillogs.d/xray-daemon.conf": mode: "000644" owner: root group: root content: | /var/log/xray/xray.log "/etc/amazon/xray/cfg.yaml": mode: "000644" owner: root group: root content: | Logging: LogLevel: "debug" Version: 2 "/etc/awslogs/config/xray.conf": mode: "000755" owner: root group: root content: | [xray-log] log_group_name=/aws/elasticbeanstalk/llitd/docker-xray log_stream_name={instance_id} file=/var/log/xray/*.log file_fingerprint_lines=2-5
container_commands:
01_stop_tracing: command: yum remove -y xray ignoreErrors: true 02_copy_tracing: command: curl https://s3.us-east-2.amazonaws.com/aws-xray-assets.us-east-2/xray-daemon/aws-xray-daemon-3.x.rpm -o /home/ec2-user/xray.rpm 03_start_tracing: command: yum install -y /home/ec2-user/xray.rpm
and in my dockerrun.aws file i have opened this port:
{
"ContainerPort": "2000",
"HostPort": "2000"
}
In the log file for my xray stream I see:
[Info] Initializing AWS X-Ray daemon 3.2.0
[Debug] Listening on UDP 127.0.0.1:2000
[Info] Using buffer memory limit of 38 MB
[Info] 608 segment buffers allocated
[Debug] Using proxy address:
[Debug] Fetch region us-east-1 from ec2 metadata
[Info] Using region: us-east-1
[Debug] ARN of the AWS resource running the daemon:
[Debug] Using ip-172-31-41-65.ec2.internal hostname for telemetry records
[Debug] Using i-0b2a13c006e33014f Instance Id for Telemetry records
[Debug] Using Endpoint: https://xray.us-east-1.amazonaws.com
[Debug] Telemetry initiated
[Info] HTTP Proxy server using X-Ray Endpoint : https://xray.us-east-1.amazonaws.com
[Debug] Using Endpoint: https://xray.us-east-1.amazonaws.com
[Debug] Batch size: 50
[Info] Starting proxy http server on 127.0.0.1:2000
[Debug] Skipped telemetry data as no segments found
[Debug] Skipped telemetry data as no segments found
And it just keeps with skipping telemetry at the end:
In the docker log file I see tons of UDP Emitters running.
DEBUG c.a.x.e.UDPEmitter { "name" : "writeBehind", "id" : "0ab3649415ffbd7d", "start_time" : 1.600271771496E9, "trace_id" : "1-5f62359b-31d6ea0f342328bac438f7b8", "end_time" : 1.600271771497E9, "aws" : { "xray" : { "sdk_version" : "2.7.1", "sdk" : "X-Ray for Java" } }, "metadata" : { "ClassInfo" : { "Class" : "StoryCardCacheService" } }, "service" : { "runtime" : "OpenJDK 64-Bit Server VM", "runtime_version" : "14.0.2" }
| 2020-09-16T11:56:11.717-04:00 | }
DEBUG c.a.x.e.UDPEmitter Sending UDP packet.
And earlier when it first loaded it was:
DEBUG c.a.x.c.DaemonConfiguration TCPAddress is set to 127.0.0.1:2000.
DEBUG c.a.x.c.DaemonConfiguration UDPAddress is set to 127.0.0.1:2000.
So I know that the docker container via Spring AOP is sending to 127.0.0.1:2000 and I know that the docker daemon is running on elastic beanstalk and listening UDP on the same address, but for some reason they aren't actually talking to each other. I'm sure I'm missing something really simple I'm just out of ideas about what to try to get this working.