在 Web 服务器级别监视 Web API 响应时间

Monitor web API response time in web server level

我正在尝试为我的 Web 应用程序测量一些指标(特别是不同 URL 的响应时间),这些指标将承受一些用户负载。我选择了InfluxDB as it can handle large amount of data and integerates nicely with Grafana (Graphite is also OK for me). I was going to post my reponse times from my flask app into InfluxDB using influxdb python client.

我想知道是否有一种工具或一种简单的方法可以从 NGINXuWSGI 中填充 InfluxDB 以获得更好的性能并从我的 python 应用程序中卸载它们?

如果您想将网络服务器的性能数据提供给 InfluxDB,有几种方法可以做到。我会向您推荐以下内容:

  1. 让您的网络服务器通过系统日志记录它的请求
  2. 使用syslog-ng处理日志
  3. syslog-ng 可以将数据发送到 Graphite:Link
  4. InfluxDB内置了一个Graphite适配器,可以读取Graphite协议并将数据放入InfluxDB
  5. 使用Grafana显示您的InflxuDB数据

这只是一个示例工具链。您还可以使用 CollectD 来收集您的性能指标并将其发送到 InfluxDB 的石墨适配器。但我认为 syslog-ng 解决方案更优雅。