简体   繁体   English

Metricbeat Prometheus 客户端超时使用 Pagespeed Exporter

[英]Metricbeat Prometheus Client Timeout using Pagespeed Exporter

I am currently try to load data from Prometheus Pagespeed Exporter ( https://github.com/foomo/pagespeed_exporter ) directly into ELK using Metricbeat.我目前正在尝试使用 Metricbeat 将数据从 Prometheus Pagespeed Exporter ( https://github.com/foomo/pagespeed_exporter ) 直接加载到 ELK 中。 It seems so, that the Call of Pagespeed Exporter requires more time than Metricbeats offers to scrape the required data.看起来如此,Pagespeed Exporter 的调用需要比 Metricbeats 提供的更多时间来抓取所需的数据。 A Client Timeout occures:发生客户端超时:

unable to decode response from prometheus endpoint: error making http request: Get http://pagespeed-exporter-monitoring:9271/metrics: net/http: request canceled (Client.Timeout exceeded while awaiting headers)

Currently the Request is cancelled after about 10s while the Timeout in metricbeat should be defined like Timeout = Period ( https://www.elastic.co/guide/en/beats/devguide/current/metricset-details.html ).目前,请求在大约 10 秒后被取消,而 metricbeat 中的超时应定义为超时 = 周期( https://www.elastic.co/guide/en/beats/devguide/current/metricset-details.html )。 The Period in my case is configured to 3600s.在我的情况下,Period 配置为 3600s。

metricbeat:
  deployment:
    metricbeatConfig:
      metricbeat.yml: |
        metricbeat.modules:
        - module: prometheus
          enabled: true
          period: 3600s
          hosts: ["pagespeed-exporter-monitoring:9271"]
          metrics_path: /metrics

Is there any option to increase the Timeout or is there any other issue?是否有任何增加超时的选项或是否有任何其他问题?

You can override the timeout on the module config, https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-metricbeat.html#_timeout您可以覆盖模块配置上的超时, https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-metricbeat.html#_timeout

For example:例如:

metricbeat:
  deployment:
    metricbeatConfig:
      metricbeat.yml: |
        metricbeat.modules:
        - module: prometheus
          enabled: true
          period: 3600s
          hosts: ["pagespeed-exporter-monitoring:9271"]
          metrics_path: /metrics
          timeout: 60s # adjust here

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM