Skip to main content
As explained in the alert configuration documentation, you can create detection pipelines that form DAGs with execution dependencies. In this example, we use the percentage rule detector, which requires 2 inputs: baseline and current. The pipeline looks like this: Here is the corresponding configuration:
percentage_rule_alert.json Notice the pipeline has two DataFetcher nodes:
  • baselineDataFetcher, which has an output called baselineOutput
  • currentDataFetcher, which has an output called currentOutput
These outputs are then fed to the anomaly detector:
  • baselineOutput goes into the baseline property of the detector
  • currentOutput goes into the current property of the detector
If baseline and current properties were not given, the detector would fail.

About the baseline

To ensure the baseline timeframe is correctly computed based on the analysis timeframe,we’ll look at the SQL queries:
  • currentDataFetcher uses the macro where __timeFilter(\"${timeColumn}\", '${timeColumnFormat}'): the macro automatically filters on the analysis timeframe.
  • baselineDataFetcher uses the same macro, with an offset: where __timeFilter(\"${timeColumn}\", '${timeColumnFormat}', ${lookback}, ${lookback}), with offset=P1W.
  • P1W means one week. This means the baseline is one week before the analysis timeframe.