【发布时间】:2021-05-18 18:56:53
【问题描述】:
在我的 API Gateway 日志条目中显示超时,我正在调查它的来源。日志条目有一个 X-Ray 跟踪 ID,但是当我使用 X-Ray 搜索它时,我得到“找不到数据”。
我预计至少有一个节点 APIG 会出现在 X-Ray 中。我错过了什么?
API Gateway CloudWatch Logs Insights 我找不到跟踪
查询字符串:
fields @timestamp, @message
| filter @message like "92300847-04fd-4969-8728-92d12887ee44"
| sort @timestamp desc
| limit 20
| @timestamp | @message |
|---|---|
| 2021-02-12 23:19:52.559 | (92300847-04fd-4969-8728-92d12887ee44) X-ray Tracing ID : Root=1-60270cfb-2e033ce35d226f3f1fc240b0 |
| 2021-02-12 23:19:52.558 | (92300847-04fd-4969-8728-92d12887ee44) Execution failed due to a timeout error |
| 2021-02-12 23:19:52.558 | (92300847-04fd-4969-8728-92d12887ee44) Gateway response type: DEFAULT_5XX with status code: 504 |
| 2021-02-12 23:19:52.558 | (92300847-04fd-4969-8728-92d12887ee44) Method completed with status: 504 |
| 2021-02-12 23:19:23.558 | (92300847-04fd-4969-8728-92d12887ee44) API Key authorized because method 'GET /shifts' does not require API Key. Request will not contribute to throttle or quota limits |
| 2021-02-12 23:19:23.558 | (92300847-04fd-4969-8728-92d12887ee44) Usage Plan check succeeded for API Key and API Stage eejmp2ziyc/prod |
| 2021-02-12 23:19:23.558 | (92300847-04fd-4969-8728-92d12887ee44) Starting execution for request: 92300847-04fd-4969-8728-92d12887ee44 |
| 2021-02-12 23:19:23.558 | (92300847-04fd-4969-8728-92d12887ee44) HTTP Method: GET, Resource Path: /shifts |
| 2021-02-12 23:19:23.557 | (92300847-04fd-4969-8728-92d12887ee44) Verifying Usage Plan for request: 92300847-04fd-4969-8728-92d12887ee44. API Key: API Stage: eejmp2ziyc/prod |
| 2021-02-12 23:19:23.556 | (92300847-04fd-4969-8728-92d12887ee44) Extended Request Id: ap73UGVmPHcFX1g= |
Api Gateway CloudWatch Logs Insights 我可以找到跟踪
查询字符串:
fields @timestamp, @message
| sort @timestamp desc
| filter @message like "b80e4922-7f18-4024-8f9a-fadba068f0c1"
| @timestamp | @message |
|---|---|
| 2021-02-17 07:15:23.939 | (b80e4922-7f18-4024-8f9a-fadba068f0c1) Successfully completed execution |
| 2021-02-17 07:15:23.939 | (b80e4922-7f18-4024-8f9a-fadba068f0c1) Method completed with status: 200 |
| 2021-02-17 07:15:23.939 | (b80e4922-7f18-4024-8f9a-fadba068f0c1) AWS Integration Endpoint RequestId : 9686fa9d-262d-41e9-bd3f-b261ad06297a |
| 2021-02-17 07:15:23.939 | (b80e4922-7f18-4024-8f9a-fadba068f0c1) X-ray Tracing ID : Root=1-602cc28a-5b6bd5b11e2a02235a292a15 |
| 2021-02-17 07:15:22.457 | (b80e4922-7f18-4024-8f9a-fadba068f0c1) Starting execution for request: b80e4922-7f18-4024-8f9a-fadba068f0c1 |
| 2021-02-17 07:15:22.457 | (b80e4922-7f18-4024-8f9a-fadba068f0c1) HTTP Method: GET, Resource Path: /scheduleSummary |
| 2021-02-17 07:15:22.456 | (b80e4922-7f18-4024-8f9a-fadba068f0c1) API Key authorized because method 'GET /scheduleSummary' does not require API Key. Request will not contribute to throttle or quota limits |
| 2021-02-17 07:15:22.456 | (b80e4922-7f18-4024-8f9a-fadba068f0c1) Usage Plan check succeeded for API Key and API Stage eejmp2ziyc/prod |
| 2021-02-17 07:15:22.454 | (b80e4922-7f18-4024-8f9a-fadba068f0c1) Verifying Usage Plan for request: b80e4922-7f18-4024-8f9a-fadba068f0c1. API Key: API Stage: eejmp2ziyc/prod |
| 2021-02-17 07:15:22.453 | (b80e4922-7f18-4024-8f9a-fadba068f0c1) Extended Request Id: a4NVpGGIPHcFevg= |
X 射线
【问题讨论】:
-
您在 Api Gateway Stage 上检查过
Enable X-Ray Tracing? -
@BaluVyamajala,是的,它已启用。否则,该跟踪 ID 将不会显示在 APIG 日志中...
-
好的。只是 X-Ray 中缺少这个超时请求还是其他所有内容?
-
@BaluVyamajala X-Ray 正在显示痕迹并有数据,特别是我找不到的这个。不幸的是,我没有简单的方法来判断是否有任何其他痕迹“丢失”
-
这条轨迹可能没有被采样,因此没有被 XRay 记录下来。您能否找到采样跟踪的日志并将其粘贴到此处,以便我们比较
X-ray Tracing ID看起来是否有任何不同?
标签: amazon-web-services aws-xray