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

I have one question about Mysql user query data in Prometheus. #3427

Closed
kimbc opened this Issue Nov 8, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@kimbc
Copy link

kimbc commented Nov 8, 2017

I have one question about Mysql user query data in Prometheus.

I need to check processlist information based on timeline.

but PMM can't support processlist information with SQL text data.

so I found this.

-- "mysqld_exporter/collector/perf_schema_events_statements"

This collector can gather Mysql user query data.

this is the gathering query.

-- "perf_schema_events_statements" gather query
const perfEventsStatementsQuery = "
SELECT
ifnull(SCHEMA_NAME, 'NONE') as SCHEMA_NAME,
DIGEST,
LEFT(DIGEST_TEXT, %d) as DIGEST_TEXT,
COUNT_STAR,
SUM_TIMER_WAIT,
SUM_ERRORS,
SUM_WARNINGS,
SUM_ROWS_AFFECTED,
SUM_ROWS_SENT,
SUM_ROWS_EXAMINED,
SUM_CREATED_TMP_DISK_TABLES,
SUM_CREATED_TMP_TABLES,
SUM_SORT_MERGE_PASSES,
SUM_SORT_ROWS,
SUM_NO_INDEX_USED
FROM (
SELECT *
FROM performance_schema.events_statements_summary_by_digest
WHERE SCHEMA_NAME NOT IN ('mysql', 'performance_schema', 'information_schema')
AND LAST_SEEN > DATE_SUB(NOW(), INTERVAL %d SECOND)
ORDER BY LAST_SEEN DESC
)Q
GROUP BY
Q.SCHEMA_NAME,
Q.DIGEST,
Q.DIGEST_TEXT,
Q.COUNT_STAR,
Q.SUM_TIMER_WAIT,
Q.SUM_ERRORS,
Q.SUM_WARNINGS,
Q.SUM_ROWS_AFFECTED,
Q.SUM_ROWS_SENT,
Q.SUM_ROWS_EXAMINED,
Q.SUM_CREATED_TMP_DISK_TABLES,
Q.SUM_CREATED_TMP_TABLES,
Q.SUM_SORT_MERGE_PASSES,
Q.SUM_SORT_ROWS,
Q.SUM_NO_INDEX_USED
ORDER BY SUM_TIMER_WAIT DESC
LIMIT %d
"

as you can see, this collector gather the sql text data.

but I couldn't find Mysql user query data in Prometheus.

please let me know about finding sql text data in Prometheus.

thanks.

@grobie

This comment has been minimized.

Copy link
Member

grobie commented Nov 8, 2017

Please ask such questions on our mailing list. The issue tracker is only for bug reports and feature requests. See https://prometheus.io/community/ for more information.

@grobie grobie closed this Nov 8, 2017

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 23, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 23, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.