简体   繁体   English

使用 Prometheus 测量 .NET 应用程序的传出 HTTP 请求

[英]Measure outgoing HTTP requests for .NET app with Prometheus

I have a .NET app running on K8s.我有一个在 K8s 上运行的 .NET 应用程序。 It sends a lot of HTTP requests to external services and I'd like to have more visibilty.它向外部服务发送了大量 HTTP 请求,我希望有更多的可见性。 Traefik runs as a proxy but I'm considering replacing it with Ambassador Traefik 作为代理运行,但我正在考虑用大使替换它

For monitoring I use Prometheus.我使用 Prometheus 进行监控。 It works very well with Traefik but gives me only metrics about incoming HTTP requests Prometheus library for .NET looks good https://github.com/prometheus-net/prometheus-net but also unclear if it gives outgoing HTTP calls metrics or not它与 Traefik 配合得很好,但只给了我关于传入 HTTP 请求的指标。 NET 的 Prometheus 库看起来不错https://github.com/prometheus-net/prometheus-net但也不清楚它是否提供传出 HTTP 调用指标

Any help or suggestions are appreciated任何帮助或建议表示赞赏

Answer 1 : I ended up adding log line for every outgoing request, transport to ElasticSearch and counting number of requests in Kibana答案 1 :我最终为每个传出请求添加了日志行,传输到 ElasticSearch 并计算 Kibana 中的请求数

Answer 2 : you can deploy service mesh to your K8s cluster (Linkerd, Istio, Maesh or whatever) and make it transport tracing metrics to Prometheus答案 2 :您可以将服务网格部署到您的 K8s 集群(Linkerd、Istio、Maesh 或其他)并使其将跟踪指标传输到 Prometheus

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

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