mysqld_exporter icon indicating copy to clipboard operation
mysqld_exporter copied to clipboard

Collect host_cache metrics, .e.g COUNT_HOST_BLOCKED_ERRORS

Open estahn opened this issue 4 years ago • 3 comments

Problem

We have seen various issues in our logs looking like this:

Error: ER_HOST_IS_BLOCKED: Host '10.10.5.115' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'

We would like to have metrics and possibly alert on this.

The following query returns information about the hosts:

SELECT * FROM performance_schema.host_cache WHERE IP = '10.10.5.115'

We're primarily interested in COUNT_HOST_BLOCKED_ERRORS.

estahn avatar Mar 31 '21 23:03 estahn

Seems like some useful data, exposing per-IP would probably be too much cardinality,

We would likely want to sum up the errors like this:

SELECT
  sum(COUNT_HOST_BLOCKED_ERRORS) AS blocked_errors_total
  FROM performance_schema.host_cache

SuperQ avatar Apr 01 '21 08:04 SuperQ

Yes, I was thinking the same after posting the feature request. Aggregating this should be good enough.

On Thu, 1 Apr 2021 at 7:45 pm, Ben Kochie @.***> wrote:

Seems like some useful data, exposing per-IP would probably be too much cardinality,

We would likely want to sum up the errors like this:

SELECT sum(COUNT_HOST_BLOCKED_ERRORS) AS blocked_errors_total FROM performance_schema.host_cache

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/prometheus/mysqld_exporter/issues/540#issuecomment-811754482, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACYNPTBMY34PDQ37GHMQL3TGQXELANCNFSM42F2A2DA .

estahn avatar Apr 03 '21 23:04 estahn