gitlab對外暴露metrics
1、管理者登入
2、點選上中設定小扳手按鈕
3、點選左側菜單欄最下面設定按鈕
4、在名額 - Prometheus中展開并勾選Enable Prometheus Metrics
5、gitlab-ctl restart重新開機生效
6、名額 - Prometheus中有個here快捷跳轉按鈕,點選進入可以看到通路api的路徑,通過api可以看到gitlab metrics資料。
prometheus.yml中配置時 ?token會展示失敗
需要通過以下配置生效
metrics_path: '/-/metrics'
params:
token: [xxxxxxxxx]