Repository navigation
Document relative monitor thresholds in Preview - #41749
phillip-dd wants to merge 5 commits into
Conversation
Co-authored-by: phillip-dd <59581508+phillip-dd@users.noreply.github.com>
Co-authored-by: phillip-dd <59581508+phillip-dd@users.noreply.github.com>
Co-authored-by: phillip-dd <59581508+phillip-dd@users.noreply.github.com>
Co-authored-by: phillip-dd <59581508+phillip-dd@users.noreply.github.com>
| 3. In the alert conditions, select a relative threshold. | ||
| 4. Select the historical aggregation and lookback window. | ||
| 5. Set a multiplier that determines how much the current value can deviate from the historical baseline. | ||
| 6. Configure the alert direction and, optionally, a recovery threshold. |
There was a problem hiding this comment.
technically in the UI you can't select a direction (I assume this means like 'above' or 'below'?), it's implicit from the multiplier
| formula("query1").rollup("avg").last("5m") > threshold | ||
| ``` | ||
|
|
||
| The historical threshold is defined in `options.thresholds.critical_query`: |
There was a problem hiding this comment.
is it worth saying here the critical recovery query is exactly the same
|
generally lgtm! so I guess we're not going to say anything about the new syntax, and only say we support the .multiplier() syntax for now? |
For now, yup, limited to .multiplier syntax. |
Co-authored-by: phillip-dd <59581508+phillip-dd@users.noreply.github.com>
|
/review |
There was a problem hiding this comment.
🤖 Automated review by Claude. AI-generated; verify before acting.
I found no blockers. There are 5 comments:
- Missing step: the steps in the new relative thresholds guide never tell the reader to choose the alert direction.
- Unclear step: the final configuration step doesn't say where in the editor the calculated thresholds appear.
- Style (2): two cross-page section links don't name the page they point to.
- Style (1): one section opens with "This" without naming the subject.
I checked the links in the new guide, the reference definitions inside the tabs on the monitor configuration page and the metric monitor page, and the further-reading entries. They all resolve, and each definition sits inside the correct tab. The new page is in a guide folder, so it doesn't need a menu entry.
Reviewed 7781899450a7a46eb3a3cabe35d30e76d649a79e — workflow run
|
|
||
| 1. Create or edit a [metric monitor][1]. | ||
| 2. Define the metric and its evaluation window. | ||
| 3. In the alert conditions, select a relative threshold. |
There was a problem hiding this comment.
Suggestion: None of these steps tells the reader to choose the alert direction. The example on line 71 depends on it ("choose the below direction to detect a drop"), and the monitor configuration page includes it in step 1 ("Select a relative threshold and choose the alert direction"). A reader who follows only this list may leave the default direction and miss drops.
| 3. In the alert conditions, select a relative threshold. | |
| 3. In the alert conditions, select a relative threshold and choose the alert direction, such as above or below. |
| 4. Select the threshold aggregation and lookback window. | ||
| 5. Set a multiplier that determines how much the current value can deviate from the historical baseline. This can be smaller than one (less than the baseline) or larger than one (greater than the baseline). | ||
| 6. Optionally, configure a recovery threshold. | ||
| 7. Review the resulting thresholds and monitor behavior before saving. |
There was a problem hiding this comment.
Suggestion: A reader may not know where to find "the resulting thresholds" before saving. Does the editor show the calculated threshold for each group, for example in the preview graph? If so, name where it appears so the reader has a clear way to check the setup before saving.
|
|
||
| **Historical thresholds are recalculated daily at midnight UTC.** The calculated threshold remains constant between updates, while the monitor continues evaluating current metric values at its configured evaluation frequency. | ||
|
|
||
| This provides a stable baseline that adjusts to longer-term changes without reacting immediately to every short-term fluctuation. |
There was a problem hiding this comment.
Style: This paragraph starts with "This" without naming the subject. If an AI tool or search result shows the paragraph alone, the reader can't tell what "This" means. Line 57 ("This allows a single monitor...") has the same pattern.
| This provides a stable baseline that adjusts to longer-term changes without reacting immediately to every short-term fluctuation. | |
| The daily recalculation provides a stable baseline that adjusts to longer-term changes without reacting immediately to every short-term fluctuation. |
| 2. Select a historical aggregation and a lookback window from 1 week to 6 months. The historical window must be at least as long as the monitor's evaluation window. | ||
| 3. Set the multiplier and, optionally, a critical recovery threshold. For example, alert above `1.5x` the historical average and recover at or below `1.2x` that average. | ||
|
|
||
| The evaluation and historical aggregations can differ, including percentile and average aggregations for distribution metrics. With a `p95:` metric variable, `.rollup("percentile")` calculates the p95 across the window's distribution data, while `.rollup("avg")` averages the p95 timeseries values. See [Percentile queries][8] for examples. |
There was a problem hiding this comment.
Style: This link goes to a section on another page, so the link text needs to name that page. Without the page name, readers expect a section on the page they're reading.
| The evaluation and historical aggregations can differ, including percentile and average aggregations for distribution metrics. With a `p95:` metric variable, `.rollup("percentile")` calculates the p95 across the window's distribution data, while `.rollup("avg")` averages the p95 timeseries values. See [Percentile queries][8] for examples. | |
| The evaluation and historical aggregations can differ, including percentile and average aggregations for distribution metrics. With a `p95:` metric variable, `.rollup("percentile")` calculates the p95 across the window's distribution data, while `.rollup("avg")` averages the p95 timeseries values. For examples, see the [Percentile queries][8] section of the Relative Thresholds guide. |
|
|
||
| For example, alert when the average job duration over five minutes exceeds `1.5x` its average over the last week. | ||
|
|
||
| The current value and historical baseline can use different aggregations. For distribution metrics, compare a percentile to a historical percentile or to a historical average. With a `p95:` metric variable, an `avg` rollup averages the p95 timeseries values. See [Percentile queries][7] for all three comparison examples. |
There was a problem hiding this comment.
Style: This link goes to a section on another page, so the link text needs to name that page.
| The current value and historical baseline can use different aggregations. For distribution metrics, compare a percentile to a historical percentile or to a historical average. With a `p95:` metric variable, an `avg` rollup averages the p95 timeseries values. See [Percentile queries][7] for all three comparison examples. | |
| The current value and historical baseline can use different aggregations. For distribution metrics, compare a percentile to a historical percentile or to a historical average. With a `p95:` metric variable, an `avg` rollup averages the p95 timeseries values. For all three comparison examples, see the [Percentile queries][7] section of the Relative Thresholds guide. |
What does this PR do? What is the motivation?
Document relative thresholds as a Preview feature so users can configure alerts against historical baselines. Add a standalone guide covering daily baseline updates, grouping,
.multiplier(...)syntax, critical recovery thresholds, limitations, and use cases. Update monitor configuration, the non-static thresholds guide, metric monitor documentation, and the monitor guide index to link to it. Use multiplier notation such as1.5xfor relative thresholds, explain multipliers below and above one, and clarify that alert and recovery queries use the same syntax.Explain how a distribution metric's percentile selection interacts with each window's aggregation. Include examples for percentile versus percentile, percentile versus average, and average versus percentile, distinguishing a percentile across a window from an average of p95 timeseries values.
Merge readiness
AI assistance
Used Bits Code to incorporate the supplied guide and percentile examples, update related documentation, and validate style, examples, and links.
For Datadog employees:
<name>/<description>convention and include the forward slash (/). If you've already created your PR with an incorrect branch name, please rename your branch and open a fresh PR./reviewto run an automated check that catches common issues before a Documentation team member reviews your PR.Additional notes
The standalone guide passes Vale with no findings, and repository content checks pass. Earlier validation found no Vale findings on changed lines across the other pages and checked front matter, four JSON examples, all three percentile query combinations, added link targets and anchors, and tab structure.
A full Hugo build was not run, and the monitor API examples were not exercised against a live API.
PR by Bits - View session in Datadog • Open in Slack
Comment @DataDog to request changes