Adjust mysql replication sensitivity

I’m trying to adjust the sensitivity for the mysql slave replication lag so I only get alerts if it’s falling really behind, not a few seconds. Here’s where I’m at:

sudo /etc/netdata/edit-config health.d/mysql.conf
....
 template: mysql_replication_lag
       on: mysql.slave_behind
    class: Database
component: MySQL
     type: Errors
     calc: $seconds
    units: seconds
    every: 10s
     warn: $this > (($status >= $WARNING)  ? (5)  : (10))
     crit: $this > (($status == $CRITICAL) ? (10) : (30))
    delay: down 15m multiplier 1.5 max 1h
     info: difference between the timestamp of the latest transaction processed by the SQL thread and \
           the timestamp of the same transaction when it was processed on the master
       to: dba

How do I adjust the sensitivity to where warning is 1 min behind & critical is 5 mins behind?

I just started receiving these alerts recently from Netdata Cloud. I do like them but I just want them to be less sensitive. Thanks!

Hi @churnd :wave:

You need to modify warn and crit lines.

Also, check Special use of the conditional operator section.

How do I adjust the sensitivity to where warning is 1 min behind & critical is 5 mins behind?

Here you go, the thresholds are in seconds.

     warn: $this > (($status >= $WARNING)  ? (50)  : (60))
     crit: $this > (($status == $CRITICAL) ? (280) : (300))
2 Likes

Thanks, that did it. I figured that was the section, but wasn’t sure what the thresholds meant.