Skip to content
MySQL plug-in

Alert thresholds

View Markdown

This chapter lists the default thresholds the plug-in ships and how to change them. Topics: 7.1 Default thresholds · 7.2 Changing thresholds

The plug-in ships 43 default metric thresholds, listed below, plus 4 availability conditions (the Status column of each target type’s Response metric, which drive the target’s Up/Down state and are not shown here).

Target typeMetric groupColumnOperatorWarningCriticalConsecutive occurrences
ip_mysql_databaseResponseReasonmatches^(AUTH_FAILED|ACCOUNT_LOCKED|PASSWORD_EXPIRED|KERBEROS_TICKET)$2
ip_mysql_databaseReplicationReplicaActivityseconds_behind_source>303001
ip_mysql_databaseReplicationReplicaActivitytime_lag_statusmatches^CLOCK_SKEW$2
ip_mysql_databaseReplicationReplicaActivityreplica_io_running=No1
ip_mysql_databaseReplicationReplicaActivityreplica_sql_running=false1
ip_mysql_databaseInnodbBufferPoolinnodb_bp_hit_rate<95901
ip_mysql_databaseInnodbTransactioninnodb_trx_history_list_length>10000010000001
ip_mysql_databaseConnectionActivityaborted_connects_delta>10501
ip_mysql_databaseThreadsActivityconnection_saturation_pct>80951
ip_mysql_databaseTableActivitydisk_tmp_table_pct>25501
ip_mysql_databaseSysSchemaStatussys_supported<11
ip_mysql_databaseBackupStatushours_since_last_success>26501
ip_mysql_databaseBackupStatuslast_backup_failed>01
ip_mysql_databaseBackupStatusnever_succeeded>01
ip_mysql_databaseWaitProfileavg_wait_us>100000050000003
ip_mysql_databaseWaitProfileSummarytop_wait_class=lock5
ip_mysql_databaseLicenselicensed<11
ip_mysql_databaseLicensedays_remaining<3071
ip_mysql_databaseCollectorStatusStatusmatchesCOLLECTION_ERROR2
ip_mysql_clusterResponseReasonmatches^(AUTH_FAILED|ACCOUNT_LOCKED|PASSWORD_EXPIRED|KERBEROS_TICKET)$2
ip_mysql_clusterGroupMemberStatscount_transactions_remote_in_applier_queue>10010001
ip_mysql_clusterGroupMemberStatscount_transactions_in_queue>10010001
ip_mysql_clusterGrConsensusavg_consensus_time_us>10000010000001
ip_mysql_clusterBackupSourcesource_offline>01
ip_mysql_clusterClusterHealthfault_tolerancematches^(NO_TOLERANCE|PARTIAL|UNREACHABLE|INVALIDATED|FENCED_WRITES|OTHER|ASSESSMENT_FAILED)$^(NO_QUORUM|OFFLINE|ERROR)$2
ip_mysql_clusterClusterHealthfallback_reasonmatches^(AUTH_FAILED|TIMEOUT|UNREACHABLE|MEMBER_UNREACHABLE|GROUP_REPLICATION_INACTIVE|KERBEROS_TICKET|KERBEROS_CONFIG_UNREADABLE|TLS_TRUSTSTORE_REQUIRED|TLS_VERIFY_FAILED|PARSE_FAILED)$2
ip_mysql_clusterCollectorStatusStatusmatchesCOLLECTION_ERROR2
ip_mysql_clustersetResponseReasonmatches^(AUTH_FAILED|ACCOUNT_LOCKED|PASSWORD_EXPIRED|KERBEROS_TICKET)$2
ip_mysql_clustersetClusterSetHealthdr_promotion_ready=02
ip_mysql_clustersetClusterSetHealthfallback_reasonmatches^(AUTH_FAILED|TIMEOUT|UNREACHABLE|MEMBER_UNREACHABLE|KERBEROS_TICKET|KERBEROS_CONFIG_UNREADABLE|TLS_TRUSTSTORE_REQUIRED|TLS_VERIFY_FAILED|PARSE_FAILED)$2
ip_mysql_clustersetClusterSetHealthhealth_stale_sincematches^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2} UTC$1
ip_mysql_clustersetClusterSetClustersfault_tolerancematches^(NO_TOLERANCE|PARTIAL|UNREACHABLE|INVALIDATED|FENCED_WRITES|OTHER)$^(NO_QUORUM|OFFLINE|ERROR)$2
ip_mysql_clustersetClusterSetClusterstime_lag_seconds>303002
ip_mysql_clustersetClusterSetClusterstime_lag_statusmatches^CLOCK_SKEW$2
ip_mysql_clustersetCollectorStatusStatusmatchesCOLLECTION_ERROR2
ip_mysql_routerRouterStatusuptime_seconds<6001
ip_mysql_routerRouterStatusconnection_headroom_pct<1021
ip_mysql_routerMetadataCacheseconds_since_last_success>603001
ip_mysql_routerMetadataCacherefresh_failed_delta>03
ip_mysql_routerRoutesis_alive<11
ip_mysql_routerRoutesdestination_count<11
ip_mysql_routerRoutesblocked_hosts>01
ip_mysql_routerCollectorStatusStatusmatchesCOLLECTION_ERROR2

