Parameterize SQL Server agent history row limit#24206
Merged
Merged
Conversation
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: c4f2c23 | Docs | Datadog PR Page | Give us feedback! |
Contributor
Validation ReportAll 21 validations passed. Show details
|
eric-weaver
approved these changes
Jun 26, 2026
github-actions Bot
pushed a commit
to ConnectionMaster/integrations-core
that referenced
this pull request
Jun 26, 2026
* Parameterize SQL Server agent history row limit * Add SQL Server row limit changelog entry 4dff6b2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Parameterizes the SQL Server Agent job history row limit by changing the query to use
SELECT TOP (?)and executing it with(history_row_limit, last_collection_time). It also removes duplicated test SQL so the tests execute the productionAGENT_HISTORY_QUERYdirectly.Motivation
Follow-up to #24203. That PR stabilized the changing
completion_epoch_timefilter; this removes the remaining query text formatting for the configurablehistory_row_limitso both dynamic query inputs are bound parameters.Validation so far:
ddev --no-interactive test -fs sqlserverddev --no-interactive test sqlserver:py3.13-linux-odbc-2022-single -- -k test_agent_history_query_parameterizes_last_collection_timeI also attempted
test_connection_with_agent_historylocally to exerciseTOP (?)against SQL Server, but the local Docker SQL Server container failed before query execution withiniterrlog: Could not open error log file '/var/opt/mssql/log/errorlog'. Operating system error = 5(Access is denied.).Review checklist (to be filled by reviewers)
qa/requiredif this PR needs QA validation, orqa/skip-qaif it does not. Exactly one of the two is required.backport/<branch-name>label to the PR and it will automatically open a backport PR once this one is merged