Opsgenie to return the 4xx error response to AlertManager for failed create alert calls

XMLWordPrintable

    • 1

      Problem statement:

      Currently, Alertmanager is capable of responding to responses from the server at https://github.com/prometheus/alertmanager/blob/7cdecbf6ee97951d3ba1430fae6598a1fe9defe1/notify/util.go#L292.

      // GetFailureReasonFromStatusCode returns the reason for the failure based on the status code provided.
      func GetFailureReasonFromStatusCode(statusCode int) Reason {
      	if statusCode/100 == 4 {
      		return ClientErrorReason
      	}
      	if statusCode/100 == 5 {
      		return ServerErrorReason
      	}
      
      	return DefaultReason
      }
      

      Suggested solution:

      If Opsgenie can return a 4xx to Alertmanager for all alerts failing for creation, the customer can react based on the metrics from Alertmanager for those misses.

      Workaround:
      Read the error field in the current response payload to determine if alert creation has failed in Opsgenie.

              Assignee:
              Unassigned
              Reporter:
              Shashwat Khare
              Votes:
              4 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated: