Context Deadline Exceeded - prometheus

后端 未结 8 1406
长情又很酷
长情又很酷 2021-02-12 20:07

I have Prometheus configuration with many jobs where I am scraping metrics over HTTP. But I have one job where I need to scrape the metrics over HTTPS.

When I access:

8条回答
  •  生来不讨喜
    2021-02-12 21:00

    I had a similar problem, so I tried to extend my scrape_timeout but it didn't do anything - using promtool, however, explained the problem

    My problematic job looked like this:

    - job_name: 'slow_fella'
      scrape_interval: 10s
      scrape_timeout: 90s
      static_configs:
      - targets: ['192.168.1.152:9100']
        labels:
          alias: sloooow    
    

    check your config like this:

    /etc/prometheus $ promtool check config prometheus.yml
    

    Result explains the problem and indicates how to solve it:

    Checking prometheus.yml
      FAILED: parsing YAML file prometheus.yml: scrape timeout greater than scrape interval for scrape config with job name "slow_fella"
    

    Just ensure that your scrape_timeout is long enough to accommodate your required scrape_interval.

提交回复
热议问题