Skip to content

Commit

Permalink
Merge pull request #206 from tosuke/docs-query-monitor
Browse files Browse the repository at this point in the history
Add docs for monitors with a query
  • Loading branch information
azukiazusa1 committed May 23, 2024
2 parents b0dd57b + 401b74c commit 6e3ace2
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/data-sources/monitor.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ data "mackerel_monitor" "this" {
* `operator` - The comparison operator to determines the conditions that state whether the designated variable is either big or small. The observed value is on the left of the operator and the designated value is on the right.
* `warning` - The threshold that generates a warning alert.
* `critical` - The threshold that generates a critical alert.
* `query` - The settings for the monitor of query monitoring.
* `query` - The PromQL-style query.
* `legend` - The query legend.
* `operator` - The comparison operator to determines the conditions that state whether the designated variable is either big or small. The observed value is on the left of the operator and the designated value is on the right.
* `warning` - The threshold that generates a warning alert.
* `critical` - The threshold that generates a critical alert.
* `anomaly_detection` - The settings for the monitor of Anomaly Detection for roles.
* `scopes` - Expression of the monitoring target. Only valid for graph sequences that become one line.
* `warning_sensitivity` - The sensitivity to generates warning alerts.
Expand Down
24 changes: 24 additions & 0 deletions docs/resources/monitor.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,22 @@ resource "mackerel_monitor" "role_avg" {
}
```

### query

```terraform
resource "mackerel_monitor" "httpbin_load" {
name = "httpbin load per node"
query {
query = "sum by (k8s.node.name) (container.cpu.utilization{k8s.deployment.name=\"httpbin\"})"
legend = "cpu.utilization {{k8s.node.name}}"
operator = ">"
warning = "0.7"
critical = "0.9"
}
}
```

### anomaly_detection

```terraform
Expand Down Expand Up @@ -170,6 +186,14 @@ The following arguments are required:
* `warning` - (Required, at least one of `warning` or `critical`) The threshold that generates a warning alert.
* `critical` - (Required, at least one of `warning` or `critical`) The threshold that generates a critical alert.

### query

* `query` - (Required) The PromQL-style query.
* `legend` - The query legend.
* `operator` - (Required) The comparison operator to determines the conditions that state whether the designated variable is either big or small. The observed value is on the left of the operator and the designated value is on the right. Valid values are `>` and `<`.
* `warning` - (Required, at least one of `warning` or `critical`) The threshold that generates a warning alert.
* `critical` - (Required, at least one of `warning` or `critical`) The threshold that generates a critical alert.

### anomaly_detection

* `scopes` - (Required) Expression of the monitoring target. Only valid for graph sequences that become one line.
Expand Down

0 comments on commit 6e3ace2

Please sign in to comment.