开通网站的会计科目怎么做,wap注册,WordPress修改笔记,物联网平台建设方案以前#xff0c;我们获得了Spring Boot Application适配器#xff0c;以便为Prometheus公开端点。 该博客将重点介绍如何设置和配置Prometheus#xff0c;以便为Spring Boot端点提供服务器。 因此#xff0c;让我们开始使用docker来启动Prometheus服务器。 在继续进行Pr… 以前我们获得了Spring Boot Application适配器以便为Prometheus公开端点。 该博客将重点介绍如何设置和配置Prometheus以便为Spring Boot端点提供服务器。 因此让我们开始使用docker来启动Prometheus服务器。 在继续进行Prometheus升级之前我们需要提供一个配置文件以从应用程序中提取数据。 因此我们应该提供一个prometheus.yaml文件其中包含以下内容。 scrape_configs: - job_name: prometheus-spring scrape_interval: 1m metrics_path: /actuator/prometheus static_configs: - targets: [ my.local.machine:8080 ] 让我们使用从此处获取的命令。 由于通过docker在osx上使用了prometheus因此我们需要一些解决方法来通过应用进行连接 sudo ifconfig lo0 alias 172.16.222.111 我们可以直接使用docker docker run - v /path/to/prometheus .yaml: /etc/prometheus/prometheus .yml -p 9090:9090 --add-host my.local.machine:172.16.222.111 prom /prometheus 通过以上操作我们将能够从docker映像内部与本地应用程序进行交互。 因此如果我们导航到http// localhost9090 / graph我们将被Prometheus屏幕所欢迎。 同样在我们的prometheus容器内我们还能够与应在本地运行的应用程序进行通信。 因此让我们花一些时间看看是否已收集数据。 然后我们转到Prometheus状态页面http// localhost9090 / status 。 我们将被我们的应用程序的JVM信息所欢迎。 在下一个博客中我们将重点介绍保护Prometheus 端点的方法 。 翻译自: https://www.javacodegeeks.com/2020/05/spring-boot-and-micrometer-with-prometheus-part-5-spinning-up-prometheus.html