加载中

为独立 Elastic Agents 配置监控

Elastic Agent 默认监控 Beats。要关闭或更改监控设置,请在 elastic-agent.yml 文件中的 agent.monitoring 下设置选项。

此示例配置了 Elastic Agent 监控

agent.monitoring:
  # enabled turns on monitoring of running processes
  enabled: true
  # enables log monitoring
  logs: true
  # enables metrics monitoring
  metrics: true
  # exposes /debug/pprof/ endpoints for Elastic Agent and Beats
  # enable these endpoints if the monitoring endpoint is set to localhost
  pprof.enabled: false
  # specifies output to be used
  use_output: monitoring
  http:
    # exposes a /buffer endpoint that holds a history of recent metrics
    buffer.enabled: false

要关闭监控,请将 agent.monitoring.enabled 设置为 false。当设置为 false 时,Beats 监控将关闭,并且本节中的所有其他选项都将被忽略。

要启用监控,请将 agent.monitoring.enabled 设置为 true。同时设置 logsmetrics 选项来控制是收集日志、指标还是两者都收集。如果未指定任何设置,监控将关闭。设置 use_output 以指定发送监控事件的输出。

您还可以添加设置 agent.monitoring.http.enabled: true 以暴露一个 /liveness 端点。默认情况下,只要 Elastic Agent 的内部主循环响应正常并能处理配置更改,该端点就会返回 200 OK 状态。可以将其配置为同时监控组件状态,并在任何组件降级或失败时返回错误。

agent.monitoring.pprof.enabled 选项控制 Elastic Agent 和 Beats 是否与监控端点一起暴露 /debug/pprof/ 端点。默认情况下,它设置为 false。这些端点产生的数据可能对调试有用,但存在安全风险。如果监控端点可以通过网络访问,建议此选项保持为 false

agent.monitoring.http.buffer.enabled 选项控制 Elastic Agent 和 Beats 是否将指标收集到内存缓冲区并通过 /buffer 端点暴露这些指标。默认情况下,它设置为 false。此数据可能对调试有用,或者在 Elastic Agent 与 Elasticsearch 通信出现问题时有用。启用此选项可能会略微增加进程内存使用量。

© . All rights reserved.