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

[sqlserver] Emit raw query statements and plans for non prepared statements #19421

Merged
merged 12 commits into from
Jan 27, 2025

Conversation

lu-zhengda
Copy link
Contributor

@lu-zhengda lu-zhengda commented Jan 16, 2025

What does this PR do?

This PR introduces a feature to ingest raw query statements and explain plans when the collect_raw_query_statement.enabled option is set to true. The raw query statement is collected alongside activity samples from sys.dm_exec_input_buffer using session_id and request_id, which provides the input text that triggers query execution.

Motivation

https://datadoghq.atlassian.net/browse/DBMON-4952
This enhancement supplements obfuscated and normalized query statements with de-obfuscated query statements and execution plans, provides insights into query parameter values.
Note that raw query statements include parameter values only for non-prepared statements.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Add the qa/skip-qa label if the PR doesn't need to be tested during QA.
  • If you need to backport this PR to another branch, you can add the backport/<branch-name> label to the PR and it will automatically open a backport PR once this one is merged

Copy link

codecov bot commented Jan 16, 2025

Codecov Report

Attention: Patch coverage is 86.36364% with 12 lines in your changes missing coverage. Please review.

Project coverage is 88.91%. Comparing base (64cafe2) to head (3abd644).
Report is 67 commits behind head on master.

Additional details and impacted files
Flag Coverage Δ
activemq ?
cassandra ?
hive ?
hivemq ?
hudi ?
ignite ?
jboss_wildfly ?
kafka ?
presto ?
solr ?
sqlserver 91.48% <86.36%> (+9.84%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@lu-zhengda lu-zhengda marked this pull request as ready for review January 24, 2025 21:37
@lu-zhengda lu-zhengda requested review from a team as code owners January 24, 2025 21:37
@lu-zhengda lu-zhengda changed the title [sqlserver] Emit raw query statement [sqlserver] Emit raw query statements and plans for non prepared statements Jan 24, 2025
@nenadnoveljic
Copy link
Contributor

Can you add the Jira card?

@lu-zhengda lu-zhengda added this pull request to the merge queue Jan 27, 2025
Merged via the queue into master with commit 5150864 Jan 27, 2025
41 checks passed
@lu-zhengda lu-zhengda deleted the zhengda.lu/context branch January 27, 2025 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants