Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question on Usage #69

Open
bmbermn opened this issue Jun 18, 2020 · 7 comments
Open

Question on Usage #69

bmbermn opened this issue Jun 18, 2020 · 7 comments

Comments

@bmbermn
Copy link

bmbermn commented Jun 18, 2020

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.

@Nikschavan
Copy link
Contributor

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.

@bmbermn
Copy link
Author

bmbermn commented Jul 1, 2020

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

`

@rmccue
Copy link
Member

rmccue commented Jul 1, 2020

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.

@bmbermn
Copy link
Author

bmbermn commented Jul 1, 2020

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
Copy link
Author

bmbermn commented Aug 21, 2020

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!

@adambiggs
Copy link

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?

@orrinsheppard
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants