Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions collector/info_schema_processlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@ func (ScrapeProcesslist) Scrape(ctx context.Context, db *sql.DB, ch chan<- prome
func deriveThreadState(command string, state string) string {
var normCmd = strings.Replace(strings.ToLower(command), "_", " ", -1)
var normState = strings.Replace(strings.ToLower(state), "_", " ", -1)
// check if replication master first
if normCmd == "binlog dump" {
return "replication master"
}
// check if it's already a valid state
_, knownState := threadStateCounterMap[normState]
if knownState {
Expand All @@ -261,9 +265,6 @@ func deriveThreadState(command string, state string) string {
if normCmd == "query" {
return "executing"
}
if normCmd == "binlog dump" {
return "replication master"
}
return "other"
}

Expand Down