create an alert for a metric whenever it crosses a monthly threshold

I need to create an alert for a metric to notify me whenever it crosses a monthly threshold.

timeseries total = sum(service.Metric),
from: now()@M,
to: now(),
interval: 24h
| fieldsAdd deposits_cumulative=arrayMovingSum(total,60)

It’s always a hacking job to get anomaly detectors running for large timeframes. You can try overriding the interval field with interval=toDuration(1m), but you will run into different issues.

Two possible workarounds instead of using Anomaly detector:

  • Use a (scheduled) workflow, do the DQL there and send notifications or create an event. It won’t be a simple workflow, so take your workflow cost into account.
  • Use Site Reliability Guardian for it instead. My recommended solution so far. Schedule it to run using a simple workflow. Have OpenPipeline triggering Davis events (so you have alerts) from the Site reliability guardian result data (bizevents). Check this thread where I discussed the same approach.

Thanks a lot,

i try with this solutions, i will reply the results.

thanks again