带有Prometheus的弹簧靴和Micrometer第5部分:旋转Prometheus
以前,我們獲得了Spring Boot Application適配器,以便為Prometheus公開端點。
該博客將重點介紹如何設置和配置Prometheus,以便為Spring Boot端點提供服務器。
因此,讓我們開始使用docker來啟動Prometheus服務器。
在繼續進行Prometheus升級之前,我們需要提供一個配置文件以從應用程序中提取數據。
因此,我們應該提供包含以下內容的prometheus.yaml文件。
讓我們使用從此處獲取的命令。
由于通過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:// localhost:9090 / graph,我們將被Prometheus屏幕所歡迎。
同樣,在我們的prometheus容器內,我們還能夠與應在本地運行的應用程序進行通信。
因此,讓我們花一些時間看看是否已收集數據。 然后,我們轉到Prometheus狀態頁面http:// localhost:9090 / status 。
我們將被我們的應用程序的JVM信息所吸引。
在下一個博客中,我們將重點介紹保護Prometheus 端點的方法 。
翻譯自: https://www.javacodegeeks.com/2020/05/spring-boot-and-micrometer-with-prometheus-part-5-spinning-up-prometheus.html
創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎總結
以上是生活随笔為你收集整理的带有Prometheus的弹簧靴和Micrometer第5部分:旋转Prometheus的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: csgo自动截图快捷键(csgo自动截图
- 下一篇: maple软件怎么读(maple怎么读?