Skip to content

Commit 06676cb

Browse files
removed query store on checks (#252)
* removed query store on checks * added changelog
1 parent 8974a3c commit 06676cb

3 files changed

Lines changed: 5 additions & 20 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ Unreleased section should follow [Release Toolkit](https://github.com/newrelic/r
99

1010
## Unreleased
1111

12+
### enhancements
13+
- Removed the query store on/off check in prevalidations and queries in qpm
14+
1215
## v2.21.1 - 2025-09-18
1316

1417
### 🐞 Bug fixes

src/queryanalysis/config/query_config.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ var Queries = []models.QueryDetailsDto{
8787
AND EXISTS (
8888
SELECT 1
8989
FROM sys.databases d
90-
WHERE d.database_id = CONVERT(INT, pa.value) AND d.is_query_store_on = 1
90+
WHERE d.database_id = CONVERT(INT, pa.value)
9191
)
9292
)
9393
SELECT
@@ -149,7 +149,6 @@ var Queries = []models.QueryDetailsDto{
149149
DECLARE db_cursor CURSOR FOR
150150
SELECT name FROM sys.databases
151151
WHERE state_desc = 'ONLINE'
152-
AND is_query_store_on = 1
153152
AND database_id > 4;
154153
155154
OPEN db_cursor;
@@ -280,7 +279,6 @@ var Queries = []models.QueryDetailsDto{
280279
OUTER APPLY sys.dm_exec_sql_text(blocking_info.blocked_sql_handle) AS blocked_sql
281280
OUTER APPLY sys.dm_exec_input_buffer(blocking_info.blocking_spid, NULL) AS input_buffer
282281
JOIN sys.databases AS db ON db.database_id = blocking_info.database_id
283-
WHERE db.is_query_store_on = 1
284282
ORDER BY
285283
blocking_info.start_time;`,
286284
Type: "blockingSessions",

src/queryanalysis/validation/validation_check.go

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func ValidatePreConditions(sqlConnection *connection.SQLConnection) bool {
2525
return false
2626
}
2727

28-
if !checkDatabaseCompatibility(databaseDetails) || !queryStoresAreEnabledForAnyDB(databaseDetails) {
28+
if !checkDatabaseCompatibility(databaseDetails) {
2929
return false
3030
}
3131

@@ -75,19 +75,3 @@ func checkPermissionsAndLogin(sqlConnection *connection.SQLConnection) bool {
7575
}
7676
return true
7777
}
78-
79-
func queryStoresAreEnabledForAnyDB(databaseDetails []models.DatabaseDetailsDto) bool {
80-
allQueryStoresOff := true
81-
for _, database := range databaseDetails {
82-
if database.IsQueryStoreOn {
83-
log.Debug("Query store is enabled for this database %s. Please ensure that the query capture mode is set to \"ALL\" to capture all queries.", database.Name)
84-
allQueryStoresOff = false
85-
} else {
86-
log.Debug("Query store is disabled for this database %s, so query monitoring will be skipped. To enable it, use the following command: `ALTER DATABASE %s SET QUERY_STORE = ON (QUERY_CAPTURE_MODE = ALL);", database.Name, database.Name)
87-
}
88-
}
89-
if allQueryStoresOff {
90-
log.Error("Query store is currently turned off for all databases, so query monitoring will be skipped. To enable it and set the capture mode to \"ALL,\" please refer to this guide: [New Relic Documentation for Microsoft SQL](https://docs.newrelic.com/install/microsoft-sql/).")
91-
}
92-
return !allQueryStoresOff
93-
}

0 commit comments

Comments
 (0)