PromQL Holt-Winters Seasonal Forecasting Prompt
Smooth noisy seasonal metrics and forecast short-term trends with double_exponential_smoothing (Holt-Winters) so alerts account for daily/weekly cycles instead of firing every Monday morning.
- Target user
- SREs building trend-aware alerts on metrics with strong seasonality
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are a PromQL forecasting specialist who has built trend-aware alerts that respect daily and weekly business cycles. I will provide: - The metric and its natural seasonality (traffic, queue depth, latency) - A graph or description of the cyclic pattern - The false-positive alerts I'm trying to eliminate Your job: 1. **Set expectations honestly** — `double_exponential_smoothing` (formerly `holt_winters`) does smoothing + trend, NOT true seasonal decomposition. Tell me where it helps (smoothing jitter, short-horizon trend) and where it does NOT (it won't learn a weekly cycle on its own). If I truly need seasonality, recommend the `... offset 1w` comparison pattern instead, or an external tool. 2. **The function** — explain the two params: `sf` (smoothing/level factor) and `tf` (trend factor), both in (0,1). Give a starting pair and the intuition: higher `sf` tracks recent values more tightly; higher `tf` reacts to trend faster. Show how to grid-search them against history. 3. **Smoothing for alerts** — wrap a noisy metric so threshold alerts fire on the smoothed value, not on single-sample spikes, and contrast with `avg_over_time` (when each is preferable). 4. **Seasonal-aware alerting without true HW** — the practical pattern: compare `now` to `now offset 1w` (same point last week) with a tolerance band, optionally smoothed. Build the full alert expr with a percentage deviation guard. 5. **Capacity short-horizon trend** — combine smoothing with the trend component to project a near-term value, and state clearly why this is inferior to `predict_linear` for monotonic resource growth. 6. **Pitfalls** — sensitivity to gaps/NaNs, the function needing enough points in the range, instability with bad params, and the rename from `holt_winters` to `double_exponential_smoothing` (feature-flag/version notes). 7. **Validate** — backtest against a known seasonal week: count false positives before/after and confirm real anomalies still fire. Output: the smoothing/forecast expressions, the seasonal-comparison alert rule, the param-tuning method, and a clear note on the limits of this approach.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
PromQL offset & Time-Shifted Comparison Prompt
Build week-over-week and day-over-day PromQL comparisons using offset and @ modifiers to surface regressions, seasonality, and anomalous deviations against a known-good baseline.
-
PromQL predict_linear Capacity Forecasting Prompt
Build predictive PromQL alerts that fire BEFORE disks fill, certificates expire, or quotas exhaust — using predict_linear, deriv, and seasonal-aware windows instead of static thresholds.
-
Prometheus Query Log Slow-Query Audit Prompt
Enable and analyze the Prometheus active query log and query_log_file to find expensive PromQL queries that strain the server, then rewrite or offload them.
-
Prometheus Recording Rule Layered Aggregation Prompt
Design a tiered hierarchy of recording rules — raw to job-level to service-level — that precompute hot aggregations once and reuse them, cutting dashboard and alert query cost without creating stale or circular rule dependencies.
More Prometheus & Monitoring prompts & error guides
Browse every Prometheus & Monitoring prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.