When adding Prometheus instrumentation with Java or .NET, is the web server for metrics running in a separate thread?

huangapple go评论71阅读模式
英文:

When adding Prometheus instrumentation with Java or .NET, is the web server for metrics running in a separate thread?

问题

当使用Java https://github.com/prometheus/client_java或.NET https://github.com/prometheus-net/prometheus-net的客户端库添加Prometheus仪表盘时,该仪表盘是否在微服务的单独线程中启动度量数据Web服务器?

如果已经将被仪表化的微服务作为Web服务器运行在80端口上,我们是否可以在同一微服务中通过单独的仪表化Web服务器将度量数据暴露在不同的端口,比如9001端口?

英文:

When adding Prometheus instrumentation with a client library for Java https://github.com/prometheus/client_java or .NET https://github.com/prometheus-net/prometheus-net, does the instrumentation spin out a metrics web server in a separate thread of the microservice?

What if the instrumented microservice is already running as a web server on port 80, can we expose metrics on a different port let's say 9001 with a separate instrumentation web server running in the same microservice?

答案1

得分: 1

这取决于你如何使用这些库。

例如,正如你所链接的库的快速入门部分所示,你可以启动一个额外的服务器,使用不同的端口,专门用于暴露指标。

但你也可以使用当前的路由来暴露指标,例如文档中ASP.NET Web API exporter部分所示。

英文:

It depends oh how you are using those libraries.

For example, as shown at Quick start of linked by you library, you can start additional server on separate port, just for purposes of exposing metrics.

But you also can expose metrics using your current routing, for example like shown at ASP.NET Web API exporter part of documentation.

huangapple
  • 本文由 发表于 2023年5月17日 14:33:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/76269133.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定