# Metric Events

**URL:** <https://community.dynatrace.com/t/metric-events/44259>\
**Category:** Alerting\
**Tags:** problem-detection, dynatrace-managed, problems-classic\
**Created:** [February 22, 2024, 6:01pm UTC](https://community.dynatrace.com/t/metric-events/44259 "2024-02-22T18:01:15Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![gunjanmiglani](https://avatars.discourse-cdn.com/v4/letter/g/f17d59/32.png) [@gunjanmiglani](https://community.dynatrace.com/u/gunjanmiglani)\
**Post date:** [February 22, 2024, 6:01pm UTC](https://community.dynatrace.com/t/metric-events/44259/1 "2024-02-22T18:01:15Z")

</div>

A problem is not detected if we use metric selector but its reported when we use metric key.

The query used for metric selector works fine as it shows correct data in explorer but just doesn’t create the problem event.

This is with apigee extension.

---

<div class="post-metadata">

**Author:** ![dannemca](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/dannemca/32/7215_2.png) [@dannemca](https://community.dynatrace.com/u/dannemca)\
**Post date:** [February 22, 2024, 7:14pm UTC](https://community.dynatrace.com/t/metric-events/44259/2 "2024-02-22T19:14:48Z")

</div>

Could you provide more details about the configuration settings you are using in this metric event for both?

---

<div class="post-metadata">

**Author:** ![gunjanmiglani](https://avatars.discourse-cdn.com/v4/letter/g/f17d59/32.png) [@gunjanmiglani](https://community.dynatrace.com/u/gunjanmiglani)\
**Post date:** [February 23, 2024, 12:03pm UTC](https://community.dynatrace.com/t/metric-events/44259/3 "2024-02-23T12:03:33Z")

</div>

![gunjanmiglani_0-1708689419211.png](https://global.discourse-cdn.com/dynatrace/original/2X/5/5c55de066f2f3254ca92e1a7a66b7664bc193bee.png)

**With Metric Selector = No Problem raised**

Query works as we get data in graph and data explorer correctly.

 ![gunjanmiglani_1-1708689546896.png](https://global.discourse-cdn.com/dynatrace/original/3X/9/a/9aad4b01e2453f330df84700d4e7a8cd7c4aeca8.png)

**With Metric Key = Problem Raised**

This is with APigee Extension

They both show potential alerts but metric selector one does not create a problem

---

<div class="post-metadata">

**Author:** ![PacoPorro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pacoporro/32/36087_2.png) [@PacoPorro](https://community.dynatrace.com/u/PacoPorro)\
**Post date:** [February 23, 2024, 1:57pm UTC](https://community.dynatrace.com/t/metric-events/44259/4 "2024-02-23T13:57:14Z")

</div>

Are you using fixed thresholds in both?

---

<div class="post-metadata">

**Author:** ![gunjanmiglani](https://avatars.discourse-cdn.com/v4/letter/g/f17d59/32.png) [@gunjanmiglani](https://community.dynatrace.com/u/gunjanmiglani)\
**Post date:** [February 23, 2024, 2:58pm UTC](https://community.dynatrace.com/t/metric-events/44259/5 "2024-02-23T14:58:52Z")

</div>

Yep.. Its static something like below, we kept everything same for both the scenarios. If the count of errors is more than 1, want to trigger a custom alert.

 ![gunjanmiglani_0-1708700313448.png](https://global.discourse-cdn.com/dynatrace/original/3X/1/7/1702d0b89b838454b1773e465cbcba0c7223b605.png)

It shows that there is potential alert in both cases but problem is **not** raised if metric selector is used and problem is raised if metric key is used.

---

<div class="post-metadata">

**Author:** ![dannemca](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/dannemca/32/7215_2.png) [@dannemca](https://community.dynatrace.com/u/dannemca)\
**Post date:** [February 23, 2024, 5:01pm UTC](https://community.dynatrace.com/t/metric-events/44259/6 "2024-02-23T17:01:34Z")

</div>

The Aggregation you are using in selector is avg, while in key is sum.

Did you tried to change this and observe?

---

<div class="post-metadata">

**Author:** ![gunjanmiglani](https://avatars.discourse-cdn.com/v4/letter/g/f17d59/32.png) [@gunjanmiglani](https://community.dynatrace.com/u/gunjanmiglani)\
**Post date:** [February 23, 2024, 5:03pm UTC](https://community.dynatrace.com/t/metric-events/44259/7 "2024-02-23T17:03:38Z")

</div>

Yep tried with sum and avg in both cases..&nbsp; 😞 its just the moment we change to metric selector, it just stops detecting problem.

---

<div class="post-metadata">

**Author:** ![gunjanmiglani](https://avatars.discourse-cdn.com/v4/letter/g/f17d59/32.png) [@gunjanmiglani](https://community.dynatrace.com/u/gunjanmiglani)\
**Post date:** [February 26, 2024, 10:38am UTC](https://community.dynatrace.com/t/metric-events/44259/8 "2024-02-26T10:38:11Z")

</div>

We are a bit stuck with this. Are there any restrictions on extensions using metric selectors of any sort?? Not sure where we are going wrong. As it works moment we change to metric key and raises a problem. Thanks for the help. Happy to have a call and show if thats helpful sometime today.

---

<div class="post-metadata">

**Author:** ![rastislav\_danis](https://avatars.discourse-cdn.com/v4/letter/r/b9bd4f/32.png) [@rastislav\_danis](https://community.dynatrace.com/u/rastislav_danis)\
**Post date:** [February 26, 2024, 12:12pm UTC](https://community.dynatrace.com/t/metric-events/44259/9 "2024-02-26T12:12:46Z")

</div>

is there any filter used in metric key definition?

---

<div class="post-metadata">

**Author:** ![gunjanmiglani](https://avatars.discourse-cdn.com/v4/letter/g/f17d59/32.png) [@gunjanmiglani](https://community.dynatrace.com/u/gunjanmiglani)\
**Post date:** [February 26, 2024, 12:19pm UTC](https://community.dynatrace.com/t/metric-events/44259/10 "2024-02-26T12:19:03Z")

</div>

Thanks for the reply. No Dimension filter is selected when we use metric key.

---

<div class="post-metadata">

**Author:** ![rastislav\_danis](https://avatars.discourse-cdn.com/v4/letter/r/b9bd4f/32.png) [@rastislav\_danis](https://community.dynatrace.com/u/rastislav_danis)\
**Post date:** [February 26, 2024, 12:21pm UTC](https://community.dynatrace.com/t/metric-events/44259/11 "2024-02-26T12:21:17Z")

</div>

ok, but in selector definition you have 4 filters.

---

<div class="post-metadata">

**Author:** ![gunjanmiglani](https://avatars.discourse-cdn.com/v4/letter/g/f17d59/32.png) [@gunjanmiglani](https://community.dynatrace.com/u/gunjanmiglani)\
**Post date:** [February 26, 2024, 12:28pm UTC](https://community.dynatrace.com/t/metric-events/44259/12 "2024-02-26T12:28:09Z")

</div>

Yes.. thats why we want to use selector.

We have 8 apigee apis and by using metric key we get data for all 8 apis which is what we dont want. We want custom alerts for one set of apis which are grouped as request and another set called as response so by using metric selector and filters we want to segregate.

The issue is query used in metric selector works fine in data explorer and shows potential alert but does not raise a Problem. Hope that makes sense..

---

<div class="post-metadata">

**Author:** ![rastislav\_danis](https://avatars.discourse-cdn.com/v4/letter/r/b9bd4f/32.png) [@rastislav\_danis](https://community.dynatrace.com/u/rastislav_danis)\
**Post date:** [February 26, 2024, 12:50pm UTC](https://community.dynatrace.com/t/metric-events/44259/13 "2024-02-26T12:50:34Z")

</div>

i see, but there is also “or” filter for 401-404 return codes in selector one

---

<div class="post-metadata">

**Author:** ![gunjanmiglani](https://avatars.discourse-cdn.com/v4/letter/g/f17d59/32.png) [@gunjanmiglani](https://community.dynatrace.com/u/gunjanmiglani)\
**Post date:** [February 26, 2024, 2:04pm UTC](https://community.dynatrace.com/t/metric-events/44259/14 "2024-02-26T14:04:19Z")

</div>

Yes we need that as well to filter the set of apis and trigger an alert if status is one of those!

---

<div class="post-metadata">

**Author:** ![rastislav\_danis](https://avatars.discourse-cdn.com/v4/letter/r/b9bd4f/32.png) [@rastislav\_danis](https://community.dynatrace.com/u/rastislav_danis)\
**Post date:** [February 26, 2024, 3:46pm UTC](https://community.dynatrace.com/t/metric-events/44259/15 "2024-02-26T15:46:31Z")

</div>

no issues with advanced model properties? default 3/5/5?  
in key definition you seem to sum all 40x return code dimensions and in selector definition you split each 40x code into separate dimension

each of this hints is just guessing, you have to play with settings a bit, b/c it’s not always same what seems to be

i suggest you to start playing with some simple selector, that easily can be converted into key definition (f.e. all codes aggregated with sum filtered only per specific apiproxy)

---

<div class="post-metadata">

**Author:** ![g\_kat](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/g_kat/32/34573_2.png) [@g\_kat](https://community.dynatrace.com/u/g_kat)\
**Post date:** [March 8, 2024, 12:46pm UTC](https://community.dynatrace.com/t/metric-events/44259/16 "2024-03-08T12:46:13Z")

</div>

Hi,

We are currently facing pretty much the same issue. We have a metric extracted from a log, for which we want to set up a custom event once it passes a specific threshold with an advanced model of 1/3/3(1 violating in 3 minutes windows with 3 dealerting to close). The metric selector is very simple:

log.fallbackbigdata:splitBy():sum:sort(value(sum,descending))

And in the preview we see the data and the potential alert, yet we don’t actually get a problem raised.
