管理

告警索引

告警功能创建多个索引和一个别名。安全插件演示脚本将它们配置为系统索引,以提供额外的保护层。请勿在不使用告警 API 的情况下删除这些索引或修改其内容。

索引 用途
.opendistro-alerting-alerts 存储进行中的告警。
.opendistro-alerting-alert-history-<date> 存储已完成的告警历史记录。
.opendistro-alerting-config 存储监控器、触发器和目标。对此索引进行快照以备份您的告警配置。
.opendistro-alerting-alert-history-write(别名) .opendistro-alerting-alert-history-<date> 索引提供一致的 URI。

所有告警索引默认都是隐藏的。要获取摘要,请发出以下请求:


GET _cat/indices?expand_wildcards=open,hidden


告警设置

我们不建议更改这些设置;默认值应适用于大多数用例。

所有设置都可通过 _cluster/settings API 使用。所有设置都不需要重启,并且都可以标记为 persistenttransient。要了解更多关于静态和动态设置的信息,请参阅配置

设置 默认值 描述
plugins.scheduled_jobs.enabled true 告警插件是否启用。如果禁用,所有监控器将立即停止运行。
plugins.alerting.index_timeout 60s 使用 REST API 创建监控器和目标时的超时时间。
plugins.alerting.request_timeout 10s 插件发出的杂项请求的超时时间。
plugins.alerting.action_throttle_max_value 24h 可以为操作限制设置的最长时间。默认情况下,此值在 Dashboards 中显示为 1440 分钟。
plugins.alerting.input_timeout 30s 监控器发出搜索请求的最长时间。
plugins.alerting.bulk_timeout 120s 监控器将告警写入告警索引的最长时间。
plugins.alerting.alert_backoff_count 3 写入告警操作失败前的重试次数。
plugins.alerting.alert_backoff_millis 50ms 重试之间的等待时间——每次失败后指数增加。
plugins.alerting.alert_history_rollover_period 12h 检查 .opendistro-alerting-alert-history-write 别名是否应滚动到新历史索引以及告警插件是否应删除任何历史索引的频率。
plugins.alerting.move_alerts_backoff_millis 250 重试之间的等待时间——每次失败后指数增加。
plugins.alerting.move_alerts_backoff_count 3 删除监控器或触发器后将告警移动到已删除状态的重试次数。
plugins.alerting.monitor.max_monitors 1000 用户可以创建的监控器的最大数量。
plugins.alerting.alert_history_max_age 30d 创建新索引前存储在 .opendistro-alert-history-<date> 索引中的最旧文档。如果此时间段内的告警数量未超过 alert_history_max_docs,告警功能将每个周期创建一个历史索引(例如,每 30 天一个索引)。
plugins.alerting.alert_history_max_docs 1000 创建新索引前存储在 .opendistro-alert-history-<date> 索引中的最大告警数量。
plugins.alerting.alert_history_enabled true 是否创建 .opendistro-alerting-alert-history-<date> 索引。
plugins.alerting.alert_history_retention_period 60d 自动删除历史索引前的存储时间。
plugins.alerting.destination.allow_list ["chime", "slack", "custom_webhook", "email", "test_action"] 允许的目标列表。如果您不希望允许用户使用某种类型的目标,可以将其从此列表中移除,但我们建议保持此设置不变。
plugins.alerting.filter_by_backend_roles "false" 按后端角色限制对监控器的访问。请参阅 告警安全性
plugins.alerting.cross_cluster_monitoring_enabled "true" 切换集群指标监控器是否支持针对远程集群运行。
plugins.scheduled_jobs.sweeper.period 5m 告警功能使用其"作业清扫器"组件定期检查新的或更新的作业。此设置是清扫器检查是否有任何作业(监控器)已更改并需要重新调度的速率。
plugins.scheduled_jobs.sweeper.page_size 100 清扫器的页面大小。您不应需要更改此值。
plugins.scheduled_jobs.sweeper.backoff_millis 50ms 清扫器在重试之间等待的时间——每次失败后指数增加。
plugins.scheduled_jobs.sweeper.retry_count 3 清扫器在抛出错误前应重试的总次数。
plugins.scheduled_jobs.request_timeout 10s 清扫分片以查找作业的请求的超时时间。
plugins.alerting.comments_enabled false 启用或禁用告警插件的评论功能。
plugins.alerting.comments_history_max_docs 1000 创建新索引前存储在 .opensearch-alerting-comments-history-<date> 索引中的最大评论数量。
plugins.alerting.comments_history_max_age 30d 创建新索引前存储在 .opensearch-alerting-comments-history-<date> 索引中的最旧文档。如果指定时间段内的评论数量未超过 comments_history_max_docs,则每个周期创建一个索引(例如,每 30 天一个)。
plugins.alerting.comments_history_rollover_period 12h 确定 .opensearch-alerting-comments-history-write 别名是否应滚动到新索引以及删除旧评论历史索引的频率。
plugins.alerting.comments_history_retention_period 60d 自动删除评论历史索引前的保留时间。
plugins.alerting.max_comment_character_length 2000 评论的最大字符长度。
plugins.alerting.max_comments_per_alert 500 单个告警上可以发布的评论的最大数量。
plugins.alerting.max_comments_per_notification 3 在告警通知的 ctx Mustache 模板变量中包含的每个告警的最大评论数量。