Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve processlist scraping with the transaction duration #599

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Uyoooo
Copy link

@Uyoooo Uyoooo commented Nov 25, 2021

Hello @SuperQ,

This PR add a new metric mysql_info_schema_max_tx_duration with the max transaction duration for each thread state.

Inspired by https://github.com/prometheus-community/postgres_exporter/blob/master/cmd/postgres_exporter/postgres_exporter.go#L305

mysql_info_schema_max_tx_duration{state="after create"} 0
mysql_info_schema_max_tx_duration{state="altering table"} 0
mysql_info_schema_max_tx_duration{state="analyzing"} 0
mysql_info_schema_max_tx_duration{state="checking permissions"} 0
mysql_info_schema_max_tx_duration{state="checking table"} 0
mysql_info_schema_max_tx_duration{state="cleaning up"} 0
mysql_info_schema_max_tx_duration{state="closing tables"} 0
...

This PR can resolve #556

@chicocvenancio
Copy link

We have a need for this metric as well, would rebasing this into the current codebase be enough to get this merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to monitor mysql long transaction info by using mysqld_exporter?
2 participants