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][MSSQL] Add optional mssql.query field to performance data stream for debugging purposes #12212

Merged
merged 0 commits into from
Jan 17, 2025

Conversation

harnish-elastic
Copy link
Contributor

@harnish-elastic harnish-elastic commented Dec 31, 2024

  • Enhancement

Proposed commit message

  • MSSQL perfromance data stream uses the merge_results: true parameter. From this parameter, I observed that all the sql_queries results are being merged in single event and we are not receiving the sql.query field in the response. Refer
  • Added preserve_sql_queries flag that can be used as preserve sql.query field, if it's enabled.

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.
  • I have verified that any added dashboard complies with Kibana's Dashboard good practices

Related issues

Screenshot

image
image

@harnish-elastic harnish-elastic self-assigned this Dec 31, 2024
@harnish-elastic harnish-elastic added Team:Obs-InfraObs Label for the Observability Infrastructure Monitoring team [elastic/obs-infraobs-integrations] bugfix Pull request that fixes a bug issue labels Dec 31, 2024
@harnish-elastic harnish-elastic marked this pull request as ready for review December 31, 2024 05:59
@harnish-elastic harnish-elastic requested a review from a team as a code owner December 31, 2024 05:59
@harnish-elastic harnish-elastic marked this pull request as draft December 31, 2024 06:04
@harnish-elastic harnish-elastic marked this pull request as ready for review December 31, 2024 10:13
@harnish-elastic harnish-elastic changed the title [O11y][MSSQL] Remove unnecessary processor in performance data stream [Don't Merge][O11y][MSSQL] Remove unnecessary processor in performance data stream Dec 31, 2024
@@ -81,3 +81,6 @@
- name: memory_grants_pending
type: long
description: This is generated from the default pattern given for Dynamic Counter Name variable. This counter tells us how many processes are waiting for the memory to be assigned to them so they can get started.
- name: query
type: keyword
description: Executed queries by this package.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Lets wait till the beats code change, This can be an array.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

array won't be supported.

Error: building package failed: invalid content found in built zip package: found 1 validation error:

  1. file "/github_repo/harnish_repo/integrations/build/packages/microsoft_sqlserver-2.9.5.zip/data_stream/performance/fields/fields.yml" is invalid: field 0.fields.1.type: 0.fields.1.type must be one of the following: "aggregate_metric_double", "alias", "histogram", "constant_keyword", "text", "match_only_text", "keyword", "long", "integer", "short", "byte", "double", "float", "half_float", "scaled_float", "date", "date_nanos", "boolean", "binary", "integer_range", "float_range", "long_range", "double_range", "date_range", "ip_range", "group", "geo_point", "object", "ip", "nested", "flattened", "wildcard", "version", "unsigned_long"

@harnish-elastic harnish-elastic requested a review from shmsr January 16, 2025 06:20
@harnish-elastic harnish-elastic changed the title [Don't Merge][O11y][MSSQL] Remove unnecessary processor in performance data stream [Don't Merge][O11y][MSSQL] Add optional mssql.query field to performance data stream for debugging purposes Jan 16, 2025
@elastic-vault-github-plugin-prod

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@harnish-elastic harnish-elastic changed the title [Don't Merge][O11y][MSSQL] Add optional mssql.query field to performance data stream for debugging purposes [O11y][MSSQL] Add optional mssql.query field to performance data stream for debugging purposes Jan 16, 2025
@harnish-elastic harnish-elastic added enhancement New feature or request and removed bugfix Pull request that fixes a bug issue labels Jan 16, 2025
Copy link
Member

@shmsr shmsr left a comment

Choose a reason for hiding this comment

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

same comments for the other PR too

Comment on lines 21 to 28
- name: preserve_sql_queries
required: true
show_user: false
title: Preserve SQL queries (debug)
description: Preserve the SQL queries used. Enable for debugging purposes only. This feature becomes available in Kibana version 8.18 onwards.
type: bool
multi: false
default: false
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- name: preserve_sql_queries
required: true
show_user: false
title: Preserve SQL queries (debug)
description: Preserve the SQL queries used. Enable for debugging purposes only. This feature becomes available in Kibana version 8.18 onwards.
type: bool
multi: false
default: false
- name: preserve_sql_queries
required: true
show_user: false
title: Preserve SQL Queries
description: Preserves SQL queries for debugging purposes. This feature is available in Elastic stack version 8.18 and later.
type: bool
multi: false
default: false

Comment on lines 52 to 55
tags:
{{#if preserve_sql_queries}}
- preserve_sql_queries
{{/if}}
Copy link
Member

Choose a reason for hiding this comment

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

https://github.com/elastic/integrations/pull/12097/files

^^

Here we are not accepting tags from users as of now. But see this PR where because of indentation we faced issue when user input was also there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated, thanks!

@@ -81,3 +81,6 @@
- name: memory_grants_pending
type: long
description: This is generated from the default pattern given for Dynamic Counter Name variable. This counter tells us how many processes are waiting for the memory to be assigned to them so they can get started.
- name: query
type: keyword
description: Executed queries by this package.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
description: Executed queries by this package.
description: The SQL queries executed.

@elasticmachine
Copy link

💚 Build Succeeded

History

  • 💚 Build #20491 succeeded b4d72cea6324d955a0ec72fcb53cb92bb7eb03d4
  • 💚 Build #20474 succeeded 08db39c7e43735284379b756acad3697dad9a14a
  • 💔 Build #20472 failed a39665c2b966e801cd4b5ca433fb1c3557719f90
  • 💚 Build #19937 succeeded 215e6b175de81f0b22bc7f728b8752dbda114038
  • 💚 Build #19934 succeeded 4a748570dfd130a029499903749c3490018e778c
  • 💚 Build #19932 succeeded 032e88286b746b91011b8500135ef54db2fb5d00

cc @harnish-elastic

@harnish-elastic harnish-elastic merged commit 9cddd71 into elastic:main Jan 17, 2025
5 checks passed
@elastic-vault-github-plugin-prod

Package microsoft_sqlserver - 2.10.0 containing this change is available at https://epr.elastic.co/package/microsoft_sqlserver/2.10.0/

harnish-elastic added a commit to harnish-elastic/integrations that referenced this pull request Feb 4, 2025
…ream for debugging purposes (elastic#12212)

* Remove unnecessary processor in performance data stream

* add changelog entry

* added debug flag that can  preserve mssql.query field when enabled

* Update packages/microsoft_sqlserver/data_stream/performance/manifest.yml

Co-authored-by: Lalit Satapathy <69236064+lalit-satapathy@users.noreply.github.com>

* update tag name

* minor change in pipeline and system tests

* minor change in tag description

* address review comments

---------

Co-authored-by: Lalit Satapathy <69236064+lalit-satapathy@users.noreply.github.com>
harnish-elastic added a commit to harnish-elastic/integrations that referenced this pull request Feb 5, 2025
…ream for debugging purposes (elastic#12212)

* Remove unnecessary processor in performance data stream

* add changelog entry

* added debug flag that can  preserve mssql.query field when enabled

* Update packages/microsoft_sqlserver/data_stream/performance/manifest.yml

Co-authored-by: Lalit Satapathy <69236064+lalit-satapathy@users.noreply.github.com>

* update tag name

* minor change in pipeline and system tests

* minor change in tag description

* address review comments

---------

Co-authored-by: Lalit Satapathy <69236064+lalit-satapathy@users.noreply.github.com>
@harnish-elastic harnish-elastic deleted the mssql-update-pipeline branch February 7, 2025 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Integration:microsoft_sqlserver Microsoft SQL Server Team:Obs-InfraObs Label for the Observability Infrastructure Monitoring team [elastic/obs-infraobs-integrations]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants