【发布时间】:2019-03-31 04:12:09
【问题描述】:
我是 Prometheus 和 Micrometer 的新手。我试图在 JVM 的堆内存使用量超过某个阈值时发出警报。
- alert: P1 - Percentage of heap memory usage on environment more than 3% for 5 minutes.
expr: sum(jvm_memory_used_bytes{application="x", area="heap"})*100/sum(jvm_memory_max_bytes{application="x", area="heap"}) by (instance) > 3
for: 5m
labels:
priority: P1
tags: infrastructure, jvm, memory
annotations:
summary: "Percentage of heap memory is more than threshold"
description: "Percentage of heap memory for instance '{{ $labels.instance }}' has been more than 3% ({{ $value }}) for 5 minutes."
现在当我在 Grafana 上使用这个表达式时,这个表达式可以工作了:
但在 Prometheus 中是这样的:
如何让我的警报在内存使用量超过特定限制时发出警报?
【问题讨论】:
标签: jvm alert prometheus micrometer