# Link custom metric event to a management zone

**URL:** <https://community.dynatrace.com/t/link-custom-metric-event-to-a-management-zone/46225>\
**Category:** Alerting\
**Tags:** management-zones, alerting-profile, anomaly-detection, problems-classic\
**Created:** [June 20, 2024, 12:26pm UTC](https://community.dynatrace.com/t/link-custom-metric-event-to-a-management-zone/46225 "2024-06-20T12:26:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gilgi](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/gilgi/32/11747_2.png) [@gilgi](https://community.dynatrace.com/u/gilgi)\
**Post date:** [June 20, 2024, 12:26pm UTC](https://community.dynatrace.com/t/link-custom-metric-event-to-a-management-zone/46225/1 "2024-06-20T12:26:36Z")

</div>

Hi,

Let’s say we have the following metric expression:

(calc:service.getloyaltycalls:splitBy():sort(value(auto,descending)):limit(20) / builtin:service.requestCount.total:filter(and(or(in(“dt.entity.service”,entitySelector(“type(service),entityName.equals(~“BookingService~”)”))))):splitBy():sort(value(auto,descending)):limit(20)) \* 100

The first metric (getloyaltycalls) is defined for a service under the same management zone of the bookingService. However, since this expression doesn’t have a specific entity to split by, it is not linked to the entities management zones.

Can you think of any creative way that will allow for such linkage? this is needed to be included as part of users permissions.

---

<div class="post-metadata">

**Author:** ![Maheedhar\_T](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/maheedhar_t/32/155_2.png) [@Maheedhar\_T](https://community.dynatrace.com/u/Maheedhar_T)\
**Post date:** [June 21, 2024, 5:09am UTC](https://community.dynatrace.com/t/link-custom-metric-event-to-a-management-zone/46225/2 "2024-06-21T05:09:55Z")

</div>

Hey,  
If it is for a problem then consider this as a workaround.  
You can add properties to a event when you create metric events under anomaly detection. There are certain event properties which help you achieve what you are thinking to. You can refer to them here&nbsp;[Events API v2 - GET all event properties - Dynatrace Docs](https://docs.dynatrace.com/docs/dynatrace-api/environment-api/events-v2/get-event-properties)  
As an example, I can show you how relate your event to a particular host.

 ![Maheedhar_T_0-1718946444368.png](https://global.discourse-cdn.com/dynatrace/original/3X/e/2/e2abd13c4b419054afd2c8184945bcacd6227f8d.png)

The dimension key allows the event to prioritize and entity and link the related event to it. Let’s say you have defined both process\_group and host in the properties, the default thing Davis does is that it relates your problem to the process\_group but if you want to override that and want this at a host level you can select the dimension.

Hope this helps&nbsp;:grinning\_face:

Regards,  
[@Maheedhar\_T](https://community.dynatrace.com/user/76275)
