NrqlAlertCondition
Use this resource to create and manage NRQL alert conditions in New Relic.
NRQL
The nrql block supports the following arguments:
query- (Required) The NRQL query to execute for the condition.evaluation_offset- (Optional) Represented in minutes and must be within 1-20 minutes (inclusive). NRQL queries are evaluated in one-minute time windows. The start time depends on this value. It’s recommended to set this to 3 minutes. An offset of less than 3 minutes will trigger violations sooner, but you may see more false positives and negatives due to data latency. Withevaluation_offsetset to 3 minutes, the NRQL time window applied to your query will be:SINCE 3 minutes ago UNTIL 2 minutes ago.since_value- (Optional) DEPRECATED: Useevaluation_offsetinstead. The value to be used in theSINCE <X> minutes agoclause for the NRQL query. Must be between 1-20 (inclusive).
Terms
NOTE: The direct use of the
termhas been deprecated, and users should usecriticalandwarninginstead. What follows now applies to the named priority attributes forcriticalandwarning, but for those attributes the priority is not allowed.
NRQL alert conditions support up to two terms. At least one term must have priority set to critical and the second optional term must have priority set to warning.
The term block the following arguments:
duration- (Required) In minutes, must be in the range of1to120, inclusive.operator- (Optional)above,below, orequal. Defaults toequal. Note that when using atypeofoutlier, the only valid option here isabove.priority- (Optional)criticalorwarning. Defaults tocritical.threshold- (Required) The value which will trigger a violation. Must be0or greater.threshold_duration- (Optional) The duration of time, in seconds, that the threshold must violate for in order to create a violation. Value must be a multiple of 60.
For baseline NRQL alert conditions, the value must be within 120-3600 seconds (inclusive).
For static NRQL alert conditions, the value must be within 120-7200 seconds (inclusive).threshold_occurrences- (Optional) The criteria for how many data points must be in violation for the specified threshold duration. Valid values are:allorat_least_once(case insensitive).duration- (Optional) DEPRECATED: Usethreshold_durationinstead. The duration of time, in minutes, that the threshold must violate for in order to create a violation. Must be within 1-120 (inclusive).time_function- (Optional) DEPRECATED: Usethreshold_occurrencesinstead. The criteria for how many data points must be in violation for the specified threshold duration. Valid values are:allorany.
Create a NrqlAlertCondition Resource
new NrqlAlertCondition(name: string, args: NrqlAlertConditionArgs, opts?: CustomResourceOptions);def NrqlAlertCondition(resource_name, opts=None, account_id=None, baseline_direction=None, critical=None, description=None, enabled=None, expected_groups=None, ignore_overlap=None, name=None, nrql=None, open_violation_on_group_overlap=None, policy_id=None, runbook_url=None, terms=None, type=None, value_function=None, violation_time_limit=None, violation_time_limit_seconds=None, warning=None, __props__=None);func NewNrqlAlertCondition(ctx *Context, name string, args NrqlAlertConditionArgs, opts ...ResourceOption) (*NrqlAlertCondition, error)public NrqlAlertCondition(string name, NrqlAlertConditionArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args NrqlAlertConditionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args NrqlAlertConditionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args NrqlAlertConditionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
NrqlAlertCondition Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The NrqlAlertCondition resource accepts the following input properties:
- Nrql
Pulumi.
New Relic. Inputs. Nrql Alert Condition Nrql Args A NRQL query.
- Policy
Id int The ID of the policy where this condition should be used.
- Account
Id int The New Relic account ID for managing your NRQL alert conditions.
- Baseline
Direction string The baseline direction of a baseline NRQL alert condition. Valid values are: ‘LOWER_ONLY’, ‘UPPER_AND_LOWER’, ‘UPPER_ONLY’ (case insensitive).
- Critical
Pulumi.
New Relic. Inputs. Nrql Alert Condition Critical Args A condition term with priority set to critical.
- Description string
The description of the NRQL alert condition.
- Enabled bool
Whether or not to enable the alert condition.
- Expected
Groups int Number of expected groups when using outlier detection.
- Ignore
Overlap bool Whether to look for a convergence of groups when using outlier detection.
- Name string
The title of the condition.
- Open
Violation boolOn Group Overlap Whether overlapping groups should produce a violation.
- Runbook
Url string Runbook URL to display in notifications.
- Terms
List<Pulumi.
New Relic. Inputs. Nrql Alert Condition Term Args> A set of terms for this condition. Max 2 terms allowed - at least one 1 critical term and 1 optional warning term.
- Type string
The type of NRQL alert condition to create. Valid values are: ‘static’, ‘outlier’, ‘baseline’.
- Value
Function string Valid values are: ‘single_value’ or ‘sum’
- Violation
Time stringLimit Sets a time limit, in hours, that will automatically force-close a long-lasting violation after the time limit you select. Possible values are ‘ONE_HOUR’, ‘TWO_HOURS’, ‘FOUR_HOURS’, ‘EIGHT_HOURS’, ‘TWELVE_HOURS’, ‘TWENTY_FOUR_HOURS’ (case insensitive).
- Violation
Time intLimit Seconds Sets a time limit, in seconds, that will automatically force-close a long-lasting violation after the time limit you select. Possible values are 3600, 7200, 14400, 28800, 43200, and 86400.
- Warning
Pulumi.
New Relic. Inputs. Nrql Alert Condition Warning Args A condition term with priority set to warning.
- Nrql
Nrql
Alert Condition Nrql A NRQL query.
- Policy
Id int The ID of the policy where this condition should be used.
- Account
Id int The New Relic account ID for managing your NRQL alert conditions.
- Baseline
Direction string The baseline direction of a baseline NRQL alert condition. Valid values are: ‘LOWER_ONLY’, ‘UPPER_AND_LOWER’, ‘UPPER_ONLY’ (case insensitive).
- Critical
Nrql
Alert Condition Critical A condition term with priority set to critical.
- Description string
The description of the NRQL alert condition.
- Enabled bool
Whether or not to enable the alert condition.
- Expected
Groups int Number of expected groups when using outlier detection.
- Ignore
Overlap bool Whether to look for a convergence of groups when using outlier detection.
- Name string
The title of the condition.
- Open
Violation boolOn Group Overlap Whether overlapping groups should produce a violation.
- Runbook
Url string Runbook URL to display in notifications.
- Terms
[]Nrql
Alert Condition Term A set of terms for this condition. Max 2 terms allowed - at least one 1 critical term and 1 optional warning term.
- Type string
The type of NRQL alert condition to create. Valid values are: ‘static’, ‘outlier’, ‘baseline’.
- Value
Function string Valid values are: ‘single_value’ or ‘sum’
- Violation
Time stringLimit Sets a time limit, in hours, that will automatically force-close a long-lasting violation after the time limit you select. Possible values are ‘ONE_HOUR’, ‘TWO_HOURS’, ‘FOUR_HOURS’, ‘EIGHT_HOURS’, ‘TWELVE_HOURS’, ‘TWENTY_FOUR_HOURS’ (case insensitive).
- Violation
Time intLimit Seconds Sets a time limit, in seconds, that will automatically force-close a long-lasting violation after the time limit you select. Possible values are 3600, 7200, 14400, 28800, 43200, and 86400.
- Warning
Nrql
Alert Condition Warning A condition term with priority set to warning.
- nrql
Nrql
Alert Condition Nrql A NRQL query.
- policy
Id number The ID of the policy where this condition should be used.
- account
Id number The New Relic account ID for managing your NRQL alert conditions.
- baseline
Direction string The baseline direction of a baseline NRQL alert condition. Valid values are: ‘LOWER_ONLY’, ‘UPPER_AND_LOWER’, ‘UPPER_ONLY’ (case insensitive).
- critical
Nrql
Alert Condition Critical A condition term with priority set to critical.
- description string
The description of the NRQL alert condition.
- enabled boolean
Whether or not to enable the alert condition.
- expected
Groups number Number of expected groups when using outlier detection.
- ignore
Overlap boolean Whether to look for a convergence of groups when using outlier detection.
- name string
The title of the condition.
- open
Violation booleanOn Group Overlap Whether overlapping groups should produce a violation.
- runbook
Url string Runbook URL to display in notifications.
- terms
Nrql
Alert Condition Term[] A set of terms for this condition. Max 2 terms allowed - at least one 1 critical term and 1 optional warning term.
- type string
The type of NRQL alert condition to create. Valid values are: ‘static’, ‘outlier’, ‘baseline’.
- value
Function string Valid values are: ‘single_value’ or ‘sum’
- violation
Time stringLimit Sets a time limit, in hours, that will automatically force-close a long-lasting violation after the time limit you select. Possible values are ‘ONE_HOUR’, ‘TWO_HOURS’, ‘FOUR_HOURS’, ‘EIGHT_HOURS’, ‘TWELVE_HOURS’, ‘TWENTY_FOUR_HOURS’ (case insensitive).
- violation
Time numberLimit Seconds Sets a time limit, in seconds, that will automatically force-close a long-lasting violation after the time limit you select. Possible values are 3600, 7200, 14400, 28800, 43200, and 86400.
- warning
Nrql
Alert Condition Warning A condition term with priority set to warning.
- nrql
Dict[Nrql
Alert Condition Nrql] A NRQL query.
- policy_
id float The ID of the policy where this condition should be used.
- account_
id float The New Relic account ID for managing your NRQL alert conditions.
- baseline_
direction str The baseline direction of a baseline NRQL alert condition. Valid values are: ‘LOWER_ONLY’, ‘UPPER_AND_LOWER’, ‘UPPER_ONLY’ (case insensitive).
- critical
Dict[Nrql
Alert Condition Critical] A condition term with priority set to critical.
- description str
The description of the NRQL alert condition.
- enabled bool
Whether or not to enable the alert condition.
- expected_
groups float Number of expected groups when using outlier detection.
- ignore_
overlap bool Whether to look for a convergence of groups when using outlier detection.
- name str
The title of the condition.
- open_
violation_ boolon_ group_ overlap Whether overlapping groups should produce a violation.
- runbook_
url str Runbook URL to display in notifications.
- terms
List[Nrql
Alert Condition Term] A set of terms for this condition. Max 2 terms allowed - at least one 1 critical term and 1 optional warning term.
- type str
The type of NRQL alert condition to create. Valid values are: ‘static’, ‘outlier’, ‘baseline’.
- value_
function str Valid values are: ‘single_value’ or ‘sum’
- violation_
time_ strlimit Sets a time limit, in hours, that will automatically force-close a long-lasting violation after the time limit you select. Possible values are ‘ONE_HOUR’, ‘TWO_HOURS’, ‘FOUR_HOURS’, ‘EIGHT_HOURS’, ‘TWELVE_HOURS’, ‘TWENTY_FOUR_HOURS’ (case insensitive).
- violation_
time_ floatlimit_ seconds Sets a time limit, in seconds, that will automatically force-close a long-lasting violation after the time limit you select. Possible values are 3600, 7200, 14400, 28800, 43200, and 86400.
- warning
Dict[Nrql
Alert Condition Warning] A condition term with priority set to warning.
Outputs
All input properties are implicitly available as output properties. Additionally, the NrqlAlertCondition resource produces the following output properties:
Look up an Existing NrqlAlertCondition Resource
Get an existing NrqlAlertCondition resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: NrqlAlertConditionState, opts?: CustomResourceOptions): NrqlAlertConditionstatic get(resource_name, id, opts=None, account_id=None, baseline_direction=None, critical=None, description=None, enabled=None, expected_groups=None, ignore_overlap=None, name=None, nrql=None, open_violation_on_group_overlap=None, policy_id=None, runbook_url=None, terms=None, type=None, value_function=None, violation_time_limit=None, violation_time_limit_seconds=None, warning=None, __props__=None);func GetNrqlAlertCondition(ctx *Context, name string, id IDInput, state *NrqlAlertConditionState, opts ...ResourceOption) (*NrqlAlertCondition, error)public static NrqlAlertCondition Get(string name, Input<string> id, NrqlAlertConditionState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- Account
Id int The New Relic account ID for managing your NRQL alert conditions.
- Baseline
Direction string The baseline direction of a baseline NRQL alert condition. Valid values are: ‘LOWER_ONLY’, ‘UPPER_AND_LOWER’, ‘UPPER_ONLY’ (case insensitive).
- Critical
Pulumi.
New Relic. Inputs. Nrql Alert Condition Critical Args A condition term with priority set to critical.
- Description string
The description of the NRQL alert condition.
- Enabled bool
Whether or not to enable the alert condition.
- Expected
Groups int Number of expected groups when using outlier detection.
- Ignore
Overlap bool Whether to look for a convergence of groups when using outlier detection.
- Name string
The title of the condition.
- Nrql
Pulumi.
New Relic. Inputs. Nrql Alert Condition Nrql Args A NRQL query.
- Open
Violation boolOn Group Overlap Whether overlapping groups should produce a violation.
- Policy
Id int The ID of the policy where this condition should be used.
- Runbook
Url string Runbook URL to display in notifications.
- Terms
List<Pulumi.
New Relic. Inputs. Nrql Alert Condition Term Args> A set of terms for this condition. Max 2 terms allowed - at least one 1 critical term and 1 optional warning term.
- Type string
The type of NRQL alert condition to create. Valid values are: ‘static’, ‘outlier’, ‘baseline’.
- Value
Function string Valid values are: ‘single_value’ or ‘sum’
- Violation
Time stringLimit Sets a time limit, in hours, that will automatically force-close a long-lasting violation after the time limit you select. Possible values are ‘ONE_HOUR’, ‘TWO_HOURS’, ‘FOUR_HOURS’, ‘EIGHT_HOURS’, ‘TWELVE_HOURS’, ‘TWENTY_FOUR_HOURS’ (case insensitive).
- Violation
Time intLimit Seconds Sets a time limit, in seconds, that will automatically force-close a long-lasting violation after the time limit you select. Possible values are 3600, 7200, 14400, 28800, 43200, and 86400.
- Warning
Pulumi.
New Relic. Inputs. Nrql Alert Condition Warning Args A condition term with priority set to warning.
- Account
Id int The New Relic account ID for managing your NRQL alert conditions.
- Baseline
Direction string The baseline direction of a baseline NRQL alert condition. Valid values are: ‘LOWER_ONLY’, ‘UPPER_AND_LOWER’, ‘UPPER_ONLY’ (case insensitive).
- Critical
Nrql
Alert Condition Critical A condition term with priority set to critical.
- Description string
The description of the NRQL alert condition.
- Enabled bool
Whether or not to enable the alert condition.
- Expected
Groups int Number of expected groups when using outlier detection.
- Ignore
Overlap bool Whether to look for a convergence of groups when using outlier detection.
- Name string
The title of the condition.
- Nrql
Nrql
Alert Condition Nrql A NRQL query.
- Open
Violation boolOn Group Overlap Whether overlapping groups should produce a violation.
- Policy
Id int The ID of the policy where this condition should be used.
- Runbook
Url string Runbook URL to display in notifications.
- Terms
[]Nrql
Alert Condition Term A set of terms for this condition. Max 2 terms allowed - at least one 1 critical term and 1 optional warning term.
- Type string
The type of NRQL alert condition to create. Valid values are: ‘static’, ‘outlier’, ‘baseline’.
- Value
Function string Valid values are: ‘single_value’ or ‘sum’
- Violation
Time stringLimit Sets a time limit, in hours, that will automatically force-close a long-lasting violation after the time limit you select. Possible values are ‘ONE_HOUR’, ‘TWO_HOURS’, ‘FOUR_HOURS’, ‘EIGHT_HOURS’, ‘TWELVE_HOURS’, ‘TWENTY_FOUR_HOURS’ (case insensitive).
- Violation
Time intLimit Seconds Sets a time limit, in seconds, that will automatically force-close a long-lasting violation after the time limit you select. Possible values are 3600, 7200, 14400, 28800, 43200, and 86400.
- Warning
Nrql
Alert Condition Warning A condition term with priority set to warning.
- account
Id number The New Relic account ID for managing your NRQL alert conditions.
- baseline
Direction string The baseline direction of a baseline NRQL alert condition. Valid values are: ‘LOWER_ONLY’, ‘UPPER_AND_LOWER’, ‘UPPER_ONLY’ (case insensitive).
- critical
Nrql
Alert Condition Critical A condition term with priority set to critical.
- description string
The description of the NRQL alert condition.
- enabled boolean
Whether or not to enable the alert condition.
- expected
Groups number Number of expected groups when using outlier detection.
- ignore
Overlap boolean Whether to look for a convergence of groups when using outlier detection.
- name string
The title of the condition.
- nrql
Nrql
Alert Condition Nrql A NRQL query.
- open
Violation booleanOn Group Overlap Whether overlapping groups should produce a violation.
- policy
Id number The ID of the policy where this condition should be used.
- runbook
Url string Runbook URL to display in notifications.
- terms
Nrql
Alert Condition Term[] A set of terms for this condition. Max 2 terms allowed - at least one 1 critical term and 1 optional warning term.
- type string
The type of NRQL alert condition to create. Valid values are: ‘static’, ‘outlier’, ‘baseline’.
- value
Function string Valid values are: ‘single_value’ or ‘sum’
- violation
Time stringLimit Sets a time limit, in hours, that will automatically force-close a long-lasting violation after the time limit you select. Possible values are ‘ONE_HOUR’, ‘TWO_HOURS’, ‘FOUR_HOURS’, ‘EIGHT_HOURS’, ‘TWELVE_HOURS’, ‘TWENTY_FOUR_HOURS’ (case insensitive).
- violation
Time numberLimit Seconds Sets a time limit, in seconds, that will automatically force-close a long-lasting violation after the time limit you select. Possible values are 3600, 7200, 14400, 28800, 43200, and 86400.
- warning
Nrql
Alert Condition Warning A condition term with priority set to warning.
- account_
id float The New Relic account ID for managing your NRQL alert conditions.
- baseline_
direction str The baseline direction of a baseline NRQL alert condition. Valid values are: ‘LOWER_ONLY’, ‘UPPER_AND_LOWER’, ‘UPPER_ONLY’ (case insensitive).
- critical
Dict[Nrql
Alert Condition Critical] A condition term with priority set to critical.
- description str
The description of the NRQL alert condition.
- enabled bool
Whether or not to enable the alert condition.
- expected_
groups float Number of expected groups when using outlier detection.
- ignore_
overlap bool Whether to look for a convergence of groups when using outlier detection.
- name str
The title of the condition.
- nrql
Dict[Nrql
Alert Condition Nrql] A NRQL query.
- open_
violation_ boolon_ group_ overlap Whether overlapping groups should produce a violation.
- policy_
id float The ID of the policy where this condition should be used.
- runbook_
url str Runbook URL to display in notifications.
- terms
List[Nrql
Alert Condition Term] A set of terms for this condition. Max 2 terms allowed - at least one 1 critical term and 1 optional warning term.
- type str
The type of NRQL alert condition to create. Valid values are: ‘static’, ‘outlier’, ‘baseline’.
- value_
function str Valid values are: ‘single_value’ or ‘sum’
- violation_
time_ strlimit Sets a time limit, in hours, that will automatically force-close a long-lasting violation after the time limit you select. Possible values are ‘ONE_HOUR’, ‘TWO_HOURS’, ‘FOUR_HOURS’, ‘EIGHT_HOURS’, ‘TWELVE_HOURS’, ‘TWENTY_FOUR_HOURS’ (case insensitive).
- violation_
time_ floatlimit_ seconds Sets a time limit, in seconds, that will automatically force-close a long-lasting violation after the time limit you select. Possible values are 3600, 7200, 14400, 28800, 43200, and 86400.
- warning
Dict[Nrql
Alert Condition Warning] A condition term with priority set to warning.
Supporting Types
NrqlAlertConditionCritical
NrqlAlertConditionNrql
NrqlAlertConditionTerm
NrqlAlertConditionWarning
Package Details
- Repository
- https://github.com/pulumi/pulumi-newrelic
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
newrelicTerraform Provider.