Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
Adding a bit more to the documentation around the query.
Browse files Browse the repository at this point in the history
  • Loading branch information
eciramella-r7 committed Mar 3, 2016
1 parent f2677de commit 6714b95
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ DogWatch.monitor do
## Create a new monitor - monitor name is REQUIRED
monitor 'MONITOR NAME' do
type :metric_alert # REQUIRED: One of [:metric_alert | :service_check | :event_alert]
query 'QUERY' # REQUIRED
query 'time_aggr(time_window):space_aggr:metric{tags} [by {key}] operator' # REQUIRED
message 'MESSAGE'
tags %w(A list of tags to associate with your monitor)

Expand All @@ -54,6 +54,18 @@ DogWatch.monitor do
end
end
```
Queries are the combination of several items including a time aggregator (over a window of time), space aggregator (avg, sum, min, or max), a set of tags and an optional order by, and an operator.

From the Datadog documentation:

```
time_aggr(time_window):space_aggr:metric{tags} [by {key}] operator
```
An example of a query:

```
avg(last_15m):avg:system.disk.used{region:us-east-1,some-tag:some-tag-value,device:/dev/xvdb} by {cluster} * 100 > 55
```

Monitors that already exist are matched by name and updated accordingly. If the name isn't matched exactly, DogWatch assumes you want a new monitor.

Expand Down

0 comments on commit 6714b95

Please sign in to comment.