cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How can I add customised data based on script output to a synthetic test Problem notification?

asp-vm
Participant

We have a scenario where we want to add a business impact value for when a synthetic test fails. This value can vary depending on the time of the failure being detected.

I tried adding it as a Javascipt event in the browser clickpath but all that does is it just runs the script when the synthetic test runs and I have no idea on how to use the resulting output from the script so that it can be added to the problem notification in the event of a synthetic test failure. 

Basically, I want to be able to manipulate the problem notification message to include the results from the Synthetic Javascript event. 


Any suggestions?

5 REPLIES 5

asp-vm
Participant

I see there is already an RFE for adding the api.fail message to Problem notification, however, I would like to extend that where we want the results of the Javascript event to be visible on UI either as an event or within the execution details for the synthetic event step. Alternatively, if we can allow the javascript to be triggered in the event of a synthetic failure being reported and using the the results of the script to be added to the problem notification.

HannahM
Dynatrace Leader
Dynatrace Leader

You can add [CUSTOM] messages into the execution details for an execution by using the api.info, api.warn or api.error into the JS Event. See the Basic logging section here

Synthetic SME and community advocate.

Unfortunately, output from api.info is only available in the logs from synthetic playback. It is not published anywhere within the execution details.

HannahM
Dynatrace Leader
Dynatrace Leader

Apologies, you're quite right. For Browser Monitors the CUSTOM lines are in the execution logs which are not shown in the WebUI. I was thinking of HTTP Monitors where they are shown in the WebUI.
As you mention, there is a Product Idea  for adding the api.fail message into the problem notification. If you would like to see the other logging methods show the output in the WebUI for Browser Monitors, then I recommend creating a Product Idea for this that would allow you to put forward your business use case and for other customers to also vote on. 
In the meantime, you could possibly create an event using the events API in your JS event, using fetch. Or depending on what type of data you would like to make available, you could possibly use the metrics API to store values from each execution

Synthetic SME and community advocate.

Hi Hannah,

I did look at both of those and unfortunately they do not quite meet our requirements as both of those options would record data which would not get sent as part of a Problem notification for when a Synthetic test fails. I appreciate that it would provide the information once logged into Dynatrace but we needed the javascript output to be part of the problem notification. So to give more context, the javascript is the first step in the browser monitor, thereafter, if any of the subsequents steps were to fail then that failure needs to include output from the Javascript step i.e. say step 4 error with "HTML element not found", browser outage is triggered, but in that notification, I cannot find a way to include additional information from a separate event or metric.

Featured Posts