1

我已经在我的集群上设置了 prometheus,其中包含一些警报规则,如下所示:

  • alert: ContextSwitching expr: rate(node_context_switches_total[5m]) > 1000 for: 30m 标签:severity: warning

有人可以阐明这条规则的目的吗?此外,在我的情况下 rate(node_context_switches_total[5m]) 总是大于 2000。

这是我应该担心的事情吗?

4

1 回答 1

0

上下文切换是存储进程或线程状态的操作。根据Prometheus 文档书指标描述-

node_context_switches_total是上下文切换的总数。

典型的警报如下所示:

  - alert: ContextSwitching
    expr: rate(node_context_switches_total[5m]) > 1000
    for: 30m
    labels:
      severity: warning
    annotations:
      summary: "Context switching (instance {{ $labels.instance }})"
      description: "Context switching is growing on node (> 1000 / s)\n  VALUE = {{ $value }}\n  LABELS: {{ $labels }}"
于 2019-06-24T11:20:45.063 回答