رفتن به محتوا

راه‌اندازی Prometheus

Scraping مستقیم

پیکربندی پایه prometheus.yml:

scrape_configs:
- job_name: "xray-checker"
metrics_path: "/metrics"
static_configs:
- targets: ["localhost:2112"]
scrape_interval: 1m

با احراز هویت:

scrape_configs:
- job_name: "xray-checker"
metrics_path: "/metrics"
basic_auth:
username: "metricsUser"
password: "MetricsVeryHardPassword"
static_configs:
- targets: ["localhost:2112"]

یکپارچه‌سازی Pushgateway

پیکربندی Prometheus برای Pushgateway:

scrape_configs:
- job_name: "pushgateway"
honor_labels: true
static_configs:
- targets: ["pushgateway:9091"]

پیکربندی Xray Checker:

Terminal window
METRICS_PUSH_URL="http://user:password@pushgateway:9091"