前面講了安裝jenkins exporter方式監控jenkins,但是grafana支援較少。
接下來,我們用Jenkins plugin的方式監控,這個方法部署簡單,然後grafana支援比較完整。
首先,需要安裝Jenkins,參照上一個文件完成。
1.安裝Jenkins Plugin開啟外掛管理介面
搜尋Prometheus外掛
安裝完成重啟生效
2.檢查外掛配置檢查配置
儲存配置
設定完成後重啟Jenkins服務,並且訪問jenkins的url檢視指標情況
訪問 http://192.168.0.107:8080/prometheus/
# HELP jvm_threads_current Current thread count of a JVM# TYPE jvm_threads_current gaugejvm_threads_current 34.0# HELP jvm_threads_daemon Daemon thread count of a JVM# TYPE jvm_threads_daemon gaugejvm_threads_daemon 16.0# HELP jvm_threads_peak Peak thread count of a JVM# TYPE jvm_threads_peak gaugejvm_threads_peak 47.0# HELP jvm_threads_started_total Started thread count of a JVM# TYPE jvm_threads_started_total counterjvm_threads_started_total 73.0# HELP jvm_threads_deadlocked Cycles of JVM-threads that are in deadlock waiting to acquire object monitors or ownable synchronizers# TYPE jvm_threads_deadlocked gaugejvm_threads_deadlocked 0.0
3. Prometheus監控JenkinsPrometheus配置檔案/etc/prometheus/prometheus.yml,新增如下內容:scrape_configs: - job_name: "jenkins" metrics_path: "/prometheus/" scheme: http static_configs: - targets: ['192.168.0.107:8080']這裡如果用的是tls, 用下面的配置scrape_configs: - job_name: 'jenkins' scheme: https # change to http if don't you have https metrics_path: '/prometheus/' static_configs: - targets: ['192.168.0.107:443'] # Jenkins host and port you serve tls_config: insecure_skip_verify: true重啟Prometheussystemctl restart prometheus
檢查Prometheus Target
Prometheus Target
4.Grafana模板這裡我使用模板 https://grafana.com/grafana/dashboards/9964
匯入模板
Jenkins監控
至此,完成Prometheus對Jenkins的監控。
推薦此方法。
最新評論
熱門排行
- GC類壓力管道安裝資質辦理,氨製冷(冷庫)管道定期檢驗程序
- 幾種PCBA表面處理的類型
- 歌禮制藥-B(01672)宣佈口服PD-L1小分子抑制劑前藥ASC61 用於治療晚期實體瘤的美國I期臨床試驗完成首例患者給藥
- 深耕CRO服務領域 宣泰醫藥(688247.SH)擬首次公開發行4534萬股
- 壓力容器許可證資質辦理,鉻鉬鋼製壓力容器結構設計規定
- 家裡有點地,這種果樹種上兩棵,栽到花盆裡,夏天就能結果子
- 家裡養株“大將軍”蘭花,花色喜慶,花大如盆,打理很簡單
- 庫存飆升!韓國半導體庫存激增80%
- 多點DMALL合夥人劉桂海:多點DMALL實踐實體零售數字化轉型
- 豬各階段拉稀的原因和解決方案,這篇文章告訴你答案,值得收藏