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

[O11y][MySQL] Update query for performance data stream #38363

Merged
merged 21 commits into from
Jun 3, 2024

Conversation

harnish-elastic
Copy link
Contributor

@harnish-elastic harnish-elastic commented Mar 18, 2024

  • Enhancement

Proposed commit message

  • Modify the metricbeat code to support schemaname.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change 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.

Related issues

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Mar 18, 2024
Copy link
Contributor

mergify bot commented Mar 18, 2024

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @harnish-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

Copy link
Contributor

mergify bot commented Mar 18, 2024

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b mysql-update-query upstream/mysql-update-query
git merge upstream/main
git push upstream mysql-update-query

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @harnish-elastic

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @harnish-elastic

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @harnish-elastic

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @harnish-elastic

@elasticmachine
Copy link
Collaborator

💔 Build Failed

Failed CI Steps

History

cc @harnish-elastic

@elasticmachine
Copy link
Collaborator

💔 Build Failed

Failed CI Steps

History

cc @harnish-elastic

@elasticmachine
Copy link
Collaborator

💔 Build Failed

Failed CI Steps

History

cc @harnish-elastic

@elasticmachine
Copy link
Collaborator

elasticmachine commented Mar 18, 2024

@elasticmachine
Copy link
Collaborator

elasticmachine commented Mar 18, 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

  • Start Time: 2024-05-09T08:54:54.691+0000

  • Duration: 106 min 15 sec

Test stats 🧪

Test Results
Failed 0
Passed 4630
Skipped 905
Total 5535

💚 Flaky test report

Tests succeeded.

🤖 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!)

@elasticmachine
Copy link
Collaborator

elasticmachine commented Mar 18, 2024

@elasticmachine
Copy link
Collaborator

elasticmachine commented Mar 18, 2024

💔 Build Failed

Failed CI Steps

History

cc @harnish-elastic

@harnish-elastic harnish-elastic marked this pull request as ready for review March 19, 2024 09:53
@harnish-elastic harnish-elastic requested a review from a team as a code owner March 19, 2024 09:53
@kush-elastic
Copy link
Collaborator

@harnish-elastic,
Can you use mage update and then push again?
Some checks are failing.

@harnish-elastic
Copy link
Contributor Author

@harnish-elastic You can remove the changes in *.bat because I think the issue that we were facing is already addressed by this commit: f87a592

Updated, thanks!

Copy link
Contributor

mergify bot commented May 16, 2024

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b mysql-update-query upstream/mysql-update-query
git merge upstream/main
git push upstream mysql-update-query

@@ -26,6 +26,9 @@
- name: 'avg.timer.wait'
type: long
description: Average wait time of the summarized events that are timed
- name: 'schemaname'
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think that the schema would be more relevant field name here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we can do that. Thanks!

Copy link
Contributor Author

@harnish-elastic harnish-elastic May 31, 2024

Choose a reason for hiding this comment

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

While doing schemaname to schema we are getting the following error. We can keep schemaname to avoid this error.

{"log.level":"error","@timestamp":"2024-05-31T11:46:34.810+0530","log.logger":"mysql.performance","log.origin":{"function":"[github.com/elastic/beats/v7/metricbeat/module/mysql/query.(*MetricSet).Fetch](http://github.com/elastic/beats/v7/metricbeat/module/mysql/query.%28*MetricSet%29.Fetch)","[file.name](http://file.name/)":"query/query.go","file.line":112},"message":"error doing query {events_statements SELECT schema_name AS schema, digest_text, count_star, avg_timer_wait, max_timer_wait, last_seen /*!80001 ,quantile_95 / \n  FROM performance_schema.events_statements_summary_by_digest \n  ORDER BY avg_timer_wait DESC \n  LIMIT 10;\n table %!s(bool=true)}%!(EXTRA *mysql.MySQLError=Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'schema, digest_text, count_star, avg_timer_wait, max_timer_wait, last_seen /!80' at line 1)","[service.name](http://service.name/)":"metricbeat","ecs.version":"1.6.0"}

Copy link
Member

@shmsr shmsr May 31, 2024

Choose a reason for hiding this comment

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

Which error? I think you missed pasting it?

Copy link
Contributor Author

@harnish-elastic harnish-elastic May 31, 2024

Choose a reason for hiding this comment

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

Mb, Updated

…mysql-update-query

Conflicts:
	metricbeat/module/mysql/performance/manifest.yml
Copy link
Contributor

@dliappis dliappis left a comment

Choose a reason for hiding this comment

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

Can we address the failure for check-metricbeat by running make update, as suggested in the output?

When I run it locally I get:

$ make update

$ git diff
<snipped output with changes to two files, see below>

$ git status
On branch pr/38363
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   metricbeat/docs/fields.asciidoc
        modified:   metricbeat/module/mysql/fields.go

@dliappis dliappis self-requested a review May 21, 2024 07:09
Copy link
Contributor

@dliappis dliappis left a comment

Choose a reason for hiding this comment

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

Thanks for addressing #38363 (review)

LGTM from my side/CI PoV as well.

@harnish-elastic
Copy link
Contributor Author

Thanks for addressing #38363 (review)

LGTM from my side/CI PoV as well.

Thank you! 🙌

@harnish-elastic harnish-elastic requested a review from muthu-mps May 21, 2024 10:28
Copy link
Contributor

@niraj-elastic niraj-elastic left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

@milan-elastic milan-elastic left a comment

Choose a reason for hiding this comment

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

Looks good!

Copy link
Contributor

@muthu-mps muthu-mps left a comment

Choose a reason for hiding this comment

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

Looks good!

@ali786XI ali786XI merged commit 8cc85a2 into elastic:main Jun 3, 2024
19 checks passed
shmsr added a commit to shmsr/beats that referenced this pull request Jun 4, 2024
* mysql update query

* add changelog entry

* mage check command

* make update

* change in python version to fix CI issue

* update python version

* revert changes of python file

* revert install-tools.bat file changes

* Merge branch 'main' of https://github.com/harnish-elastic/beats into mysql-update-query

* address review comments

* address review comments

* revert schema to schemaname to avoid error

---------

Co-authored-by: subham sarkar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Team:Automation Label for the Observability productivity team
Projects
None yet
Development

Successfully merging this pull request may close these issues.