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

x-pack/metricbeat/module/sql: Add debug queries when merge_results: true #42271

Merged
merged 3 commits into from
Jan 10, 2025

Conversation

shmsr
Copy link
Member

@shmsr shmsr commented Jan 9, 2025

Proposed commit message

Add debug queries when merge_results: true. No new configuration added to match the behaviour when merge_results: false. Previously, as it was multiple queries that results in merge of results, the query parameter was left entry and hence the field was omitted out when merge_results: true. Now, we will publish it from here. Users that want this can keep it and others who do not want it can drop it.

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.

How to test this PR locally

  • Test if queries are there when merge_results is set to true.

Related issues

Screenshots

  • When merge_results: false:

Screenshot 2025-01-10 at 12 01 56 PM Screenshot 2025-01-10 at 12 01 47 PM


  • When merge_results: true:
Screenshot 2025-01-10 at 11 59 52 AM

@shmsr shmsr requested a review from a team as a code owner January 9, 2025 08:31
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jan 9, 2025
@shmsr shmsr self-assigned this Jan 9, 2025
@shmsr shmsr requested a review from harnish-elastic January 9, 2025 08:31
Copy link
Contributor

mergify bot commented Jan 9, 2025

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @shmsr? 🙏.
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-8./d is the label to automatically backport to the 8./d branch. /d is the digit

Copy link
Contributor

mergify bot commented Jan 9, 2025

backport-8.x has been added to help with the transition to the new branch 8.x.
If you don't need it please use backport-skip label and remove the backport-8.x label.

@mergify mergify bot added the backport-8.x Automated backport to the 8.x branch with mergify label Jan 9, 2025
@shmsr shmsr added Team:Obs-InfraObs Label for the Observability Infrastructure Monitoring team and removed backport-8.x Automated backport to the 8.x branch with mergify labels Jan 9, 2025
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jan 9, 2025
@mergify mergify bot added the backport-8.x Automated backport to the 8.x branch with mergify label Jan 9, 2025
@agithomas
Copy link
Contributor

If the actual query is what is considered here, don't you think that this would increase the size of the document significantly? Some of the queries can be long.

@shmsr
Copy link
Member Author

shmsr commented Jan 9, 2025

If the actual query is what is considered here, don't you think that this would increase the size of the document significantly? Some of the queries can be long.

Yes. If you see the related issue's description, Lalit noted the same that the query field was left out because it could take up space in cases of multiple long queries.

We're adding this feature now since the current behavior doesn't match when merge_results: false. Now, we'll let users decide whether they want to preserve queries or not through a configuration option in the integration. This puts the control in users' hands - they can choose to keep or drop the field based on their needs. We handle this in ingest pipelines.

A sample PR: elastic/integrations#12216 demonstrates this approach in integrations. While the query field preservation is optional, users who need it for debugging or analysis purposes can easily enable it.

Copy link
Contributor

@agithomas agithomas left a comment

Choose a reason for hiding this comment

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

LGTM!

@shmsr shmsr enabled auto-merge (squash) January 10, 2025 10:43
@shmsr shmsr merged commit d288e54 into elastic:main Jan 10, 2025
22 checks passed
mergify bot pushed a commit that referenced this pull request Jan 10, 2025
shmsr added a commit that referenced this pull request Jan 13, 2025
…true` (#42271) (#42285)

(cherry picked from commit d288e54)

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
backport-8.x Automated backport to the 8.x branch with mergify enhancement Team:Obs-InfraObs Label for the Observability Infrastructure Monitoring team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants