Add ID for each kapacitor rule

pull/10616/head
Chris Goller 2017-04-05 23:19:06 -05:00
parent 66dc39a458
commit 95d8903144
1 changed files with 2 additions and 0 deletions

View File

@ -179,6 +179,7 @@ func (c *Client) All(ctx context.Context) (map[string]chronograf.AlertRule, erro
script := chronograf.TICKScript(task.TICKscript)
if rule, err := Reverse(script); err != nil {
alerts[task.ID] = chronograf.AlertRule{
ID: task.ID,
Name: task.ID,
TICKScript: script,
}
@ -207,6 +208,7 @@ func (c *Client) Get(ctx context.Context, id string) (chronograf.AlertRule, erro
rule, err := Reverse(script)
if err != nil {
return chronograf.AlertRule{
ID: task.ID,
Name: task.ID,
TICKScript: script,
}, nil