Skip to content

Commit

Permalink
docs: add documentation for the cdf functionality in Service Levels
Browse files Browse the repository at this point in the history
  • Loading branch information
NilVentosa authored and Nandu-pns committed Aug 11, 2023
1 parent 7b4210b commit 98c1ecb
Showing 1 changed file with 51 additions and 3 deletions.
54 changes: 51 additions & 3 deletions website/docs/r/service_level.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,24 @@ All nested `events` blocks support the following common arguments:
* `where` - (Optional) A filter that specifies all the NRDB events that are considered in this SLI (e.g, those that refer to a particular entity).
* `select` - (Optional) The NRQL SELECT clause to aggregate events.
* `attribute` - (Optional) The event attribute to use in the SELECT clause.
* `function` - (Required) The function to use in the SELECT clause. Valid values are `COUNT` and `SUM`.
* `function` - (Required) The function to use in the SELECT clause. Valid values are `COUNT`, `SUM`, `GET_FIELD`, and `GET_CDF_COUNT`.
* `threshold` - (Optional) Limit for values to be counter by `GET_CDF_COUNT` function.
* `good_events` - (Optional) The definition of good responses. If you define an SLI from valid and good events, you must leave the bad events argument empty.
* `from` - (Required) The event type where NRDB data will be fetched from.
* `where` - (Optional) A filter that narrows down the NRDB events just to those that are considered good responses (e.g, those that refer to
a particular entity and were successful).
* `select` - (Optional) The NRQL SELECT clause to aggregate events.
* `attribute` - (Optional) The event attribute to use in the SELECT clause.
* `function` - (Required) The function to use in the SELECT clause. Valid values are `COUNT` and `SUM`.
* `function` - (Required) The function to use in the SELECT clause. Valid values are `COUNT`, `SUM`, `GET_FIELD`, and `GET_CDF_COUNT`.
* `threshold` - (Optional) Limit for values to be counter by `GET_CDF_COUNT` function.
* `bad_events` - (Optional) The definition of the bad responses. If you define an SLI from valid and bad events, you must leave the good events argument empty.
* `from` - (Required) The event type where NRDB data will be fetched from.
* `where` - (Optional) A filter that narrows down the NRDB events just to those that are considered bad responses (e.g, those that refer to
a particular entity and returned an error).
* `select` - (Optional) The NRQL SELECT clause to aggregate events.
* `attribute` - (Optional) The event attribute to use in the SELECT clause.
* `function` - (Required) The function to use in the SELECT clause. Valid values are `COUNT` and `SUM`.
* `function` - (Required) The function to use in the SELECT clause. Valid values are `COUNT`, `SUM`, `GET_FIELD`, and `GET_CDF_COUNT`.
* `threshold` - (Optional) Limit for values to be counter by `GET_CDF_COUNT` function.

### Objective

Expand Down Expand Up @@ -151,6 +154,51 @@ resource "newrelic_entity_tags" "my_synthetic_monitor_service_level_tags" {
}
}
```


Using `select` for events

```hcl
resource "newrelic_service_level" "my_synthetic_monitor_duration_service_level" {
guid = "MXxBUE18QVBQTElDQVRJT058MQ"
name = "Duration distribution is under 7"
description = "Monitor created to test concurrent request from terraform"
events {
account_id = 313870
valid_events {
from = "Metric"
select {
attribute = "`query.wallClockTime.negative.distribution`"
function = "GET_FIELD"
}
where = "metricName = 'query.wallClockTime.negative.distribution'"
}
good_events {
from = "Metric"
select {
attribute = "`query.wallClockTime.negative.distribution`"
function = "GET_CDF_COUNT"
threshold = 7
}
where = "metricName = 'query.wallClockTime.negative.distribution'"
}
}
objective {
target = 49
time_window {
rolling {
count = 7
unit = "DAY"
}
}
}
}
```


For up-to-date documentation about the tagging resource, please check [newrelic_entity_tags](entity_tags.html#example-usage)

## Import
Expand Down

0 comments on commit 98c1ecb

Please sign in to comment.