Skip to content

Commit 50661e9

Browse files
author
Ashish Gaurav
committed
[SLOs] fix spacing and examples in slo docs
Took 8 minutes
1 parent 51bf685 commit 50661e9

File tree

1 file changed

+95
-48
lines changed

1 file changed

+95
-48
lines changed

website/docs/r/slo.html.markdown

Lines changed: 95 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ Provides the ability to create, read, delete, and update [SLOs][1].
1010
## Example SLO
1111

1212
```hcl
13-
resource "sumologic_slo" "slo_tf_test" {
14-
name = "slo-tf-test1"
13+
resource "sumologic_slo" "slo_tf_window_based" {
14+
name = "slo-tf-window-based"
1515
description = "example SLO created with terraform"
1616
parent_id = "0000000000000001"
1717
signal_type = "Latency"
@@ -24,19 +24,58 @@ resource "sumologic_slo" "slo_tf_test" {
2424
timezone = "Asia/Kolkata"
2525
}
2626
indicator {
27-
evaluation_type = "Window"
28-
op = "LessThan"
29-
query_type = "Metrics"
30-
size = "1m"
31-
threshold = 200
32-
queries {
33-
query_group_type = "Threshold"
34-
query_group {
35-
row_id = "A"
36-
query = "metric=request_time_p90 service=auth api=login"
27+
window_based_evaluation {
28+
op = "LessThan"
29+
query_type = "Metrics"
30+
size = "1m"
31+
threshold = 200
32+
queries {
33+
query_group_type = "Threshold"
34+
query_group {
35+
row_id = "A"
36+
query = "metric=request_time_p90 service=auth api=login"
37+
use_row_count = false
38+
}
3739
}
3840
}
41+
}
42+
}
3943
44+
resource "sumologic_slo" "slo_tf_request_based" {
45+
name = "slo-tf-request-based"
46+
description = "example SLO created with terraform for request based SLI"
47+
parent_id = sumologic_slo_folder.tf_slo_folder.id
48+
signal_type = "Latency"
49+
service = "auth"
50+
application = "login"
51+
compliance {
52+
compliance_type = "Rolling"
53+
size = "7d"
54+
target = 99
55+
timezone = "Asia/Kolkata"
56+
}
57+
indicator {
58+
request_based_evaluation {
59+
op = "LessThanOrEqual"
60+
query_type = "Logs"
61+
threshold = 1
62+
queries {
63+
query_group_type = "Threshold"
64+
query_group {
65+
row_id = "A"
66+
query = <<QUERY
67+
cluster=sedemostaging namespace=warp004*
68+
| parse "Coffee preparation request time: * ms" as latency nodrop
69+
| if(isBlank(latency), "false", "true") as hasLatency
70+
| where hasLatency = "true"
71+
| if(isBlank(latency), 0.0, latency) as latency
72+
| latency/ 1000 as latency_sec
73+
QUERY
74+
use_row_count = true
75+
field = "latency_sec"
76+
}
77+
}
78+
}
4079
}
4180
}
4281
```
@@ -48,7 +87,7 @@ The following arguments are supported:
4887
- `name` - (Required) The name of the SLO. The name must be alphanumeric.
4988
- `description` - (Optional) The description of the SLO.
5089
- `parent_id` - (Optional) The ID of the SLO Folder that contains this SLO. Defaults to the root folder.
51-
- `signal_type` - (Required) The type of SLO. Valid values are `Latency`, `Error`,`Throughput`,`Availability`
90+
- `signal_type` - (Required) The type of SLO. Valid values are `Latency`, `Error`, `Throughput`, `Availability`
5291
, `Other`. Defaults to `Latency`.
5392
- `service` - (Optional) The notifications the SLO will send when the respective trigger condition is met.
5493
- `application` - (Optional) Whether to group notifications for individual items that meet the trigger condition.
@@ -57,47 +96,55 @@ The following arguments are supported:
5796
- `compliance_type` - (Required) The type of compliance to use. Valid values are `Rolling` or `Calendar`.
5897
- `target` - (Required) The target value to use, must be a number between 0 and 100.
5998
- `timezone` - (Required) Time zone for the SLO compliance. Follow the format in the [IANA Time Zone Database][3].
60-
- `size` - (Required) The size of the compliance period to use.
61-
For `Calendar` compliance type the allowed values are `Week`, `Month`, `Quarter`.
62-
- `start_from` - (Optional) Start of the calendar window. For week, it would be the day of the week (for e.g Sunday, Monday etc). For month, it will always be the first day of the month. For quarter, it would be the first month of the quarter (for e.g January, February etc.)
63-
- `indicator` - (Required) The service level indicator on which SLO is to be defined. more details on the difference b/w them can be found on the [slo help page](https://help.sumologic.com/Beta/SLO_Reliability_Management/Access_and_Create_SLOs)
64-
- [window_based_evaluation](#window_based_evaluation) - Evaluate SLI using successful/total windows.
65-
- [request_based_evaluation](#request_based_evaluation) - Evaluate SLI based on occurrence's of successful events / total events over entire compliance period.
99+
- `size` - (Required) The size of the compliance period to use.
100+
For `Calendar` compliance type the allowed values are `Week`, `Month`, `Quarter`.
101+
- `start_from` - (Optional) Start of the calendar window. For week, it would be the day of the week (for e.g Sunday,
102+
Monday etc). For month, it will always be the first day of the month. For quarter, it would be the first month of
103+
the quarter (for e.g January, February etc.)
104+
- `indicator` - (Required) The service level indicator on which SLO is to be defined. more details on the difference
105+
b/w them can be found on
106+
the [slo help page](https://help.sumologic.com/Beta/SLO_Reliability_Management/Access_and_Create_SLOs)
107+
- [window_based_evaluation](#window_based_evaluation) - Evaluate SLI using successful/total windows.
108+
- [request_based_evaluation](#request_based_evaluation) - Evaluate SLI based on occurrence's of successful
109+
events / total events over entire compliance period.
66110

67111
#### window_based_evaluation
68112

69-
- `size` - (Required) The size of the window to use, minimum of `1m` and maximum of `1h`. Only applicable for Window based evaluation.
70-
- `query_type` - (Required) The type of query to use. Valid values are `Metrics` or `Logs`.
71-
- `threshold` - (Required) Threshold for classifying window as successful or unsuccessful, i.e. the minimum value for `good windows / total events`.
72-
- `op` - (Required) The operator used to define a successful window or event. Valid values are `LessThan`, `LessThanOrEqual`, `GreaterThan`
73-
, `GreaterThanOrEqual`.
74-
- `aggregation` - (Optional) Aggregation function applied over each window to arrive at SLI. Valid values are `Avg`
75-
, `Sum`, `Count`, `Max`, `Min` and `p[1-99]`.
76-
- `queries` - (Required) The queries to use.
77-
- `query_group_type` - (Required) The type of query. Valid values are `Successful`, `Unsuccessful`, `Total`
78-
, `Threshold`.
79-
- `query_group` - (Required) List of queries to use.
80-
- `row_id` - (Required) The row ID to use.
81-
- `query` - (Required) The query string to use.
82-
- `use_row_count` - (Required) Whether to use the row count. Defaults to false.
83-
- `field` - (Optional) Field of log query output to compare against. To be used only for logs based data
84-
type when `use_row_count` is false.
113+
- `size` - (Required) The size of the window to use, minimum of `1m` and maximum of `1h`. Only applicable for Window
114+
based evaluation.
115+
- `query_type` - (Required) The type of query to use. Valid values are `Metrics` or `Logs`.
116+
- `threshold` - (Required) Threshold for classifying window as successful or unsuccessful, i.e. the minimum value
117+
for `good windows / total events`.
118+
- `op` - (Required) The operator used to define a successful window or event. Valid values are `LessThan`
119+
, `LessThanOrEqual`, `GreaterThan`
120+
, `GreaterThanOrEqual`.
121+
- `aggregation` - (Optional) Aggregation function applied over each window to arrive at SLI. Valid values are `Avg`
122+
, `Sum`, `Count`, `Max`, `Min` and `p[1-99]`.
123+
- `queries` - (Required) The queries to use.
124+
- `query_group_type` - (Required) The type of query. Valid values are `Successful`, `Unsuccessful`, `Total`
125+
, `Threshold`.
126+
- `query_group` - (Required) List of queries to use.
127+
- `row_id` - (Required) The row ID to use.
128+
- `query` - (Required) The query string to use.
129+
- `use_row_count` - (Required) Whether to use the row count. Defaults to false.
130+
- `field` - (Optional) Field of log query output to compare against. To be used only for logs based data
131+
type when `use_row_count` is false.
85132

86133
#### request_based_evaluation
87134

88-
- `query_type` - (Required) The type of query to use. Valid values are `Metrics` or `Logs`.
89-
- `threshold` - (Required) Compared against threshold query's raw data points to determine success criteria.
90-
- `op` - (Required) Comparison function with threshold. Valid values are `LessThan`, `LessThanOrEqual`, `GreaterThan`
91-
, `GreaterThanOrEqual`.
92-
- `queries` - (Required) The queries to use.
93-
- `query_group_type` - (Required) The type of query. Valid values are `Successful`, `Unsuccessful`, `Total`
94-
, `Threshold`.
95-
- `query_group` - (Required) List of queries to use.
96-
- `row_id` - (Required) The row ID to use.
97-
- `query` - (Required) The query string to use.
98-
- `use_row_count` - (Required) Whether to use the row count. Defaults to false.
99-
- `field` - (Optional) Field of log query output to compare against. To be used only for logs based data
100-
type when `use_row_count` is false.
135+
- `query_type` - (Required) The type of query to use. Valid values are `Metrics` or `Logs`.
136+
- `threshold` - (Required) Compared against threshold query's raw data points to determine success criteria.
137+
- `op` - (Required) Comparison function with threshold. Valid values are `LessThan`, `LessThanOrEqual`, `GreaterThan`
138+
, `GreaterThanOrEqual`.
139+
- `queries` - (Required) The queries to use.
140+
- `query_group_type` - (Required) The type of query. Valid values are `Successful`, `Unsuccessful`, `Total`
141+
, `Threshold`.
142+
- `query_group` - (Required) List of queries to use.
143+
- `row_id` - (Required) The row ID to use.
144+
- `query` - (Required) The query string to use.
145+
- `use_row_count` - (Required) Whether to use the row count. Defaults to false.
146+
- `field` - (Optional) Field of log query output to compare against. To be used only for logs based data
147+
type when `use_row_count` is false.
101148

102149
[1]: https://help.sumologic.com/Beta/SLO_Reliability_Management
103150

0 commit comments

Comments
 (0)