- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我似乎无法找出为什么 Alertmanager 没有收到来自 Prometheus 的警报。如果能迅速协助应对这一挑战,我将不胜感激。我对使用 Prometheus 和 Alertmanager 还很陌生。我正在使用 MsTeams 的 webhook 来推送来自 alertmanager 的通知。
Alertmanager.yml
global:
resolve_timeout: 5m
route:
group_by: ['critical','severity']
group_wait: 10s
group_interval: 10s
repeat_interval: 1h
receiver: 'alert_channel'
receivers:
- name: 'alert_channel'
webhook_configs:
- url: 'http://localhost:2000/alert_channel'
send_resolved: true
prometheus.yml - (只是其中的一部分)
# my global config
global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
# scrape_timeout is set to the global default (10s).
# Alertmanager configuration
alerting:
alertmanagers:
- static_configs:
- targets:
- localhost:9093
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
# - "first_rules.yml"
# - "second_rules.yml"
- alert_rules.yml
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: 'kafka'
# metrics_path defaults to '/metrics'
# scheme defaults to 'http'
static_configs:
- targets: ['localhost:8080']
labels:
service: 'Kafka'
alertmanager.service
[Unit]
Description=Prometheus Alert Manager
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
User=alertmanager
Group=alertmanager
ExecStart=/usr/local/bin/alertmanager \
--config.file=/etc/alertmanager/alertmanager.yml \
--storage.path=/data/alertmanager \
--web.listen-address=127.0.0.1:9093
Restart=always
[Install]
WantedBy=multi-user.target
groups:
- name: alert_rules
rules:
- alert: ServiceDown
expr: up == 0
for: 1m
labels:
severity: "critical"
annotations:
summary: "Service {{ $labels.service }} down!"
description: "{{ $labels.service }} of job {{ $labels.job }} has been down for more than 1 minute."
- alert: HostOutOfMemory
expr: node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes * 100 < 25
for: 5m
labels:
severity: warning
annotations:
summary: "Host out of memory (instance {{ $labels.instance }})"
description: "Node memory is filling up (< 25% left)\n VALUE = {{ $value }}\n LABELS: {{ $labels }}"
- alert: HostOutOfDiskSpace
expr: (node_filesystem_avail_bytes{mountpoint="/"} * 100) / node_filesystem_size_bytes{mountpoint="/"} < 40
for: 1s
labels:
severity: warning
annotations:
summary: "Host out of disk space (instance {{ $labels.instance }})"
description: "Disk is almost full (< 40% left)\n VALUE = {{ $value }}\n LABELS: {{ $labels }}"
我现在没主意了。我需要帮助。我从上周开始就在研究这个问题。
最佳答案
您的 Alertmanager 配置有误。 group_by
需要一个 label names 的集合,据我所知,critical
是一个标签值,而不是名称。所以只需删除 critical
就可以了。
另请查看此博客文章,很有帮助https://www.robustperception.io/whats-the-difference-between-group_interval-group_wait-and-repeat_interval
编辑 1
如果您希望接收器 alert_channel
仅接收严重性为 critical
的警报,您必须创建一个路由并使用 match
属性.
沿着这些线的东西:
route:
group_by: ['...'] # good if very low volum
group_wait: 15s
group_interval: 5m
repeat_interval: 1h
routes:
- match:
- severity: critical
receiver: alert_channel
编辑2
如果这不起作用,试试这个:
route:
group_by: ['...']
group_wait: 15s
group_interval: 5m
repeat_interval: 1h
receiver: alert_channel
这应该有效。检查您的 Prometheus 日志,看看您是否在那里找到提示
关于monitoring - 警报在 Prometheus 上触发,但在 Alertmanager 上不触发,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64352020/
我是 iOS 开发新手。我正在解决的是如何在 iPhone 中运行我的应用程序时获取有关该应用程序的信息。 例如:当我在 Android 中开发时,我连接手机(使用净化模式)并打开 Android M
我仍然不确定这两个调用之间的区别。来自 MSDN, Monitor.Enter(Object) 获取指定对象的独占锁。 Monitor.Wait(Object) 释放对象上的锁并阻塞当前线程,直到它重
我是 GCP 的新手并且来自 Azure 背景。在 GCP 端是否有等效的“Azure Application Insights”用于监控应用程序? 让我用一个例子更清楚地解释我的用例:如果我有一个基
这是说明问题的最小代码: StringBuilder input = new StringBuilder(); void ToUpper() { lock (input) {
我在 ASP.NET 中有一个生产者-消费者场景。我设计了一个Producer 类,一个Consumer 类和一个用于保存共享对象并负责Producer 和Consumer 之间通信的类,我们称它为M
是否可以检测是否是同一个线程试图释放锁?我们在代码中有很多地方看起来像: try { try { if(!Monitor.TryEnter(obj, 2000))
我对并发编程有点陌生,正在尝试了解使用 Monitor.Pulse 和 Monitor.Wait 的好处。 MSDN 的例子如下: class MonitorSample { const in
如果您想在退出和清理对象时阻止执行某些代码块,是否可以使用锁来阻止执行? Monitor.TryEnter(cleanupLock, ref acquiredLock); TryEnter 可用于确保
Monitor.Enter 和 Monitor.Exit 设计为从同一线程调用。但是,如果我需要在与获得的线程不同的线程中释放锁怎么办? 例如:有共享资源和使用该资源的异步操作。该操作以 BeginO
Monitor.PulseAll 通知队列中的所有等待线程。 Monitor.Pulse 通知等待队列中的一个线程。 (下一个等待线程) 只有下一个线程(一个线程)才能获取锁。那有什么区别呢? 什么时
我正在尝试在我的 terraform 代码库中集成对 sshd 进程的 Datadog 监视器检查,但我收到 datadog_monitor.host_is_up2: error updating m
这里的问题是:如果获取对象独占锁的线程(例如通过使用 Monitor.Enter)终止,是否会神奇地释放该对象的独占锁?如果那是真的,那么假设我们从另一个线程调用 Monitor.Exit - 因为我
我正在研究 .NET 中的 Monitor 类,所以我找到了一段似乎可以正常工作的代码,但是当我将它循环一段时间时,它会抛出 OutOfMemoryException。 我在具有 8 GB RAM 的
ECMA-335 规范规定如下: *获取锁(System.Threading.Monitor.Enter 或进入同步方法)应隐式执行 volatile 读取操作,并释放锁(System.Threadi
我在 dll 中使用 OmniThreadLibrary 2.09,主应用程序和 dll 使用相同的 SimpleShareMem 内存管理器。 我用以下代码创建了自己的监视器: FMonitor
我正在使用 R 包 monitoR并收到一条我无法理解的错误消息。 我正在尝试使用 dbUploadTemplate 命令将关联模板列表(“bithTemps”)上传到 MySQL 数据库(“noh”
我想我遗漏了一些关于 Monitor.Enter 和 Monitor.TryEnter 正确行为的信息。这是我编写的一段代码,用于将问题与其余代码分开: object lockObj = new ob
我正在尝试实现一个多线程库,该库将使用线程池同时运行任务。基本上它会从它收到的收集参数中将任务添加到线程池,然后等待直到正在处理的最后一个任务发送脉冲信号。我在早期的测试中取得了成功,但是当我想测试处
我想用redis lua来实现monitor命令,而不是redis-cli monitor。但我不知道怎么办。 redis.call('monitor') 不起作用。 最佳答案 您不能从 Redis
根据语言规范,lock(obj) statement; 会被编译为: object lockObj = obj; // (the langspec doesn't mention this var,
我是一名优秀的程序员,十分优秀!