AWS X-Ray

X-Ray 是一项服务,收集您应用程序所服务的请求的相关数据,并提供用于查看、筛选和获取数据洞察力的工具,以确定问题和发现优化的机会。对于任何被跟踪的对您应用程序的请求,您不仅可以查看请求和响应的详细信息,还可以查看您的应用程序对下游 AWS 资源、微服务、数据库和 HTTP Web API 进行的调用的详细信息。

X-Ray 开发工具包提供:

  • 拦截器,可添加到您的代码中以跟踪传入 HTTP 请求

  • 客户端处理程序,可分析您的应用程序用来调用其他 AWS 服务的 AWS 开发工具包客户端

  • HTTP 客户端,用于分析对其他内部和外部 HTTP Web 服务的调用

    • Interceptors to add to your code to trace incoming HTTP requests

    • Client handlers to instrument AWS SDK clients that your application uses to call other AWS services

    • An HTTP client to use to instrument calls to other internal and external HTTP web services

该开发工具包还支持分析对 SQL 数据库的调用、自动 AWS 开发工具包客户端分析以及其他功能。


      X-Ray 开发工具包的工作方式

该开发工具包不是直接将跟踪数据发送到 X-Ray,而是将 JSON 分段文档发送到侦听 UDP 流量的守护程序进程。X-Ray 守护程序将分段缓冲在队列中,并将分段批量上传到 X-Ray。该守护程序可用于 Linux、Windows 和 macOS,且包含在 AWS Elastic Beanstalk 和 AWS Lambda 平台上。

X-Ray 使用来自支持您的云应用程序的 AWS 资源的跟踪数据生成详细的服务图。该服务图显示客户端、您的前端服务以及前端服务调用来处理请求和保存数据的后端服务。您可以使用服务图来查明瓶颈、延迟峰值和其他需要解决的问题,以提高应用程序性能。


      服务图显示客户端、您的前端服务以及前端服务调用来处理请求和保存数据的后端服务
Instead of sending trace data directly to X-Ray, the SDK sends JSON segment documents to a daemon process listening for UDP traffic. The  X-Ray daemon buffers segments in a queue and uploads them to X-Ray in batches. The daemon is available for Linux, Windows, and macOS, and is included on AWS Elastic Beanstalk and AWS Lambda platforms.

AWS X-Ray Daemon

The AWS X-Ray daemon is a software application that listens for traffic on UDP port 2000, gathers raw segment data, and relays it to the AWS X-Ray API. The daemon works in conjunction with the AWS X-Ray SDKs and must be running so that data sent by the SDKs can reach the X-Ray service.

Note

The X-Ray daemon is an open source project. You can follow the project and submit issues and pull requests on GitHub: github.com/aws/aws-xray-daemon

On AWS Lambda and AWS Elastic Beanstalk, use those services' integration with X-Ray to run the daemon. Lambda runs the daemon automatically any time a function is invoked for a sampled request. On Elastic Beanstalk, use the XRayEnabled configuration option to run the daemon on the instances in your environment.

To run the X-Ray daemon locally, on-premises, or on other AWS services, download it from Amazon S3run it, and then give it permission to upload segment documents to X-Ray.

猜你喜欢

转载自www.cnblogs.com/cloudrivers/p/11635037.html
AWS