Skip to content

Commit 6e3ace2

Browse files
authored
Merge pull request #206 from tosuke/docs-query-monitor
Add docs for monitors with a query
2 parents b0dd57b + 401b74c commit 6e3ace2

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

docs/data-sources/monitor.md

+6
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ data "mackerel_monitor" "this" {
6868
* `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.
6969
* `warning` - The threshold that generates a warning alert.
7070
* `critical` - The threshold that generates a critical alert.
71+
* `query` - The settings for the monitor of query monitoring.
72+
* `query` - The PromQL-style query.
73+
* `legend` - The query legend.
74+
* `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.
75+
* `warning` - The threshold that generates a warning alert.
76+
* `critical` - The threshold that generates a critical alert.
7177
* `anomaly_detection` - The settings for the monitor of Anomaly Detection for roles.
7278
* `scopes` - Expression of the monitoring target. Only valid for graph sequences that become one line.
7379
* `warning_sensitivity` - The sensitivity to generates warning alerts.

docs/resources/monitor.md

+24
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,22 @@ resource "mackerel_monitor" "role_avg" {
9393
}
9494
```
9595

96+
### query
97+
98+
```terraform
99+
resource "mackerel_monitor" "httpbin_load" {
100+
name = "httpbin load per node"
101+
102+
query {
103+
query = "sum by (k8s.node.name) (container.cpu.utilization{k8s.deployment.name=\"httpbin\"})"
104+
legend = "cpu.utilization {{k8s.node.name}}"
105+
operator = ">"
106+
warning = "0.7"
107+
critical = "0.9"
108+
}
109+
}
110+
```
111+
96112
### anomaly_detection
97113

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

189+
### query
190+
191+
* `query` - (Required) The PromQL-style query.
192+
* `legend` - The query legend.
193+
* `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 `<`.
194+
* `warning` - (Required, at least one of `warning` or `critical`) The threshold that generates a warning alert.
195+
* `critical` - (Required, at least one of `warning` or `critical`) The threshold that generates a critical alert.
196+
173197
### anomaly_detection
174198

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

0 commit comments

Comments
 (0)