The two wait thresholds, and why they are shaped the way they are. Wait time is the one signal on this list that scales with how busy a server is, so an absolute total would fire on every healthy production system and stay quiet on a small one. Both shipped wait thresholds therefore avoid totals:

  • WaitProfile.avg_wait_us is an average per wait, over non-idle events only, so it does not grow with traffic. An event averaging more than a second is blocked on something rather than merely popular. It needs three consecutive collections to fire, which is what stops a single slow wait on a quiet server from raising an incident on its own: on a target collecting one event a minute, one unlucky wait would otherwise be the whole average for that minute.
  • WaitProfileSummary.top_wait_class is the dominant-wait signal. It reports the class of the single event holding the most wait time in the interval, so it is independent of load by construction, and it warns when that class is lock for five consecutive collections. Sustained lock dominance means sessions are queueing on each other rather than working. It is a warning and never a critical, because a write-heavy server can legitimately show lock at the top for a minute or two; the five-collection requirement, not the value, is what makes it meaningful.

What lock covers. The class comes from the event name, and InnoDB charges a row-lock wait to wait/io/table/sql/handler, which is class io. A top_wait_class of lock therefore reflects table locks (wait/lock/table/sql/handler) and metadata locks (wait/lock/metadata/sql/mdl) only. Both of those instruments are enabled by default, so the threshold fires on sustained table or metadata lock contention; row-lock contention reaches this signal as class io and is better watched on the InnoDB Row Lock Waits page (5.1). The wait/synch/* instruments are disabled by default, which is why no synch threshold ships beside these two: synch cannot lead until you enable them in the Performance Schema.

Both are starting points in the sense 7.2 describes. On a server whose normal state is lock-dominated by design, raise the occurrence count or clear the threshold rather than living with a standing warning.

The time lag thresholds. On a MySQL Database target, Seconds Behind Source is the lag alert for asynchronous replicas (warning above 30 seconds, critical above 300), and Time Lag (time_lag_seconds, 6.4) is shown beside it with no threshold. On a ClusterSet target, each replica cluster’s Time Lag on ClusterSet Clusters warns above 30 seconds and is critical above 300, after two collections in a row, so one large transaction does not raise an incident. It reads an empty value as not observed: an open incident stays open until a collection measures the lag again. A stopped applier raises its own alert through replica_sql_running on a Database target.

Time Lag Status raises a WARNING when it reads CLOCK_SKEW, after two collections in a row, on a MySQL Database target and, per replica cluster, on a ClusterSet target. The message names the replica and the size of the skew, and the alert clears on the next collection that reads any other status.

The two ClusterSet thresholds. Both need two consecutive 5-minute collections, so one sample taken while a replication channel reconnects does not raise an incident.

  • ClusterSetHealth.dr_promotion_ready is CRITICAL when the value is 0: MySQL Shell assessed the ClusterSet and at least one readiness check failed. It does not fire on -1, which means readiness was not assessed (the repository rollup, or MySQL Shell could not be used; health_status reads UNKNOWN). When the value moves from 0 to -1 the incident clears, and the clear message says only that no failure is being reported: check health_status for the current verdict.

  • ClusterSetHealth.fallback_reason is a WARNING when MySQL Shell could not be used because of a fault an operator can fix, and the message names the reason. It fires for AUTH_FAILED, TIMEOUT, UNREACHABLE, MEMBER_UNREACHABLE, KERBEROS_TICKET, KERBEROS_CONFIG_UNREADABLE, TLS_TRUSTSTORE_REQUIRED, TLS_VERIFY_FAILED and PARSE_FAILED. It does not fire for the reasons that describe how the target is set up rather than a failure: MYSQLSH_NOT_FOUND, SOCKET_CONNECTION, KERBEROS_NOT_SUPPORTED and KERBEROS_CLIENT_UNAVAILABLE. A target that is not part of a ClusterSet (NOT_A_CLUSTERSET) reports no row, so there is nothing for the alert to fire on. When MySQL Shell succeeds the value is NONE, and the WARNING clears on that collection. Each fault in that list also raises Collector Status CRITICALs (6.5). Troubleshooting gives the remedy for each.

  • ClusterSetHealth.health_stale_since is a WARNING when the ClusterSet had a MySQL Shell verdict (READY or NOT_READY) before and the last three collections in a row returned none. The column reads NONE while health is current and holds the UTC time of the last verdict once it is stale, so the message names that time. It clears on the next verdict. A target that never had a verdict (no MySQL Shell on the agent host, a socket connection) never fires.

    A target whose Health Source Mode is JDBC_METADATA never asks MySQL Shell for a verdict, so nothing is counted: the column reads NONE and the alert never fires. In AUTO the count continues when the members are read over JDBC because MySQL Shell failed.

  • ClusterSetClusters.fault_tolerance and ClusterHealth.fault_tolerance carry the same condition, on the ClusterSet target per cluster and on the Cluster target for its own cluster. CRITICAL for NO_QUORUM, OFFLINE and ERROR; WARNING for NO_TOLERANCE, PARTIAL, UNREACHABLE, INVALIDATED, FENCED_WRITES and OTHER. OK and NOT_ASSESSED match neither, so the incident clears on the next OK and a target without MySQL Shell never fires.

    UNREACHABLE on a replica cluster is also the value for a cluster the agent cannot reach. The status text tells a running cluster from a down one (2.2). Both health sources read it from the primary cluster’s primary, so the WARNING is the same on JDBC_METADATA as on ADMINAPI. On the JDBC read it applies only to a cluster whose members were tried (2.2). Both need two collections in a row (5.2 lists what each value means).

  • ClusterHealth.fault_tolerance is also a WARNING for ASSESSMENT_FAILED, the value reported when MySQL Shell is installed and fails. An incident that is open for NO_QUORUM therefore steps down to WARNING and stays open when the cluster stops answering MySQL Shell; it does not clear. A ClusterSet target reports no per-cluster rows while MySQL Shell fails, so ASSESSMENT_FAILED does not occur there, and the stale-health condition above covers that case.

  • Response.Reason is CRITICAL for AUTH_FAILED, ACCOUNT_LOCKED, PASSWORD_EXPIRED and KERBEROS_TICKET, on the MySQL Database, Cluster and ClusterSet target types. The target is Down in each case, and this incident says that the monitoring login failed, where the target-down event alone would read as an outage. NONE (the target is up) and the reachability reasons NETWORK, TIMEOUT, TLS, TLS_REQUIRED_BY_SERVER and OTHER match nothing, so the incident clears when the login works again or the fault becomes a plain outage. The message carries the reason and never a credential. The Troubleshooting page lists every reason under Connecting to MySQL.

  • ClusterHealth.fallback_reason is a WARNING when MySQL Shell could not be used on a Cluster target because of a fault an operator can fix. It fires for the same reasons as the ClusterSet condition above and for GROUP_REPLICATION_INACTIVE. It does not fire for MYSQLSH_NOT_FOUND, SOCKET_CONNECTION, KERBEROS_NOT_SUPPORTED, KERBEROS_CLIENT_UNAVAILABLE or NOT_A_CLUSTER. It fires for exactly the reasons that make ClusterHealth.fault_tolerance read ASSESSMENT_FAILED, so a Cluster target whose MySQL Shell fails has two warnings open: this one names the cause, and the fault-tolerance one holds any incident that was already open. The same fault also raises the Collector Status CRITICAL for ClusterHealth (6.5).

  • The stale count is a target property. The collector does the counting, so the condition uses one occurrence; change the count with the Health Stale After property, not with Number of Occurrences. health_stale carries the same state as a number: 1 stale, 0 not stale, -1 when the staleness step itself failed.

  • What the stale condition does not cover. A collection that fails with an error returns no row; Enterprise Manager raises its own metric collection error and this condition is not evaluated. A target that is no longer part of a ClusterSet also returns no row. The record of the last verdict is kept in the plug-in’s cache file on the agent host and starts over after a plug-in upgrade or when that file is removed: an open Health Stale incident then clears, and the target must return a verdict again before it can go stale.

The Collector Status threshold. CollectorStatus.Status is CRITICAL when it matches COLLECTION_ERROR, on all four target types, after two collections in a row. The group is collected every 5 minutes, also while the target is down, so the incident appears about 10 minutes after a group starts failing. Each metric group raises its own incident, because MetricGroup is the key, and the message names the group and the reason: Collection of the <group> metric group is failing on this MySQL database target: <reason>. The incident clears on the first collection after which the group’s status is anything else.

The other five words never alert: NOT_CONFIGURED, NOT_COLLECTED_YET, NO_DATA and DISABLED describe the server or the setup, and OK is the healthy state. While the target does not answer, other groups’ errors read NOT_COLLECTED_YET, so the target-down event stays the one alert (6.5). Troubleshooting lists what to check for a group that reads COLLECTION_ERROR.

The MySQL Router thresholds. The Router target raises its incidents on itself; Enterprise Manager does not copy them to the Cluster or ClusterSet target. Read them together with the Router pages (5.4).

  • RouterStatus.uptime_seconds is a WARNING when it is below 600, the signal that the Router restarted. The age is measured on the Router’s own clock, so a clock difference between the agent host and the Router host does not distort it. The WARNING clears at the first collection after the Router has run for 10 minutes. A restart also resets the Router’s counters, so the delta columns report no value for the interval in which it happened.
  • RouterStatus.connection_headroom_pct is a WARNING below 10 and CRITICAL below 2, and only when the Router reports a maximum for its client connections.
  • MetadataCache.seconds_since_last_success is a WARNING above 60 seconds and CRITICAL above 300: the Router is routing on a topology it has not refreshed. MetadataCache.refresh_failed_delta is a WARNING when refreshes fail on 3 collections in a row. The alert message names both possible causes of a failing refresh, the network path from the Router to the MySQL servers that hold the metadata and the Router’s own metadata account being locked or denied, because the REST API shows the two identically. Only the Router’s log tells them apart.
  • Routes.is_alive and Routes.destination_count are CRITICAL when a route is not alive or has no destinations: clients cannot get through that route. When a Router loses every metadata server it closes its routing ports, yet its REST API keeps answering, so the target stays Up and these two conditions carry the signal.
  • A partial loss is reported late. When a route loses its only destination while the Router can still reach the metadata servers, is_alive turns to 0 only after a client attempt through that route fails, and destination_count does not drop. The plug-in sends no probe connection of its own, because a probe would add failed connections to the server’s count.
  • Routes.blocked_hosts is a WARNING when above 0. A Router blocks a client host after max_connect_errors malformed handshakes from it (100 by default). Clean connections that open and close do not count toward that limit. A block is cleared only by restarting the Router: the REST API has no call that clears it, so the WARNING stays until the restart.
  • Failed client connections are counted on the database, not on the Router. The Router’s REST API has no counter of them. The database server counts a failed login that came through a Router in aborted_connects_delta on its MySQL Database target, and attributes it to the Router’s address rather than to the client’s.

The shipped values are starting points sized for lab workloads, not tuning. Review each one against your own service levels and change the ones that do not fit.

Thresholds live on the target, and you edit them from Metric and Collection Settings:

  1. From the target’s home page, choose the target-type menu → Monitoring → Metric and Collection Settings.

  2. Set the View list to All metrics so that columns without a current threshold are listed too.

    Metric and Collection Settings for a MySQL Database target: each metric group with its collection schedule, and the Warning and Critical Threshold fields for the columns that ship with one

  3. Find the metric group and column. 7.1 gives both names for every shipped threshold, and the metrics reference (6.1) gives them for every other column.

  4. Edit Warning Threshold and Critical Threshold on the row, or click the row’s edit icon for the full editor.

  5. Set Number of Occurrences if the condition should have to hold for more than one collection before it raises an incident. Most shipped thresholds use one occurrence; the exceptions are dr_promotion_ready, fallback_reason and Collector Status Status (two each), avg_wait_us (three) and top_wait_class (five), for the reasons 7.1 gives.

  6. Click OK to save. The new value applies from the next collection.

Done when get_threshold reports the new value for the target:

Terminal window
emcli get_threshold -target_name="mysql84-prod-01" -target_type="ip_mysql_database"

Clearing a threshold field removes the threshold: the column keeps collecting and stops alerting. The same page changes a group’s collection schedule, and can stop a group collecting altogether. Use that rather than deleting a target when you want to quiet a metric group.

Note: A threshold edited this way is an override on that one target, and applying a monitoring template to the target replaces it with the template’s value. Where a value should hold across a fleet, put it in a monitoring template (Enterprise → Monitoring → Monitoring Templates, created from a MySQL target and applied to a group) rather than editing targets one at a time and having the next template apply undo the work.