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

[Metricbeat][MySQL] Performance metricset does not working with MySQL 5.7 #38710

Merged

Conversation

kush-elastic
Copy link
Collaborator

@kush-elastic kush-elastic commented Apr 3, 2024

Description

The following query is failing to run on MySQL version 5.7 because the quantile_95 is added as part of a new metric in MySQL version 8.0.1.

SELECT digest_text, count_star, avg_timer_wait, max_timer_wait, last_seen, quantile_95
    FROM performance_schema.events_statements_summary_by_digest
    ORDER BY avg_timer_wait DESC
    LIMIT 10

Updated Query to work with both version 5.7 and 8.0 with MySQL executable support. with version check, query parameters will be skipped if version 5.7 and 8.0.0 (which both do not have support for quantile_95).

SELECT digest_text, count_star, avg_timer_wait, max_timer_wait, last_seen /*!80001 ,quantile_95 */ 
    FROM performance_schema.events_statements_summary_by_digest 
    ORDER BY avg_timer_wait DESC 
    LIMIT 10;

Checklist

  • My code follows the style guidelines of this project
  • I have commented on my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding changes to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Author's Checklist

  • Check the query with the different versions from MariaDB and Percona

Related issues

Logs

ERROR [mysql.performance] query/query.go:92 error doing query {events_statements SELECT digest_text, count_star, avg_timer_wait, max_timer_wait, last_seen, quantile_95
FROM performance_schema.events_statements_summary_by_digest
ORDER BY avg_timer_wait DESC
LIMIT 10
table %!s(bool=true)}%!(EXTRA *mysql.MySQLError=Error 1054: Unknown column 'quantile_95' in 'field list')

@kush-elastic kush-elastic requested a review from a team as a code owner April 3, 2024 07:31
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Apr 3, 2024
@kush-elastic kush-elastic self-assigned this Apr 3, 2024
@kush-elastic kush-elastic added bug module Metricbeat Metricbeat Team:Obs-InfraObs Label for the Observability Infrastructure Monitoring team bugfix labels Apr 3, 2024
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Apr 3, 2024
Copy link
Contributor

mergify bot commented Apr 3, 2024

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @kush-elastic? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v8./d.0 is the label to automatically backport to the 8./d branch. /d is the digit

@elasticmachine
Copy link
Collaborator

elasticmachine commented Apr 3, 2024

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Duration: 101 min 50 sec

❕ Flaky test report

No test was executed to be analysed.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@kush-elastic kush-elastic added the Module:beat The beat Metricbeat module label Apr 3, 2024
CHANGELOG.next.asciidoc Outdated Show resolved Hide resolved
CHANGELOG.next.asciidoc Outdated Show resolved Hide resolved
@kush-elastic kush-elastic merged commit fab441b into elastic:main May 16, 2024
19 checks passed
@kush-elastic kush-elastic added the backport-v8.14.0 Automated backport with mergify label Jul 22, 2024
mergify bot pushed a commit that referenced this pull request Jul 22, 2024
… 5.7 (#38710)

* fix mysql metricbeat module failure for version 5.7

* add entry to CHANGELOG.next.asciidoc

* update changelog entry

* Update CHANGELOG.next.asciidoc

Co-authored-by: subham sarkar <sarkar.subhams2@gmail.com>

---------

Co-authored-by: subham sarkar <sarkar.subhams2@gmail.com>
Co-authored-by: subham sarkar <subham.sarkar@elastic.co>
(cherry picked from commit fab441b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v8.14.0 Automated backport with mergify bug bugfix Metricbeat Metricbeat Module:beat The beat Metricbeat module module Team:Obs-InfraObs Label for the Observability Infrastructure Monitoring team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Performance metricsets of Metricbeat MySQL module does not working with MySQL 5.7
4 participants