10 Nov 2020 07:31 PM - last edited on 31 Aug 2022 03:19 PM by MaciejNeumann
DyntraceONE - Can a tag be created from the following response html:
<h2 class="title"><p class="twolineerror" style="color: red">We're sorry
The goal is to capture "We're sorry" or whatever value/message is contained within <h2 class="title"><p class="twolineerror" style="color: red"> and </p></h2>
I was thinking this is possible with Regex but I don't want to be greedy so as not to impact performance.
Any suggestions?
Solved! Go to Solution.
10 Nov 2020 08:57 PM
True 'tagging' wouldn't apply here. What you could do is define a user action or session property based on a CSS selector for that element and then you'd be able to track it a bit better with filters and USQL etc...
https://www.dynatrace.com/support/help/shortlink/user-session-properties#custom-properties
Don't worry too much about regular expression overhead because Dynatrace restricts how it can be used so it won't let you use rules that are too inefficient greedy. In the config there's a link to show you what is allowable.
11 Nov 2020 01:12 PM
Would adding a Custom Error Rule capture the same condition? If I'm trying to capture and identify those sessions with a "We're sorry" message, a custom error rule might work in this case.
11 Nov 2020 03:30 PM
In order to use custom errors you need to actually report the error using the JavaScript API:
https://www.dynatrace.com/support/help/shortlink/configure-application-errors#configure-custom-error...
So it's not as simple as entering a value like that:
After adding or excluding a custom error in Dynatrace, you must trigger the error in your application by using the dtrum.reportCustomError()
method of the JavaScript API.
That does sound useful though and could be a good idea/RFE to post.