Background
`config.apply_collection_preset` (install/41_schedule_management.sql:156) takes a named preset — `Aggressive`, `Balanced`, or `Low-Impact` — and bulk-updates `config.collection_schedule.frequency_minutes` for every collector in the preset table. Users already understand this abstraction.
It doesn't currently touch `enabled`. There's also no way to say "stop collecting for a while."
Recent tickets surface two gaps:
Proposed
Two small changes to `apply_collection_preset`:
- Add a fourth preset: `Off` (or `Idle` / `None`). Sets `enabled = 0` across every row in `config.collection_schedule`. No frequency changes.
- Teach the existing three presets to set `enabled = 1` when they run. This guarantees that switching back from `Off` reliably reactivates collection — otherwise `Off → Balanced` would update frequencies but leave every collector disabled.
With those two changes, time-of-day scoping becomes a pure SQL Agent composition:
```sql
-- Agent job "Overnight quiet hours - start" (schedule: daily 22:00)
EXECUTE config.apply_collection_preset @preset_name = N'Off';
-- Agent job "Overnight quiet hours - end" (schedule: daily 06:00)
EXECUTE config.apply_collection_preset @preset_name = N'Balanced';
```
Zero new schema. Zero new collector code. Agent owns time zones and DST. The switchover is idempotent (`UPDATE` statements). No "should I skip this run?" decision per collector, so no catch-up burst problem.
Scope
Main tradeoff
Teaching non-`Off` presets to set `enabled = 1` means applying any preset will re-enable collectors the user had manually disabled. That's usually the desired behavior (one switch, consistent state) but it quietly overrides a manual `UPDATE config.collection_schedule SET enabled = 0`. Two options:
- Accept it and call it out clearly in the preset's description / docs.
- Add a `@preserve_disabled bit = 0` parameter for users who want to keep their per-collector overrides.
I'd start with the simpler behavior and add the parameter only if someone asks.
Out of scope
- Per-collector time windows (different collectors on different schedules). Still composable via Agent job schedules that target a specific `apply_collection_preset` call, but no built-in config surface.
- Declarative preset schedule table (`config.preset_schedule`). Could follow if the Agent-job pattern proves inadequate.
Related
Background
`config.apply_collection_preset` (install/41_schedule_management.sql:156) takes a named preset — `Aggressive`, `Balanced`, or `Low-Impact` — and bulk-updates `config.collection_schedule.frequency_minutes` for every collector in the preset table. Users already understand this abstraction.
It doesn't currently touch `enabled`. There's also no way to say "stop collecting for a while."
Recent tickets surface two gaps:
Proposed
Two small changes to `apply_collection_preset`:
With those two changes, time-of-day scoping becomes a pure SQL Agent composition:
```sql
-- Agent job "Overnight quiet hours - start" (schedule: daily 22:00)
EXECUTE config.apply_collection_preset @preset_name = N'Off';
-- Agent job "Overnight quiet hours - end" (schedule: daily 06:00)
EXECUTE config.apply_collection_preset @preset_name = N'Balanced';
```
Zero new schema. Zero new collector code. Agent owns time zones and DST. The switchover is idempotent (`UPDATE` statements). No "should I skip this run?" decision per collector, so no catch-up burst problem.
Scope
Main tradeoff
Teaching non-`Off` presets to set `enabled = 1` means applying any preset will re-enable collectors the user had manually disabled. That's usually the desired behavior (one switch, consistent state) but it quietly overrides a manual `UPDATE config.collection_schedule SET enabled = 0`. Two options:
I'd start with the simpler behavior and add the parameter only if someone asks.
Out of scope
Related