# Integrated Alerting / Alerts

**URL:** <https://forums.percona.com/t/integrated-alerting-alerts/12821>\
**Category:** MySQL & MariaDB\
**Tags:** percona\
**Created:** [November 1, 2021, 12:23pm UTC](https://forums.percona.com/t/integrated-alerting-alerts/12821 "2021-11-01T12:23:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![obulreddy11](https://avatars.discourse-cdn.com/v4/letter/o/839c29/32.png) [@obulreddy11](https://forums.percona.com/u/obulreddy11)\
**Post date:** [November 1, 2021, 12:23pm UTC](https://forums.percona.com/t/integrated-alerting-alerts/12821/1 "2021-11-01T12:23:59Z")

</div>

Below for mysql lock wait time out, i think it has some error, please suggest me

```auto
====================================================================
---
templates:
    - name: mysql_innodb_lock_wait_timeout
      version: 1
      summary: MySQL lock wait timeout
      tiers: [anonymous, registered]
      expr: |-
        max_over_time(mysql_global_status_Innodb_row_lock_time_max[1m]) / ignoring (job)
        innodb_lock_wait_timeout
        * 100
        > [[.threshold]]
      params:
        - name: threshold
          summary: A percentage from configured maximum
          unit: '%'
          type: float
          range: [0, 100]
          value: 80
      for: 5m
      severity: warning
      labels:
        foo: bar
      annotations:
        description: |-
            More than [[.threshold]]% of MySQL lock_wait_timeout on {{ $labels.instance }}
            VALUE = {{ $value }}
            LABELS: {{ $labels }}
        summary: MySQL lock_wait_timeout (instance {{ $labels.instance }})

```

---

<div class="post-metadata">

**Author:** ![steve.hoffman](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/steve.hoffman/32/66_2.png) [@steve.hoffman](https://forums.percona.com/u/steve.hoffman)\
**Post date:** [November 1, 2021, 9:19pm UTC](https://forums.percona.com/t/integrated-alerting-alerts/12821/2 "2021-11-01T21:19:21Z")

</div>

Are you getting an error of any kind in the Template creation UI? YAML is finicky about spacing so you might try this if you’re getting a paste error:

```auto
---
templates:
- name: mysql_innodb_lock_wait_timeout
  version: 1
  summary: MySQL lock wait timeout
  tiers: [anonymous, registered]
  expr: |-
    max_over_time(mysql_global_status_Innodb_row_lock_time_max[1m]) / ignoring (job)
    innodb_lock_wait_timeout * 100 > [[.threshold]]
  params:
    - name: threshold
      summary: A percentage from configured maximum
      unit: '%'
      type: float
      range: [0, 100]
      value: 80
  for: 5m
  severity: warning
  labels:
    foo: bar
  annotations:
    description: |-
      More than [[.threshold]]% of MySQL lock_wait_timeout on {{ $labels.instance }}
      VALUE = {{ $value }}
      LABELS: {{ $labels }}
    summary: MySQL lock_wait_timeout (instance {{ $labels.instance }})

```

Have you validated that your expression returns results (I tend to use the explore option in PMM to paste my expression and see what results I get back)

If all else fails you can look inside the container at /srv/logs/pmm-managed.log or /srv/logs/alertmanager.log to see if either provides more info about what’s going wrong.

_edit_ I tried pasting in my test instance and found that you had an incorrect single quote for unit:`%’ and some indentation issues.

---

<div class="post-metadata">

**Author:** ![obulreddy11](https://avatars.discourse-cdn.com/v4/letter/o/839c29/32.png) [@obulreddy11](https://forums.percona.com/u/obulreddy11)\
**Post date:** [November 2, 2021, 6:15am UTC](https://forums.percona.com/t/integrated-alerting-alerts/12821/3 "2021-11-02T06:15:44Z")

</div>

Hi steve,  
i am not getting any kind of error to template creation UI.  
is it right template to send lock wait time out alerts. i tried what you shared template alignment, but i am not getting alert

---

<div class="post-metadata">

**Author:** ![Vadim\_Yalovets](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/vadim_yalovets/32/43_2.png) [@Vadim\_Yalovets](https://forums.percona.com/u/Vadim_Yalovets)\
**Post date:** [November 3, 2021, 12:09pm UTC](https://forums.percona.com/t/integrated-alerting-alerts/12821/4 "2021-11-03T12:09:03Z")

</div>

> [@obulreddy11](#):
>
> is it right template to send lock wait time out alerts. i tried what you shared template alignment, but i am not getting alert

Could you try to use metric **mysql\_global\_variables\_innodb\_lock\_wait\_timeout** in the alert formula?

```auto
max_over_time(mysql_global_status_innodb_row_lock_time_max[1m]) / ignoring (job) mysql_global_variables_innodb_lock_wait_timeout * 100

```

---

<div class="post-metadata">

**Author:** ![obulreddy11](https://avatars.discourse-cdn.com/v4/letter/o/839c29/32.png) [@obulreddy11](https://forums.percona.com/u/obulreddy11)\
**Post date:** [November 8, 2021, 3:44pm UTC](https://forums.percona.com/t/integrated-alerting-alerts/12821/5 "2021-11-08T15:44:37Z")

</div>

Thanks adivinho, now its working
