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

Tagging within Response HTML

Bryan_Bautista
Newcomer

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?

3 REPLIES 3

JamesKitson
Dynatrace Guru
Dynatrace Guru

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.

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.

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.

Featured Posts