Skip to content

Commit ed1bbff

Browse files
Michal Tichákknopers8
authored andcommitted
Added kafka message to DCS for any detector change for any detector
1 parent 69b64e5 commit ed1bbff

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

core/integration/dcs/plugin.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -985,6 +985,24 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
985985
WithField("partition", envId).
986986
WithField("level", infologger.IL_Devel).
987987
Info("ALIECS PFR operation : processing DCS PFR for ")
988+
989+
ecsDet := dcsToEcsDetector(dcsEvent.GetDetector())
990+
detPayload := map[string]interface{}{}
991+
_ = copier.Copy(&detPayload, payload)
992+
detPayload["detector"] = ecsDet
993+
detPayload["state"] = dcspb.DetectorState_name[int32(dcsEvent.GetState())]
994+
detPayload["dcsEvent"] = dcsEvent
995+
detPayloadJson, _ := json.Marshal(detPayload)
996+
997+
the.EventWriterWithTopic(TOPIC).WriteEvent(&pb.Ev_IntegratedServiceEvent{
998+
Name: call.GetName(),
999+
OperationName: call.Func,
1000+
OperationStatus: pb.OpStatus_ONGOING,
1001+
OperationStep: "perform DCS call: PrepareForRun",
1002+
OperationStepStatus: pb.OpStatus_ONGOING,
1003+
EnvironmentId: envId,
1004+
Payload: string(detPayloadJson[:]),
1005+
})
9881006
}
9891007

9901008
}

0 commit comments

Comments
 (0)