From bbe4d0f04b949f96c228a5de9a46ca8d9c6e8581 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Wed, 9 Oct 2024 17:26:59 +0200 Subject: [PATCH] [core] Include state in DCS op failure events --- core/integration/dcs/plugin.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/integration/dcs/plugin.go b/core/integration/dcs/plugin.go index 7ad8e4ad..5a9898d3 100644 --- a/core/integration/dcs/plugin.go +++ b/core/integration/dcs/plugin.go @@ -828,6 +828,7 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) { payload["detector"] = ecsDet payload["dcsEvent"] = dcsEvent + payload["state"] = dcspb.DetectorState_name[int32(dcsEvent.GetState())] payloadJson, _ = json.Marshal(payload) the.EventWriterWithTopic(TOPIC).WriteEvent(&pb.Ev_IntegratedServiceEvent{ Name: call.GetName(), @@ -864,6 +865,7 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) { payload["detector"] = ecsDet payload["dcsEvent"] = dcsEvent + payload["state"] = dcspb.DetectorState_name[int32(dcsEvent.GetState())] payloadJson, _ = json.Marshal(payload) the.EventWriterWithTopic(TOPIC).WriteEvent(&pb.Ev_IntegratedServiceEvent{ Name: call.GetName(), @@ -900,6 +902,7 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) { payload["detector"] = ecsDet payload["dcsEvent"] = dcsEvent + payload["state"] = dcspb.DetectorState_name[int32(dcsEvent.GetState())] payloadJson, _ = json.Marshal(payload) the.EventWriterWithTopic(TOPIC).WriteEvent(&pb.Ev_IntegratedServiceEvent{ Name: call.GetName(), @@ -927,6 +930,7 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) { detPayload := map[string]interface{}{} _ = copier.Copy(&detPayload, payload) detPayload["dcsEvent"] = dcsEvent + detPayload["state"] = dcspb.DetectorState_name[int32(dcsEvent.GetState())] detPayloadJson, _ := json.Marshal(detPayload) the.EventWriterWithTopic(TOPIC).WriteEvent(&pb.Ev_IntegratedServiceEvent{ @@ -1497,6 +1501,7 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) { payload["detector"] = ecsDet payload["dcsEvent"] = dcsEvent + payload["state"] = dcspb.DetectorState_name[int32(dcsEvent.GetState())] payloadJson, _ = json.Marshal(payload) the.EventWriterWithTopic(TOPIC).WriteEvent(&pb.Ev_IntegratedServiceEvent{ Name: call.GetName(), @@ -1534,6 +1539,7 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) { payload["detector"] = ecsDet payload["dcsEvent"] = dcsEvent + payload["state"] = dcspb.DetectorState_name[int32(dcsEvent.GetState())] payloadJson, _ = json.Marshal(payload) the.EventWriterWithTopic(TOPIC).WriteEvent(&pb.Ev_IntegratedServiceEvent{ Name: call.GetName(), @@ -1571,6 +1577,7 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) { payload["detector"] = ecsDet payload["dcsEvent"] = dcsEvent + payload["state"] = dcspb.DetectorState_name[int32(dcsEvent.GetState())] payloadJson, _ = json.Marshal(payload) the.EventWriterWithTopic(TOPIC).WriteEvent(&pb.Ev_IntegratedServiceEvent{ Name: call.GetName(), @@ -1600,6 +1607,7 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) { detPayload := map[string]interface{}{} _ = copier.Copy(&detPayload, payload) detPayload["dcsEvent"] = dcsEvent + detPayload["state"] = dcspb.DetectorState_name[int32(dcsEvent.GetState())] detPayloadJson, _ := json.Marshal(detPayload) the.EventWriterWithTopic(TOPIC).WriteEvent(&pb.Ev_IntegratedServiceEvent{ @@ -2045,6 +2053,7 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) { payload["detector"] = ecsDet payload["dcsEvent"] = dcsEvent + payload["state"] = dcspb.DetectorState_name[int32(dcsEvent.GetState())] payloadJson, _ = json.Marshal(payload) the.EventWriterWithTopic(TOPIC).WriteEvent(&pb.Ev_IntegratedServiceEvent{ Name: call.GetName(), @@ -2082,6 +2091,7 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) { payload["detector"] = ecsDet payload["dcsEvent"] = dcsEvent + payload["state"] = dcspb.DetectorState_name[int32(dcsEvent.GetState())] payloadJson, _ = json.Marshal(payload) the.EventWriterWithTopic(TOPIC).WriteEvent(&pb.Ev_IntegratedServiceEvent{ Name: call.GetName(), @@ -2111,6 +2121,7 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) { detPayload := map[string]interface{}{} _ = copier.Copy(&detPayload, payload) detPayload["dcsEvent"] = dcsEvent + payload["state"] = dcspb.DetectorState_name[int32(dcsEvent.GetState())] detPayloadJson, _ := json.Marshal(detPayload) the.EventWriterWithTopic(TOPIC).WriteEvent(&pb.Ev_IntegratedServiceEvent{