File tree Expand file tree Collapse file tree 1 file changed +3
-20
lines changed
Expand file tree Collapse file tree 1 file changed +3
-20
lines changed Original file line number Diff line number Diff line change @@ -156,25 +156,8 @@ dimensions: {{.Dimensions}}
156156
157157特别说明:` SplitString ` 函数
158158
159- 目前支持两种使用方式:
159+ ### 5 ` GetTimeDuration ` 函数仅支持在PrometheusAlert的自定义模版中使用,该函数主要用于获取持续时间
160160
161- - 使用默认时间字符串格式输出 ` {{GetTime .Timestamp}} ` ,如:
161+ 用法示例:
162162
163- ```
164- ALiYun {{.AlertState}}信息
165- >**{{.AlertName}}**
166- >告警级别: {{.TriggerLevel}}
167- 开始时间: {{.Timestamp}}
168- 故障主机: {{SplitString .Instance 0 -5}}
169- ------------详细信息--------------
170- metricName: {{.MetricName}}
171- expression: {{.Expression}}
172- signature: {{.Signature}}
173- metricProject: {{.MetricProject}}
174- userId: {{.UserId}}
175- namespace: {{.Namespace}}
176- preTriggerLevel: {{.PreTriggerLevel}}
177- ruleId: {{.RuleId}}
178- dimensions: {{.Dimensions}}
179- **当前值:{{.CurValue}}**
180- ```
163+ > <font color =" info " >持续时间:</font > {{GetTimeDuration $v.startsAt $v.endsAt}} //输出:持续时间: 15s
You can’t perform that action at this time.
0 commit comments