简体   繁体   English

如何监控 EC2 中托管的 API (Flask)

[英]How to monitor API (Flask) hosted in EC2

I have deployed a flask application in an EC2 that returns a json when hitting a certain url (with certain parameters).我在 EC2 中部署了一个 flask 应用程序,它在命中某个 url(带有特定参数)时返回 json。

I want to monitor the usage of this API, and use a token to track usage by user.我想监控这个 API 的使用情况,并使用令牌来跟踪用户的使用情况。

Are there any tools that I can integrate, or should I code it from scratch?有没有我可以集成的工具,或者我应该从头开始编写代码?

In the latter case, is there a reference/article I can look up to?在后一种情况下,是否有我可以查阅的参考/文章? Any ideas are be highly appreciated.任何想法都将受到高度赞赏。

perhaps https://pypi.org/project/prometheus-flask-exporter/ in combination with prometheus/alertmanager/grafana can help you?也许https://pypi.org/project/prometheus-flask-exporter/结合 prometheus/alertmanager/grafana 可以帮助你? It allows custom metrics via decorators to track queries by token.它允许通过装饰器自定义指标来跟踪令牌查询。

Greetings Joachim问候约阿希姆

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM