跟踪AWS ApiGateway中的完整请求/响应主体(未截断) [英] Trace full-request / response bodies in AWS ApiGateway (not truncated)

查看:102
本文介绍了跟踪AWS ApiGateway中的完整请求/响应主体(未截断)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用AWS Api Gateway,并且我想跟踪完整的请求和响应.我的一些集成是lambda和其他一些http终结点.

I am using AWS Api Gateway and I'd like to trace full request and response. Some of my integrations are lambdas and some other http endpoints.

我启用了阶段>日志>记录完整的请求/响应数据",我可以在CloudWatch上看到日志.

I enabled stage > Logs > "Log full requests/responses data" and I can see logs on CloudWatch.

这似乎很完美,直到我发现尸体被截断 ...... ApiGateway中将日志发送到cloudwatch的限制为1024字节.

This seemed to be perfect until I discovered bodies were being TRUNCATED... There is a limitation of 1024 bytes in ApiGateway sending logs to cloudwatch.

对此有什么解决办法吗?

Is there any solution to this?

我正在考虑使用lambda作为代理(带有http-proxy)作为我的最后选择...

I am considering using a lambda as a proxy (with http-proxy) as my last option...

谢谢

推荐答案

如您所述,目前尚无此问题的已知解决方案,AWS意识到了这一问题.

As you stated, there is no current known solution to this problem and AWS is aware of the problem.

API网关当前将日志事件限制为1024个字节.大于1024字节的日志事件(例如请求和响应主体)将在提交到CloudWatch Logs之前被API Gateway截断.

API Gateway currently limits log events to 1024 bytes. Log events larger than 1024 bytes, such as request and response bodies, will be truncated by API Gateway before submission to CloudWatch Logs.

您可以在此处的API网关的AWS文档页面上看到其他已知问题.

You can see additional known issues at the AWS documentation page for API Gateway here.

https://docs.aws .amazon.com/apigateway/latest/developerguide/api-gateway-known-issues.html

这篇关于跟踪AWS ApiGateway中的完整请求/响应主体(未截断)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