# How to create multi-dimensional alerts with Infinity data source?

**URL:** <https://community.grafana.com/t/how-to-create-multi-dimensional-alerts-with-infinity-data-source/126862>\
**Category:** Alerting\
**Tags:** infinity-datasource\
**Created:** [July 23, 2024, 9:21am UTC](https://community.grafana.com/t/how-to-create-multi-dimensional-alerts-with-infinity-data-source/126862 "2024-07-23T09:21:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![daniele300](https://avatars.discourse-cdn.com/v4/letter/d/e274bd/32.png) [@daniele300](https://community.grafana.com/u/daniele300)\
**Post date:** [July 23, 2024, 9:21am UTC](https://community.grafana.com/t/how-to-create-multi-dimensional-alerts-with-infinity-data-source/126862/1 "2024-07-23T09:21:05Z")

</div>

I have read the post: [Use Dashboard Variables in Alerts](https://community.grafana.com/t/use-dashboard-variables-in-alerts/104315/2). And, I find that I have similar requirements. The example in that post uses Prometheus data source, and I am wondering whether Infinity data source can be used to create a multi-dimensional alerts or not?

I have a dashboard and set a dashboard variable: `itemId`, so I can use `${itemId}` in the API query with Infinity data source. The dashboard variable makes it possible to create only one dashboard for multiple `itemId` query.

Now, I want to have only one alert rule which can automatically create many alert instances for more than one `itemId`. Is there a way to make it with Infinity data source? By the way, my Grafana version is v11.0.0.

---

<div class="post-metadata">

**Author:** ![grant2](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/grant2/32/42281_2.png) [@grant2](https://community.grafana.com/u/grant2)\
**Post date:** [July 23, 2024, 9:51am UTC](https://community.grafana.com/t/how-to-create-multi-dimensional-alerts-with-infinity-data-source/126862/2 "2024-07-23T09:51:28Z")

</div>

Hi @daniele300

I do not see why it would not be possible. Can you redo your query to NOT use a dashboard variable, which would then be used in the Alerts section of Grafana. You could always create another dashboard for user-friendly purposes that uses a template variable as you have already done.

I will try to do this later today, but IIRC, all my Infinity dashboards do not use variables, so I will have to concoct something and then create an alert.

---

<div class="post-metadata">

**Author:** ![daniele300](https://avatars.discourse-cdn.com/v4/letter/d/e274bd/32.png) [@daniele300](https://community.grafana.com/u/daniele300)\
**Post date:** [July 23, 2024, 11:42am UTC](https://community.grafana.com/t/how-to-create-multi-dimensional-alerts-with-infinity-data-source/126862/3 "2024-07-23T11:42:13Z")

</div>

Hi @grant2 , my words are a little bit confusing, which may lead to misunderstanding.

Currently, my alert rules do not use any dashboard variable because I know it cannot work. So, what I can do (as a workaround) is to hard-code the item id in the query, which means one alert rule is for only one item id. However, it does not fulfill my needs.

Assuming that the query is like: `http://mysite.com/items/100`, and it returns a time series data like: `[{timestamp: 1000, id: 100, value: 500}, {timestamp: 1001, id: 100, value: 490}]` (never mind the format of the timestamp, it’s just for demonstration). Could you provide a simple example to show how to create a multi-dimensional alert rule which can automatically create 3 alert instances for id = 100, 101, 102?

Thanks.
