# Alerting based on Geographic region

**URL:** <https://discuss.elastic.co/t/alerting-based-on-geographic-region/359879>\
**Category:** Elastic Observability\
**Tags:** elastic-stack-alerting\
**Created:** [May 21, 2024, 6:09am UTC](https://discuss.elastic.co/t/alerting-based-on-geographic-region/359879 "2024-05-21T06:09:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arpan\_Mondal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/arpan_mondal/32/133629_2.png) [@Arpan\_Mondal](https://discuss.elastic.co/u/Arpan_Mondal)\
**Post date:** [May 21, 2024, 6:09am UTC](https://discuss.elastic.co/t/alerting-based-on-geographic-region/359879/1 "2024-05-21T06:09:01Z")

</div>

Hi Team,  
Can you please help out if its possible to group alerts for a service based on the Geographic region. As we are getting metrics based on Geographic regions, due to business use cases we would like to set alerts for important Geographic regions.

---

<div class="post-metadata">

**Author:** ![weltenwort](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weltenwort/32/53885_2.png) [@weltenwort](https://discuss.elastic.co/u/weltenwort)\
**Post date:** [May 21, 2024, 2:07pm UTC](https://discuss.elastic.co/t/alerting-based-on-geographic-region/359879/2 "2024-05-21T14:07:49Z")

</div>

Hi @Arpan_Mondal,

if the geographic region is represented as an aggregatable field in all the documents (e.g. in the labels) then you should be able to use that field as a grouping criterion. Which alert type are you looking at specifically?

---

<div class="post-metadata">

**Author:** ![Arpan\_Mondal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/arpan_mondal/32/133629_2.png) [@Arpan\_Mondal](https://discuss.elastic.co/u/Arpan_Mondal)\
**Post date:** [May 22, 2024, 5:58am UTC](https://discuss.elastic.co/t/alerting-based-on-geographic-region/359879/3 "2024-05-22T05:58:29Z")

</div>

Hi @weltenwort ,  
Thanks for the quick reply. So here is our scenario, we are running elastic/rumjs in our nextJs application and in the user experience dashboard we get a dashboard for `page load distribution by region`.  
We have alert set on average latency of page loads but we find that due to some outliers our data on focus might be wrong.

Our Goal is to group these alerts based on the Geographical location

 ![Screenshot 2024-05-22 at 11.23.39 AM](https://us1.discourse-cdn.com/elastic/original/3X/b/8/b85f4980f529839207dd228f8ad361311b98b1c7.jpeg)

---

<div class="post-metadata">

**Author:** ![weltenwort](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weltenwort/32/53885_2.png) [@weltenwort](https://discuss.elastic.co/u/weltenwort)\
**Post date:** [May 22, 2024, 9:30am UTC](https://discuss.elastic.co/t/alerting-based-on-geographic-region/359879/4 "2024-05-22T09:30:20Z")

</div>

I just looked at the data behind the user experience dashboard and it seems that geolocation fields are included. So you could use the field `client.geo.country_iso_code` or `client.geo.region_name` as "group by" criterion in a "Custom threshold" rule. That provides a lot of flexibility, but requires slightly more knowledge of the particular metric fields.
