aws-xray icon indicating copy to clipboard operation
aws-xray copied to clipboard

Question on Usage

Open bmbermn opened this issue 5 years ago • 7 comments

Hello,

I have a GoDaddy Dedicated server and have installed the x-ray agent, credentials, and the aws-xray plugin you provided but nothing appears to be sent to AWS.

bash-4.1# xray -o -n us-west-2 2020-06-18T07:27:09-07:00 [Info] Initializing AWS X-Ray daemon 3.2.0 2020-06-18T07:27:09-07:00 [Info] Using buffer memory limit of 327 MB 2020-06-18T07:27:09-07:00 [Info] 5232 segment buffers allocated 2020-06-18T07:27:09-07:00 [Info] Using region: us-west-2 2020-06-18T07:27:09-07:00 [Info] HTTP Proxy server using X-Ray Endpoint : https://xray.us-west-2.amazonaws.com 2020-06-18T07:27:09-07:00 [Info] Starting proxy http server on 127.0.0.1:2000

This looks to be correct to me. Can you give me any idea on a way to test this or see if it is working as expected? The Wordpress site is getting clicks and the plugin is enabled.

bmbermn avatar Jun 18 '20 14:06 bmbermn

If everything is working, you should see these logs in the X-Ray daemon logs - https://docs.aws.amazon.com/xray/latest/devguide/xray-daemon.html#xray-daemon-logging

Particularly something similar to -

2016-11-24T06:07:08Z [Info] Successfully sent batch of 1 segments (0.123 seconds)
2016-11-24T06:07:09Z [Info] Successfully sent batch of 1 segments (0.006 seconds)

Do confirm if you have installed xhprof PHP extension, you should see it in PHP info.

Nikschavan avatar Jul 01 '20 01:07 Nikschavan

Hello,

Yes I can. [root@s192-169-216-152 ~]# php -m | grep xhprof xhprof I can also confirm the following in the log: `[root@s192-169-216-152 ~]# /usr/bin/xray -n us-west-2 & [1] 26518 [root@s192-169-216-152 ~]# 2020-07-01T08:00:12-07:00 [Info] Initializing AWS X-Ray daemon 3.2.0 2020-07-01T08:00:12-07:00 [Info] Using buffer memory limit of 327 MB 2020-07-01T08:00:12-07:00 [Info] 5232 segment buffers allocated 2020-07-01T08:00:12-07:00 [Info] Using region: us-west-2

[root@s192-169-216-152 ~]# tail -f /var/log/xray/xray.log 2020-07-01T07:58:36-07:00 [Info] Using buffer memory limit of 327 MB 2020-07-01T07:58:36-07:00 [Info] 5232 segment buffers allocated 2020-07-01T07:59:17-07:00 [Error] Unable to retrieve the region from the EC2 instance EC2MetadataRequestError: failed to get EC2 instance identity document caused by: RequestError: send request failed caused by: Get http://169.254.169.254/latest/dynamic/instance-identity/document: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

2020-07-01T07:59:17-07:00 [Error] Cannot fetch region variable from config file, environment variables and ec2 metadata. 2020-07-01T07:59:17-07:00 [Info] Initializing AWS X-Ray daemon 3.2.0 2020-07-01T07:59:17-07:00 [Info] Using buffer memory limit of 327 MB 2020-07-01T07:59:17-07:00 [Info] 5232 segment buffers allocated

2020-07-01T08:01:13-07:00 [Error] Get instance id metadata failed: RequestError: send request failed caused by: Get http://169.254.169.254/latest/meta-data/instance-id: net/http: request canceled while waiting for connection (Client.Timeoutexceeded while awaiting headers) 2020-07-01T08:01:13-07:00 [Info] HTTP Proxy server using X-Ray Endpoint : https://xray.us-west-2.amazonaws.com 2020-07-01T08:01:13-07:00 [Info] Starting proxy http server on 127.0.0.1:2000

`

bmbermn avatar Jul 01 '20 15:07 bmbermn

Looks like you need to configure the X-Ray daemon based on that, as it looks like you don't have an IAM instance profile.

rmccue avatar Jul 01 '20 16:07 rmccue

Hi, its actually configured, I just forgot to use -o on launch that time (since its not inside AWS). [root@s192-169-216-152 ~]# /usr/bin/xray -o -n us-west-2 & [1] 31010 [root@s192-169-216-152 ~]# 2020-07-01T09:42:13-07:00 [Info] Initializing AWS X-Ray daemon 3.2.0 2020-07-01T09:42:13-07:00 [Info] Using buffer memory limit of 327 MB 2020-07-01T09:42:13-07:00 [Info] 5232 segment buffers allocated 2020-07-01T09:42:13-07:00 [Info] Using region: us-west-2 2020-07-01T09:42:13-07:00 [Info] HTTP Proxy server using X-Ray Endpoint : https://xray.us-west-2.amazonaws.com 2020-07-01T09:42:13-07:00 [Info] Starting proxy http server on 127.0.0.1:2000

bmbermn avatar Jul 01 '20 16:07 bmbermn

Hello, Is there any update on this? I am still unable to see any info coming from non AWS servers via Xray plugin. Thanks for your help!

bmbermn avatar Aug 21 '20 20:08 bmbermn

I'm having the same problem. I have installed and activated the aws-xray plugin, and have a sidecar container running the official amazon/aws-xray-daemon Docker image, and I confirmed that the xhprof extension is installed.

But I never get any X-Ray log messages after the initial daemon startup sequence.

Any ideas? Do you have usage instructions documented somewhere?

adambiggs avatar Dec 24 '21 19:12 adambiggs

@adambiggs Did you ever figure this out? I am having the same issue. Plugin/xhprof extension installed, X-Ray agent running w/ IAM permissions, but no X-Ray logs messages after the start-up.

I have added debug logs and determined that the !function_exists(namespace . '\bootstrap' ) conditional is returning, which apparently means X-Ray is disabled? Wordpress shows the plugin as active, though. Any help here would be greatly appreciated.

orrinsheppard avatar Nov 18 '22 05:11 orrinsheppard