用户请求通过您的 Amazon API Gateway API 传输到底层服务时,您可以使用 来跟踪和分析用户请求,API Gateway 支持所有 API Gateway 终端节点类型的 AWS X-Ray 跟踪:区域、边优化和私有。借助 Amazon API Gateway,您可以在 X-Ray 可用的所有区域使用 AWS X-Ray。
X-Ray 为您提供了整个请求的端到端视图,因此您可以分析 API 中的延迟及其后端服务。您可以使用 X-Ray 服务地图,以查看整个请求的延迟及集成了 X-Ray 下游服务的延迟。您可以配置规则以告知 X-Ray 根据您指定的标准以哪种采样率记录哪些请求。如果您从正在跟踪的服务中调用 API Gateway,则 API Gateway 会通过跟踪,即使 X-Ray 跟踪在 API 上未启用。
您可以使用 X-Ray 管理控制台启用 API Gateway 的 API 阶段,或使用 API Gateway API 或 CLI。
You can use to trace and analyze user requests as they travel through your Amazon API Gateway APIs to the underlying services. API Gateway supports AWS X-Ray tracing for all API Gateway endpoint types: regional, edge-optimized, and private. You can use AWS X-Ray with Amazon API Gateway in all regions where X-Ray is available.
X-Ray gives you an end-to-end view of an entire request, so you can analyze latencies in your APIs and their backend services. You can use an X-Ray service map to view the latency of an entire request and that of the downstream services that are integrated with X-Ray. And you can configure sampling rules to tell X-Ray which requests to record, at what sampling rates, according to criteria that you specify. If you call an API Gateway API from a service that's already being traced, API Gateway passes the trace through, even if X-Ray tracing is not enabled on the API.
You can enable X-Ray for an API stage by using the API Gateway management console, or by using the API Gateway API or CLI.