Skip to content

How to monitor mysql long transaction info by using mysqld_exporter? #556

Open
@biaoyun

Description

@biaoyun

mysqld_exporter version: output of mysqld_exporter --version

mysqld_exporter, version 0.12.1

MySQL server version

mysqld Ver 5.6.40-84.0-56 for Linux on x86_64 (Percona XtraDB Cluster (GPL)

What did you expect to see?

went to find some metrics about mysql transaction duration time,but did‘t find it

In daily work,I usually use to following sql to check long transaction whether exist and other info anout long transaction :
SELECT trx_id, trx_started, NOW() - trx_started AS trx_duration_seconds
, CONCAT('KILL ', id, ' ;') AS kill_session_id
, user
, IF(LEFT(HOST, LOCATE(':', host) - 1) = '', host, LEFT(HOST, LOCATE(':', host) - 1)) AS host
, command, time
, REPLACE(SUBSTRING(info, 1, 25), '
', '') AS info_25
FROM information_schema.innodb_trx
JOIN information_schema.processlist ON innodb_trx.trx_mysql_thread_id = processlist.id
WHERE NOW() - trx_started > 10
ORDER BY trx_started DESC;

Where i can find metrics about mysql transaction duration?

Looking forward to a reply.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions