安装插件:插件管理>可选插件,安装如下插件。

Prometheus metrics plugin

系统设置:找到prometheus的设置项进行设置。

image.png

metrics地址:

http://192.168.0.18:8080/prometheus/

在prometheus中添加配置:

- job_name: 'jenkins'
  metrics_path: '/prometheus/'
  static_configs:
      - targets: ['jenkins.example.org:443']

在grafana中添加dashborad图形即可。