2

I'm looking for AWS X-Ray instrumentation of a PHP application. I may be wrong, but the AWS PHP Sdk is only about getting trace data back from X-Ray.

So, It seems that I need to send Json fragments to a X-Ray daemon.

I'm wondering why PHP instrumentation support is not provided out of the box ?

1 Answers1

3

The AWS SDK only provides the API to AWS services.

AWS X-Ray has been releasing it's own set of SDKs for instrumenting applications but only Node.js, Java, .Net, Python and GoLang are currently supported. We have plans to cover more languages in the near future.

Hope this helps.

AWSSandra
  • 374
  • 1
  • 7
  • What about PHP then ? –  Sep 08 '17 at 12:04
  • X-Ray has yet to release a PHP SDK. As far as I know, there's no existing repo on Github either. – AWSSandra Sep 12 '17 at 17:24
  • XRayClient->putTraceSegments from the PHP SDK seems to work, even without the Daemon running. How to get the Daemon to watch for calls made to the AWS PHP SDK automatically, as is done for other languages, I do not know. https://docs.aws.amazon.com/aws-sdk-php/v3/api/index.html – entitycs Jun 19 '18 at 20:22
  • @DustinCharles, but what about "openSegment" and "closeSegment". The two APIs seem to me to be very different. Have you used it successfully in PHP? Do you maybe have some sample code somewhere? – khusseini Feb 05 '19 at 15:51
  • I think there's some confusion. There's the AWS SDK which is the client for all public AWS APIs, and there's the X-Ray SDK. The X-Ray SDK captures and constructs data into segments (by suppling middleware for popular frameworks, context propagation, capture statements etc), which is sent to the X-Ray Daemon, which handles auth/batches/retries to PutTraceSegments. There is a WIP PHP SDK here: https://github.com/jcchavezs/aws-xray-sdk-php. – AWSSandra Feb 06 '19 at 17:31
  • Technically you can hit the public APIs without the Daemon or SDK, but you must construct the segment data manually. You can see the segment info here: https://docs.aws.amazon.com/xray/latest/devguide/xray-concepts.html#xray-concepts-segments – AWSSandra Feb 06 '19 at 17:35
  • @moz - Yes, I have constructed segment data manually as mentioned by AWSSandra without much difficulty. Mainly, you just need to pass the traceID field around like a baton. – entitycs Feb 06 '19 at 18:51
  • @moz - The code I've written is protected, but I can tell you that we deprecated its purpose anyhow, in favor of some etl jobs and crawlers. – entitycs Feb 09 '19 at 00:04