Skip to content

Commit

Permalink
Merge pull request influxdata#456 from alerta/alerta-remove-status
Browse files Browse the repository at this point in the history
[Alerta] Do not set status, fix rawData and default severity is indeterminate
  • Loading branch information
Nathaniel Cook committed Apr 12, 2016
2 parents 5a35eb9 + 21a4c5e commit dc2967a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Example UDF config for a socket based UDF.
- [#441](https://github.com/influxdata/kapacitor/issues/441): Fix panic in UDF code.
- [#429](https://github.com/influxdata/kapacitor/issues/429): BREAKING: Change TICKscript parser to be left-associative on equal precedence operators. For example previously this statement `(1+2-3*4/5)` was evaluated as `(1+(2-(3*(4/5))))`
which is not the typical/expected behavior. Now using left-associative parsing the statement is evaluated as `((1+2)-((3*4)/5))`.
- [#456](https://github.com/influxdata/kapacitor/pull/456): Fixes Alerta integration to let server set status, fix `rawData` attribute and set default severity to `indeterminate`.

## v0.12.0 [2016-04-04]

Expand Down
9 changes: 1 addition & 8 deletions alert.go
Original file line number Diff line number Diff line change
Expand Up @@ -761,24 +761,18 @@ func (a *AlertNode) handleAlerta(alerta alertaHandler, ad *AlertData) {
}

var severity string
var status string

switch ad.Level {
case OKAlert:
severity = "ok"
status = "closed"
case InfoAlert:
severity = "informational"
status = "open"
case WarnAlert:
severity = "warning"
status = "open"
case CritAlert:
severity = "critical"
status = "open"
default:
severity = "unknown"
status = "unknown"
severity = "indeterminate"
}
var buf bytes.Buffer
err := alerta.resourceTmpl.Execute(&buf, ad.info)
Expand Down Expand Up @@ -823,7 +817,6 @@ func (a *AlertNode) handleAlerta(alerta alertaHandler, ad *AlertData) {
ad.ID,
environment,
severity,
status,
group,
value,
ad.Message,
Expand Down
5 changes: 2 additions & 3 deletions services/alerta/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (s *Service) Close() error {
return nil
}

func (s *Service) Alert(token, resource, event, environment, severity, status, group, value, message, origin string, service []string, data interface{}) error {
func (s *Service) Alert(token, resource, event, environment, severity, group, value, message, origin string, service []string, data interface{}) error {
if resource == "" || event == "" {
return errors.New("Resource and Event are required to send an alert")
}
Expand Down Expand Up @@ -65,12 +65,11 @@ func (s *Service) Alert(token, resource, event, environment, severity, status, g
postData["event"] = event
postData["environment"] = environment
postData["severity"] = severity
postData["status"] = status
postData["group"] = group
postData["value"] = value
postData["text"] = message
postData["origin"] = origin
postData["data"] = data
postData["rawData"] = data
if len(service) > 0 {
postData["service"] = service
}
Expand Down
1 change: 0 additions & 1 deletion task_master.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ type TaskMaster struct {
event,
environment,
severity,
status,
group,
value,
message,
Expand Down

0 comments on commit dc2967a

Please sign in to comment.