Skip to content

Commit 36058aa

Browse files
author
zhang
committed
Prometheus
1 parent dcf0a25 commit 36058aa

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

markdown-file/Prometheus-Install-And-Settings.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,19 @@ scrape_configs:
242242
labels:
243243
instance: nginx1
244244
245+
246+
如果nginx 有加 basic auth,则需要这样:
247+
scrape_configs:
248+
- job_name: "nginx"
249+
metrics_path: /status/format/prometheus
250+
basic_auth:
251+
username: youmeek
252+
password: '123456'
253+
static_configs:
254+
- targets: ['192.168.1.3:9913']
255+
labels:
256+
instance: 'nginx1'
257+
245258
```
246259

247260
- 重启 prometheus:`docker restart prometheus`

0 commit comments

Comments
 (0)