# Alerting using Custom template - Alerting but with Extraneous Labels

**URL:** <https://forums.percona.com/t/alerting-using-custom-template-alerting-but-with-extraneous-labels/24847>\
**Category:** PMM 2.x\
**Created:** [August 31, 2023, 1:54pm UTC](https://forums.percona.com/t/alerting-using-custom-template-alerting-but-with-extraneous-labels/24847 "2023-08-31T13:54:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![devdewboy](https://avatars.discourse-cdn.com/v4/letter/d/c0e974/32.png) [@devdewboy](https://forums.percona.com/u/devdewboy)\
**Post date:** [August 31, 2023, 1:54pm UTC](https://forums.percona.com/t/alerting-using-custom-template-alerting-but-with-extraneous-labels/24847/1 "2023-08-31T13:54:23Z")

</div>

## Description:

I am creating an alert to tell me if an instance in my MySQL Cluster has a Group Replication Node OFFLINE. I create the rule and it fires fine and is alerting. However, it is not getting pushed to the Notification Policy to alert me via Slack because the Labels the alert generates are more than what I have set for the Notification Policy. I don’t know why that is happening. It seems the labels it generates matches the columns returned from the Preview Alert button while editing the rule. I don’t know how to control that.

## Steps to Reproduce:

Notification Policy Set to alert on 2 labels:`severity=critical` and `grafana_folder=MySQL Non-Production`.

For the rule, the Metric expression used is `mysql_perf_schema_replication_group_member_info{service_name="ia-se-vudb3-123-mysql", member_state="OFFLINE"}`

The rule is being stored in Folder `MySQL Non-Production`.  
The Group is `default-alert-group`.  
The notifications has two labels for it: `severity=critical` and `grafana_folder=MySQL Non-Production`.

Also when **viewing** the rule, the Labels display several additional labels which were automatically created: alert name, datasource\_uid, red\_id. This may have a factor on why there are so many Labels when the Alert is firing and Alerting. I’ll provide screen shot.

## Version:

2.38.1

Any help would be appreciated.  
Thanks  
DD

 ![percona-rule-1](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/9/9526b63498916983cdea181442197dc7c2cc5df3.png)  
 ![percona-2](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/6/68f88636d75a3bdf262477c3e8436237fd8b5059.png)

---

<div class="post-metadata">

**Author:** ![devdewboy](https://avatars.discourse-cdn.com/v4/letter/d/c0e974/32.png) [@devdewboy](https://forums.percona.com/u/devdewboy)\
**Post date:** [August 31, 2023, 3:37pm UTC](https://forums.percona.com/t/alerting-using-custom-template-alerting-but-with-extraneous-labels/24847/2 "2023-08-31T15:37:44Z")

</div>

Well… after bashing my head on this yesterday trying to figure out why this generated alert wasn’t being pushed to a Notification Policy. It magically started working this morning! Not quite sure what changed if anything. I retested several times just to make sure. Phew.

---

<div class="post-metadata">

**Author:** ![Roma\_Novikov](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/roma_novikov/32/1161_2.png) [@Roma\_Novikov](https://forums.percona.com/u/Roma_Novikov)\
**Post date:** [December 21, 2023, 9:46pm UTC](https://forums.percona.com/t/alerting-using-custom-template-alerting-but-with-extraneous-labels/24847/3 "2023-12-21T21:46:37Z")

</div>

Happy to know it’s worked for you, @devdewboy.  
The Alert template looks interesting. Can you share the full JSON so others can reuse it?
