# Create custom event for alerting based on RUM metrics

**URL:** <https://community.dynatrace.com/t/create-custom-event-for-alerting-based-on-rum-metrics/20863>\
**Category:** Alerting\
**Tags:** real-user-monitoring-classic, problems-classic, javascript\
**Created:** [November 20, 2020, 7:10pm UTC](https://community.dynatrace.com/t/create-custom-event-for-alerting-based-on-rum-metrics/20863 "2020-11-20T19:10:19Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tim\_Abil](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@Tim\_Abil](https://community.dynatrace.com/u/Tim_Abil)\
**Post date:** [November 20, 2020, 7:10pm UTC](https://community.dynatrace.com/t/create-custom-event-for-alerting-based-on-rum-metrics/20863/1 "2020-11-20T19:10:19Z")

</div>

Our application is manually reporting user actions with custom string properties appended to each. We have also created a custom metric so that we could make multidimensional charts based on those string properties as dimensions. The multidimensional chart tool as well as USQL are both able to count those user actions and filter based on the string properties. However when we try to create a custom event for alerting based the _Static threshold setting_ for that metric, it only shows time units (of the metric) to trigger the alert; even-though ‘Count’ is selected under the aggregate dropdown. I’m wondering if this is due to the type of our metric being a ‘User action duration’ metric. But the _RumMetricDefinition_ object doesnt seem to have anything that could describe a user action count. Is there a way to create an alert that would trigger based on a certain count of custom user actions?

---

<div class="post-metadata">

**Author:** ![The\_AM](https://avatars.discourse-cdn.com/v4/letter/t/ce7236/32.png) [@The\_AM](https://community.dynatrace.com/u/The_AM)\
**Post date:** [November 24, 2020, 8:53pm UTC](https://community.dynatrace.com/t/create-custom-event-for-alerting-based-on-rum-metrics/20863/2 "2020-11-24T20:53:20Z")

</div>

Hi Tim,

Another way to accomplish this would be to mark the particular user action of interest as a key user action.

Then when you create a custom event, you may filter to this (or several) key user actions using the action name rule-based filter.

This has the static threshold set against the count of the user actions, rather than the performance metric.

 ![27397-1606251148023.png](https://global.discourse-cdn.com/dynatrace/original/2X/4/44675244084e1b3bcfea4eb81714f72d82b1c2be.png)

Regards,

Andrew M.

---

<div class="post-metadata">

**Author:** ![The\_AM](https://avatars.discourse-cdn.com/v4/letter/t/ce7236/32.png) [@The\_AM](https://community.dynatrace.com/u/The_AM)\
**Post date:** [November 24, 2020, 8:56pm UTC](https://community.dynatrace.com/t/create-custom-event-for-alerting-based-on-rum-metrics/20863/3 "2020-11-24T20:56:02Z")

</div>

Hi [@Tim A.,](https://answers.dynatrace.com/users/42061/view.html)

Just to let you know that I have moved your question to the Dynatrace Open Q&A forum, as your question relates to the Dynatrace SaaS & Managed Platform.

Regards,  
Andrew M.

---

<div class="post-metadata">

**Author:** ![Tim\_Abil](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@Tim\_Abil](https://community.dynatrace.com/u/Tim_Abil)\
**Post date:** [November 24, 2020, 9:00pm UTC](https://community.dynatrace.com/t/create-custom-event-for-alerting-based-on-rum-metrics/20863/4 "2020-11-24T21:00:41Z")

</div>

Thanks for your response [@Andrew M.](https://answers.dynatrace.com/users/18645/view.html) But it seems like the Metric in your screenshot is “by browser”. So I wouldn’t be able to split by my custom dimensions) which are the action string properties that i define with custom Metric).

---

<div class="post-metadata">

**Author:** ![Tim\_Abil](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@Tim\_Abil](https://community.dynatrace.com/u/Tim_Abil)\
**Post date:** [November 24, 2020, 9:01pm UTC](https://community.dynatrace.com/t/create-custom-event-for-alerting-based-on-rum-metrics/20863/5 "2020-11-24T21:01:33Z")

</div>

Would the rule-based filter allow me to look at string properties?

---

<div class="post-metadata">

**Author:** ![The\_AM](https://avatars.discourse-cdn.com/v4/letter/t/ce7236/32.png) [@The\_AM](https://community.dynatrace.com/u/The_AM)\
**Post date:** [December 2, 2020, 5:54am UTC](https://community.dynatrace.com/t/create-custom-event-for-alerting-based-on-rum-metrics/20863/6 "2020-12-02T05:54:31Z")

</div>

Hi Tim A.,

If your string property is also a frontend property (not a server-side request attribute) and you also don’t mind renaming the actions to contain that value, then yes it’s possible using user action naming with custom placeholders.

 ![27459-2020-12-02-16-37-41-user-action-placeholder-dynatr.png](https://global.discourse-cdn.com/dynatrace/original/3X/9/9/997fa6e21965c47170a7a41d4891b204b080d699.png)

Regards,  
Andrew M.

---

<div class="post-metadata">

**Author:** ![The\_AM](https://avatars.discourse-cdn.com/v4/letter/t/ce7236/32.png) [@The\_AM](https://community.dynatrace.com/u/The_AM)\
**Post date:** [December 2, 2020, 5:57am UTC](https://community.dynatrace.com/t/create-custom-event-for-alerting-based-on-rum-metrics/20863/7 "2020-12-02T05:57:12Z")

</div>

Hi Tim A.,

I was just using a generic example. I believe for your particular case, actually the property can only be applied as a filter when you create the metric. As the property cannot be a dimension (splitting value), then it could not be used in the alerting dimensions selection.

I may be wrong and would need to understand your exact metric and use case in more detail.

Andrew M.

---

<div class="post-metadata">

**Author:** ![Tim\_Abil](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@Tim\_Abil](https://community.dynatrace.com/u/Tim_Abil)\
**Post date:** [December 2, 2020, 6:11pm UTC](https://community.dynatrace.com/t/create-custom-event-for-alerting-based-on-rum-metrics/20863/8 "2020-12-02T18:11:02Z")

</div>

We are actually using those string properties as dimensions in multidimensional charts as well as USQL widgets. And when trying to create a custom event for alerting those properties do come up as dimensions. However the static threshold values can only be set as a time unit.

 ![27502-1606932562119.png](https://global.discourse-cdn.com/dynatrace/original/3X/c/4/c499f0d75777b115a24637c1c2adf729078c597e.png)

 ![27512-1606932320811.png](https://global.discourse-cdn.com/dynatrace/original/2X/a/aecd8f8f9aea509638041c11d8a108ad6e9042bd.png)

---

<div class="post-metadata">

**Author:** ![Tim\_Abil](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@Tim\_Abil](https://community.dynatrace.com/u/Tim_Abil)\
**Post date:** [December 2, 2020, 8:48pm UTC](https://community.dynatrace.com/t/create-custom-event-for-alerting-based-on-rum-metrics/20863/9 "2020-12-02T20:48:29Z")

</div>

Seems like reporting a Custom Error for that userAction id and then creating an ErrorCount metric with the same string properties as dimensions worked.

---

<div class="post-metadata">

**Author:** ![The\_AM](https://avatars.discourse-cdn.com/v4/letter/t/ce7236/32.png) [@The\_AM](https://community.dynatrace.com/u/The_AM)\
**Post date:** [January 27, 2021, 9:55pm UTC](https://community.dynatrace.com/t/create-custom-event-for-alerting-based-on-rum-metrics/20863/10 "2021-01-27T21:55:07Z")

</div>

Hi Tim,

I believe you will need to create the metric based on Request Count or similar metric, instead of Response Time. Then only will you get the count and/or sum aggregation that you will need. For response time metric will have the time based aggregations, like average (time), min (time), max (time), etc.
