4

如何记录并统计 API 的调用,异常,有没有免费的网关组件,求教

 2 years ago
source link: https://www.v2ex.com/t/794352
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

V2EX  ›  程序员

如何记录并统计 API 的调用,异常,有没有免费的网关组件,求教

  daijinming · 9 小时 0 分钟前 · 680 次点击

最近我们竟让对接一些第三方的 API,但是这些 API 经常会出现问题,比如网络访问不可用,500 异常,请教下是否有开源免费的网关组件,可以记录,统计 API 的调用情况,最好能有个查看界面

4 条回复    2021-08-08 12:12:35 +08:00

whileFalse

whileFalse   8 小时 34 分钟前 via iPhone

用 node 随便写一个反代有多难。

0bit

0bit   8 小时 9 分钟前   ❤️ 1

简单版本是自己在调用时,包裹一层异常捕获,然后输出到 Sentry 或 Prometheus 之类的服务上( Prometheus 还得加 Grafana );
复杂的版本是用服务网格( Istio, Linkerd 2 ),然后捕获通信,再输出到 Prometheus;

一楼说的方法好像也很巧妙,写一个服务专门代理第三方请求,然后很方便的就能统计异常了。

janxin

janxin   5 小时 5 分钟前

调用走监控一类的就可以了吧,比如数据发送至 sentry,自带页面和统计;或者发送到 Prometheus,用 Grafana 展示。

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK