diff --git a/silence.go b/silence.go index 7d207e6..d3c11a3 100644 --- a/silence.go +++ b/silence.go @@ -32,6 +32,10 @@ type silenceBody struct { Labels map[string]string `json:"labels"` } +type silenceResponse struct { + ID string `json:"silenceID"` +} + func (rcv *receiver) handleSilences(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -125,5 +129,11 @@ func (rcv *receiver) handleSilences(w http.ResponseWriter, r *http.Request) { return } - rcv.logger.Debugf("silences: created new silence %s", string(b)) + var id silenceResponse + if err := json.Unmarshal(b, &id); err != nil { + rcv.logger.Debugf("silences: %v", err) + return + } + + rcv.logger.Debugf("silences: created new silence %s", id.ID) }