Skip to content

Add collector for performance_schema.processlist - #1032

Open
rouize wants to merge 6 commits into
prometheus:mainfrom
rouize:patch-1
Open

Add collector for performance_schema.processlist#1032
rouize wants to merge 6 commits into
prometheus:mainfrom
rouize:patch-1

Conversation

@rouize

@rouize rouize commented May 30, 2026

Copy link
Copy Markdown

Since MySQL 8.0, the information_schema.processlist has been deprecated.
Request to add a scraper for the performance_schema.processlist
Refer to the following document:
https://dev.mysql.com/doc/refman/8.0/en/processlist-access.html
https://dev.mysql.com/doc/refman/8.0/en/information-schema-processlist-table.html
https://dev.mysql.com/doc/refman/8.0/en/performance-schema-processlist-table.html

rouize added 6 commits May 30, 2026 19:33
Add performance_schema.processlist for Mysql >= 8.0

Signed-off-by: rouize <73630347+rouize@users.noreply.github.com>
Signed-off-by: rouize <73630347+rouize@users.noreply.github.com>
Signed-off-by: rouize <73630347+rouize@users.noreply.github.com>
Signed-off-by: rouize <73630347+rouize@users.noreply.github.com>
Signed-off-by: rouize <73630347+rouize@users.noreply.github.com>
Signed-off-by: rouize <73630347+rouize@users.noreply.github.com>

@SuperQ SuperQ left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nits

@@ -0,0 +1,98 @@
// Copyright 2021 The Prometheus Authors

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Copyright 2021 The Prometheus Authors
// Copyright The Prometheus Authors

@@ -0,0 +1,201 @@
// Copyright 2018 The Prometheus Authors

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Copyright 2018 The Prometheus Authors
// Copyright The Prometheus Authors

Comment thread collector/mysql_user.go
)

// ScrapeUser collects from `information_schema.processlist`.
// ScrapeUser collects from `information_schema.processlist` or `performance_schema.processlist`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually a typo.

Suggested change
// ScrapeUser collects from `information_schema.processlist` or `performance_schema.processlist`.
// ScrapeUser collects from `mysql.user`.

@SuperQ SuperQ changed the title Request to add a scraper for the performance_schema.processlist for MySQL 8.0 and above Add collector for performance_schema.processlist Jul 12, 2026

@ArthurSens ArthurSens left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @rouize , do you still plan to work on this feature? I have some additional comments, but if you don't plan to work on those then we can probably close the PR 🤔

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend splitting this dashboard into a new PR. It's a lot to review, alongside the new collector 😓


// Tunable flags.
var (
processlistMinTime = kingpin.Flag(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the current code doesn't compile since this var already exists in other files, same as the ones below

Comment on lines +94 to +96
func (ScrapePerfProcesslist) Version() float64 {
return 8.0
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm, following the docs it was introduced in 8.0.22, but unfortunately our design doesn't allow that 😅

This is not a problem this PR is introducing, so let's ignore the problem for now 😛

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.

3 participants