25 Jun 2024 11:36 AM
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?
26 Jun 2024 09:22 AM
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.
01 Jul 2024 12:29 PM
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
02 Jul 2024 10:14 AM
Unfortunately, output from api.info is only available in the logs from synthetic playback. It is not published anywhere within the execution details.
02 Jul 2024 11:20 AM
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
02 Jul 2024 05:24 PM
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.