Guardian execution context
Your Continuous Integration (CI) tool, for example, Jenkins, can send business events to Dynatrace. These events can then trigger Site Reliability Guardian validations in a workflow.
If you want to filter the Site Reliability Guardian validation events based on the source trigger, the created business events must contain context information from the external tool. The context information can be carried by an externalId, a version number, a build number, or any parameter that lets you identify the tool.
Context propagation
To propagate the execution context, the event triggering a workflow execution must contain the execution_context
field, as in the example below.
1{2 "timeframe.to": "2023-03-08T06:29:08.809Z",3 "timeframe.from": "2023-03-08T05:29:08.809Z",4 "errors": "[]",5 "status": "fail",6 "event.id": "d08a70d8-f6de-4d0d-bd34-5d416a20ba6a",7 "timestamp": 1678256963078000000,8 "event.kind": "BIZ_EVENT",9 "event.type": "guardian.validation.triggered",10 "tag.stage": "hardening",11 "tag.service": "carts",12 "event.provider": "Jenkins",13 "dt.system.bucket": "default_bizevents_short"14 "execution_context": {15 "buildId": "4711",16 "version": "0.1.0"17 }18}
The context execution is propagated to the guardian validation business event. The guardian.validation.started
, guardian.validation.finished
, and guardian.validation.objective
events contain the propagated execution_context
field.
Query your guardian data using execution context
This DQL shows you the first guardian.validation.objective
business event with a specific guardian ID and parses the execution context field to extract a specific value from the event JSON.
1fetch bizevents |2filter event.type == "guardian.validation.objective" AND guardian.id == "vu9U3hXa3q0AAAABADFhcHA6ZHluYXRyYWNlLnNpdGUucmVsaWFiaWxpdHkuZ3VhcmRpYW46Z3VhcmRpYW5zAAZ0ZW5hbnQABnRlbmFudAAkMWNiZDVkYWYtZThhNi0zMDkxLWFkOGQtMmU5NDNmNWJmZWJmvu9U3hXa3q0" |3limit 1 |4parse execution_context, "JSON:parsed_execution_context"
This DQL shows you all guardian.validation.finished
business events where the execution context is defined by buildid
equal to 4711
.
1fetch bizevents2| filter event.type == "guardian.validation.finished"3| parse execution_context, "JSON:parsed_execution_context"4| filter parsed_execution_context[buildId] == "4711"