Prometheus monitoring different servers with authentication

Viewed 424

I was trying to install Prometheus that will monitor multiple nodes at once. The problem is that each node has a different basic auth configuration and I didn't find a way how to configure that specifically for each target. I tried something like

global:
    scrape_interval: 15s
    
scrape_config:
    job_name: My scraper
    static_configs:
        - targets:
            - www.1.org
          # How to configure auth per each target?
          labels:
              nodeName: name
        - targets:
            www.2.org

Also, it would be great if the credentials could be provided in the file or environment variable but I didn't find any tutorial for it. I went through the official documentation

0 Answers
Related