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

Fix magento_indexer_backlog_count_total #34

Merged

Conversation

VladyslavSikailo
Copy link
Collaborator

@VladyslavSikailo VladyslavSikailo commented Jul 7, 2023

Problems

  1. magento_indexer_backlog_count_total metric calculates backlog items in a wrong way
    image
    image
    I expect it to display the same backlog items count as bin/magento indexer:status does.

  2. magento_indexer_backlog_count_total metric always has 3 possible values (per each indexer status)

image But it doesn't give information what is the current status. So it's impossible to really understand how many items are in the backlog

Solution

  1. For the first problem I applied the same solution as Magento used for bin/magento indexer:status command. See \Magento\Indexer\Console\Command\IndexerStatusCommand::execute. It uses direct SQL requests, so it has the same performance as before fix applying
  2. I removed 'status' and 'isValid' labels, so now we have only the title of the index and its backlog items count. To be able to see the current status we need to have different metric.

Note

I have added data patch that removes magento_indexer_backlog_count_total metrics from db table to make sure that only data with the new structure will be collected

@VladyslavSikailo VladyslavSikailo self-assigned this Jul 7, 2023
@DavidLambauer DavidLambauer merged commit b49c751 into master Jul 7, 2023
@DavidLambauer DavidLambauer deleted the bugfix/fix-magento_indexer_backlog_count_total-values branch July 7, 2023 08:48
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