Dashboarding
Dynatrace dashboards, notebooks, and data explorer explained.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Add SRG to Segment

KevinB
Frequent Guest

I want to show a guardian that evaluates the SLO's for my application on daily basis on my application dashboard. 

I also want to filter a Segment on my dashboard. 

But when I apply the segment, my Guardian validation is no longer showing data.

Is there a way to include SRG in the Segment ? 

 

 

Query used to show SRG validation for the last 7 day on my dashboard

 

fetch bizevents , from:-7d, to: now()
| filter event.provider == "dynatrace.site.reliability.guardian"
| filter event.type == "guardian.validation.finished"
| filter in(guardian.name,"App - My-Application")
| fieldsAdd window = (toTimestamp(validation.to) - toTimestamp(validation.from))
| filter window < 2d
| parse validation.summary, "JSON:validation.summary.json"
| fieldsFlatten validation.summary.json
| fieldsAdd total = validation.summary.json.pass + validation.summary.json.warning + validation.summary.json.fail + validation.summary.json.error
| fieldsAdd successRate = (validation.summary.json.pass/total)
| fieldsAdd date = formatTimestamp(timestamp, format:"yyyy-MM-dd")
| fieldsAdd DateName = concat(guardian.name,date)
| sort DateName desc
| fields guardian.name, date,validation.summary.json.pass, validation.summary.json.warning , validation.summary.json.fail , validation.summary.json.error

 

 

 

3 REPLIES 3

t_pawlak
Leader

Hi,
I think that this is expected with Segments.
In Dynatrace, a Segment is enforced via its “Includes”. If your selected segment doesn’t include the data type you’re querying, the result becomes empty. Dynatrace docs explicitly state that querying data not referenced by any include leads to empty results. Include data in segments 

You use fetch bizevents, so if the segment only includes (for example) metrics/logs/entities but does not include bizevents, the Guardian validation events will be filtered out.
I think you need edit the segment and add an Include for Business events (bizevents) that matches SRG. 
Remember that includes are ORed, so this will keep your segment scoping while also allowing SRG validation events through.
If you’re using a Lifecycle guardian, validations might be written to events, not bizevents, so add a second include for Events as well or use an “All data types” include if that fits your model.

I'm using Bus Guardians and my query is showing results on a dashboard so that is all fine. 

I have even created a LifeCycle Guardian, but can't find the right entity to add to my test-segment

Yep, I’ll stick to my guns here. You’re not missing a “Guardian entity”.

SRG (Business Guardian) validation results are written as Business events, so when you apply a Segment, the tile will only return data if the Segment includes the bizevents data type. If your Segment currently includes only entities/metrics/logs, then any fetch bizevents query will go empty once the Segment is applied.

So the fix is to edit the Segment → add an Include for Business events (bizevents) that matches SRG, e.g.:
event.provider == "dynatrace.site.reliability.guardian"
For Lifecycle Guardians specifically, results are written as Events (SDLC), so you’d add an Events include instead (not an entity). Look here in documentation: Site Reliability guardian event structure 
eg. from documentation:

fetch events
| filter event.kind == "SDLC_EVENT"
| filter event.provider == "dynatrace.site.reliability.guardian"

add the right data-type include (bizevents for Business Guardian; events/SDLC_EVENT for Lifecycle), not an entity.

Featured Posts