Skip to content

Commit e4af2d5

Browse files
committed
fixup! Support for Librato Alerts and Services
1 parent 2b2920b commit e4af2d5

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

builtin/providers/librato/resource_librato_alert.go

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,32 @@ func resourceLibratoAlertConditionsHash(v interface{}) int {
108108
var buf bytes.Buffer
109109
m := v.(map[string]interface{})
110110
buf.WriteString(fmt.Sprintf("%s-", m["type"].(string)))
111+
buf.WriteString(fmt.Sprintf("%s-", m["metric_name"].(string)))
112+
113+
source, present := m["source"]
114+
if present {
115+
buf.WriteString(fmt.Sprintf("%f-", source.(string)))
116+
}
117+
118+
detect_reset, present := m["detect_reset"]
119+
if present {
120+
buf.WriteString(fmt.Sprintf("%f-", detect_reset.(bool)))
121+
}
122+
123+
duration, present := m["duration"]
124+
if present {
125+
buf.WriteString(fmt.Sprintf("%f-", duration.(int)))
126+
}
127+
111128
threshold, present := m["threshold"]
112129
if present {
113130
buf.WriteString(fmt.Sprintf("%f-", threshold.(float64)))
114131
}
115-
buf.WriteString(fmt.Sprintf("%s-", m["metric_name"].(string)))
132+
133+
summary_function, present := m["summary_function"]
134+
if present {
135+
buf.WriteString(fmt.Sprintf("%f-", summary_function.(string)))
136+
}
116137

117138
return hashcode.String(buf.String())
118139
}

0 commit comments

Comments
 (0)