争渡 一切都是最好的安排 本文由博客端 https://blog.eiyouhe.com 主动推送


configure vmalert

./bin/vmalert -rule=alter.rules \
    // PromSQL compatible datasource
    // Alert manager url
    // Alert manager replica rul
    // remote write compatible storage to persist rules
    //  PromSQL compatible datasource to restore alerts state from
    // External label to be applied for each rule
    -external.label=cluster=east-1 \
    // Multiple external labels may be set
    -external.label=replica=a \
    // Default evaluation interval if not specified in rules group

if you run multiple vmalert services for the same datastore or Alert manager - do not forget to specify different external.label flags in order to define which vmalert generated rules or alerts.


groups: [- <rule_group>]

each group has following attributes:

# the name of the group. Must be unique within a file
name: <string>
# How often rules in group are evaluated
[interval: <duration> | default = global.evaluation_interval ]
# How many rules execute at once.
# Increasing concurrency may speed
# up round execution speed
[ concurrency: <integer> | default = 1]
# rules
rules :
    [ - <rule> ...]


there are two types of rules : recording and alerting

alerting rules

# the name of the alert,Must be a valid metric name
alert: <string>
# the metricQL expression to evaluate
expr: <string>
# Alerts are considered firing once they have been returned for this long
# Alerts witch have not ye fired for long enough are considered pending
[ for:<duration> | default = 0s ]
# Labels to add or overwrite for each alert
# Annotations to add to each alert

recording rules

# The name of the time series to output to. Must be a valid metric name.
record: <string>

# The MetricsQL expression to evaluate.
expr: <string>

# Labels to add or overwrite before storing the result.
  [ <labelname>: <labelvalue> ]

赞助商 我要投放



我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。

注册 关于
请输入回帖内容 ...