You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Collectors have no user-facing way to exclude specific databases from collection. The default-trace collector is the clearest example today: in #835 a data warehouse on the monitored instance was generating ~3,100 Object:Created events per minute via its ETL tool, producing ~4M rows in 24 hours on `collect.default_trace_events`. The workaround was to flip `@include_object_events = 0` in the master dispatcher, which turns off object DDL events everywhere, not just in the noisy database.
Hardcoded exclusions already exist at `install/29_collect_default_trace.sql:370`:
```sql
AND ISNULL(ft.DatabaseID, 0) NOT IN (DB_ID(N'PerformanceMonitor'), 1, 3, 4)
AND ISNULL(ft.DatabaseID, 0) < 32761 /exclude contained AG system databases/
```
…but users can't extend that list. The same pattern (noisy DB contaminating a cross-instance collector) could hit `query_stats_collector`, `procedure_stats_collector`, `query_store_collector`, `blocking_deadlock_analyzer`, etc.
Proposed
A single user-editable config table consulted by every collector that has a `database_id` or `database_name` to filter on:
```sql
CREATE TABLE config.excluded_databases
(
database_name sysname NOT NULL PRIMARY KEY,
collector_name sysname NULL, -- NULL = exclude from all collectors
reason nvarchar(500) NULL,
created_at datetime2(7) NOT NULL DEFAULT SYSDATETIME()
);
```
Each collector's `INSERT ... SELECT` adds one predicate:
```sql
AND NOT EXISTS
(
SELECT 1/0
FROM config.excluded_databases AS ed
WHERE ed.database_name = .database_name
AND (ed.collector_name IS NULL OR ed.collector_name = N'<this_collector>')
)
```
Pure WHERE-clause predicate — stateless, no scheduling interaction, no timezone/DST concerns.
Wire the predicate into collectors that touch per-database data: `default_trace_collector`, `query_stats_collector`, `procedure_stats_collector`, `query_store_collector`, `blocking_deadlock_analyzer`, `file_io_stats_collector`, `database_configuration_collector`, and any others that have a database filter axis.
Document usage in README / install notes (`INSERT INTO config.excluded_databases VALUES (N'MyNoisyDW', NULL, N'ETL tool creates 3k objects/min');`).
Optional: a small UI surface in the Dashboard settings to view/edit the list, or leave it SQL-only for v1.
Out of scope
Time-of-day exclusion — tracked separately; see the "Off" preset proposal.
Per-schema or per-object exclusion — not requested yet, premature.
Background
Collectors have no user-facing way to exclude specific databases from collection. The default-trace collector is the clearest example today: in #835 a data warehouse on the monitored instance was generating ~3,100 Object:Created events per minute via its ETL tool, producing ~4M rows in 24 hours on `collect.default_trace_events`. The workaround was to flip `@include_object_events = 0` in the master dispatcher, which turns off object DDL events everywhere, not just in the noisy database.
Hardcoded exclusions already exist at `install/29_collect_default_trace.sql:370`:
```sql
AND ISNULL(ft.DatabaseID, 0) NOT IN (DB_ID(N'PerformanceMonitor'), 1, 3, 4)
AND ISNULL(ft.DatabaseID, 0) < 32761 /exclude contained AG system databases/
```
…but users can't extend that list. The same pattern (noisy DB contaminating a cross-instance collector) could hit `query_stats_collector`, `procedure_stats_collector`, `query_store_collector`, `blocking_deadlock_analyzer`, etc.
Proposed
A single user-editable config table consulted by every collector that has a `database_id` or `database_name` to filter on:
```sql
CREATE TABLE config.excluded_databases
(
database_name sysname NOT NULL PRIMARY KEY,
collector_name sysname NULL, -- NULL = exclude from all collectors
reason nvarchar(500) NULL,
created_at datetime2(7) NOT NULL DEFAULT SYSDATETIME()
);
```
Each collector's `INSERT ... SELECT` adds one predicate:
```sql.database_name
AND NOT EXISTS
(
SELECT 1/0
FROM config.excluded_databases AS ed
WHERE ed.database_name =
AND (ed.collector_name IS NULL OR ed.collector_name = N'<this_collector>')
)
```
Pure WHERE-clause predicate — stateless, no scheduling interaction, no timezone/DST concerns.
Scope
Out of scope
Related