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. With evaluation_offset set to 3 minutes, the NRQL time window applied to your query will be: SINCE 3 minutes ago UNTIL 2 minutes ago.
    ***Note**: One of evaluation_offset _or_ since_value must be set, but not both.

  • since_value - (Optional*) **DEPRECATED:** Use evaluation_offset instead. The value to be used in the SINCE <X> minutes ago clause for the NRQL query. Must be between 1-20 (inclusive).
    ***Note**: One of evaluation_offset _or_ since_value must be set, but not both.

Terms

NOTE: The direct use of the term has been deprecated, and users should use critical and warning instead. What follows now applies to the named priority attributes for critical and warning, 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:

  • operator - (Optional) Valid values are above, below, or equals (case insensitive). Defaults to equals. Note that when using a type of outlier, the only valid option here is above.

  • priority - (Optional) critical or warning. Defaults to critical.

  • threshold - (Required) The value which will trigger a violation. Must be 0 or greater.

  • threshold_duration - (Optional) The duration, in seconds, that the threshold must violate in order to create a violation. Value must be a multiple of the aggregation_window (which has a default of 60 seconds).
    For baseline and outlier NRQL alert conditions, the value must be within 120-3600 seconds (inclusive).
    For static NRQL alert conditions with the sum value function, the value must be within 120-7200 seconds (inclusive).
    For static NRQL alert conditions with the single_value value function, the value must be within 60-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: all or at_least_once (case insensitive).

  • duration - (Optional) DEPRECATED: Use threshold_duration instead. 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: Use threshold_occurrences instead. The criteria for how many data points must be in violation for the specified threshold duration. Valid values are: all or any.

Create a NrqlAlertCondition Resource

new NrqlAlertCondition(name: string, args: NrqlAlertConditionArgs, opts?: CustomResourceOptions);
@overload
def NrqlAlertCondition(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       account_id: Optional[int] = None,
                       aggregation_window: Optional[int] = None,
                       baseline_direction: Optional[str] = None,
                       close_violations_on_expiration: Optional[bool] = None,
                       critical: Optional[NrqlAlertConditionCriticalArgs] = None,
                       description: Optional[str] = None,
                       enabled: Optional[bool] = None,
                       expected_groups: Optional[int] = None,
                       expiration_duration: Optional[int] = None,
                       fill_option: Optional[str] = None,
                       fill_value: Optional[float] = None,
                       ignore_overlap: Optional[bool] = None,
                       name: Optional[str] = None,
                       nrql: Optional[NrqlAlertConditionNrqlArgs] = None,
                       open_violation_on_expiration: Optional[bool] = None,
                       open_violation_on_group_overlap: Optional[bool] = None,
                       policy_id: Optional[int] = None,
                       runbook_url: Optional[str] = None,
                       terms: Optional[Sequence[NrqlAlertConditionTermArgs]] = None,
                       type: Optional[str] = None,
                       value_function: Optional[str] = None,
                       violation_time_limit: Optional[str] = None,
                       violation_time_limit_seconds: Optional[int] = None,
                       warning: Optional[NrqlAlertConditionWarningArgs] = None)
@overload
def NrqlAlertCondition(resource_name: str,
                       args: NrqlAlertConditionArgs,
                       opts: Optional[ResourceOptions] = 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.
args NrqlAlertConditionArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control 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.NewRelic.Inputs.NrqlAlertConditionNrqlArgs
A NRQL query. See NRQL below for details.
PolicyId int
The ID of the policy where this condition should be used.
AccountId int
The New Relic account ID of the account you wish to create the condition. Defaults to the account ID set in your environment variable NEW_RELIC_ACCOUNT_ID.
AggregationWindow int
The duration of the time window used to evaluate the NRQL query, in seconds. The value must be at least 30 seconds, and no more than 15 minutes (900 seconds). Default is 60 seconds.
BaselineDirection string
The baseline direction of a baseline NRQL alert condition. Valid values are: lower_only, upper_and_lower, upper_only (case insensitive).
CloseViolationsOnExpiration bool
Whether to close all open violations when the signal expires.
Critical Pulumi.NewRelic.Inputs.NrqlAlertConditionCriticalArgs
A list containing the critical threshold values. See Terms below for details.
Description string
The description of the NRQL alert condition.
Enabled bool
Whether to enable the alert condition. Valid values are true and false. Defaults to true.
ExpectedGroups int
Number of expected groups when using outlier detection.
ExpirationDuration int
The amount of time (in seconds) to wait before considering the signal expired.
FillOption string
Which strategy to use when filling gaps in the signal. Possible values are none, last_value or static. If static, the fill_value field will be used for filling gaps in the signal.
FillValue double
This value will be used for filling gaps in the signal.
IgnoreOverlap bool
DEPRECATED: Use open_violation_on_group_overlap instead, but use the inverse value of your boolean - e.g. if ignore_overlap = false, use open_violation_on_group_overlap = true. This argument sets whether to trigger a violation when groups overlap. If set to true overlapping groups will not trigger a violation. This argument is only applicable in outlier conditions.

Deprecated: use open_violation_on_group_overlap attribute instead, but use the inverse of your boolean - e.g. if ignore_overlap = false, use open_violation_on_group_overlap = true

Name string
The title of the condition.
OpenViolationOnExpiration bool
Whether to create a new violation to capture that the signal expired.
OpenViolationOnGroupOverlap bool
Whether or not to trigger a violation when groups overlap. Set to true if you want to trigger a violation when groups overlap. This argument is only applicable in outlier conditions.
RunbookUrl string
Runbook URL to display in notifications.
Terms List<Pulumi.NewRelic.Inputs.NrqlAlertConditionTermArgs>
DEPRECATED Use critical, and warning instead. A list of terms for this condition. See Terms below for details.

Deprecated: use critical and warning attributes instead

Type string
The type of the condition. Valid values are static, baseline, or outlier. Defaults to static.
ValueFunction string
Possible values are single_value, sum (case insensitive).
ViolationTimeLimit string
DEPRECATED: Use violation_time_limit_seconds instead. 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, THIRTY_DAYS (case insensitive).
*Note: One of violation_time_limit or violation_time_limit_seconds must be set, but not both.

Deprecated: use violation_time_limit_seconds attribute instead

ViolationTimeLimitSeconds int
Sets a time limit, in seconds, that will automatically force-close a long-lasting violation after the time limit you select. The value must be between 300 seconds (5 minutes) to 2592000 seconds (30 days) (inclusive).
*Note: One of violation_time_limit or violation_time_limit_seconds must be set, but not both.
Warning Pulumi.NewRelic.Inputs.NrqlAlertConditionWarningArgs
A list containing the warning threshold values. See Terms below for details.
Nrql NrqlAlertConditionNrql
A NRQL query. See NRQL below for details.
PolicyId int
The ID of the policy where this condition should be used.
AccountId int
The New Relic account ID of the account you wish to create the condition. Defaults to the account ID set in your environment variable NEW_RELIC_ACCOUNT_ID.
AggregationWindow int
The duration of the time window used to evaluate the NRQL query, in seconds. The value must be at least 30 seconds, and no more than 15 minutes (900 seconds). Default is 60 seconds.
BaselineDirection string
The baseline direction of a baseline NRQL alert condition. Valid values are: lower_only, upper_and_lower, upper_only (case insensitive).
CloseViolationsOnExpiration bool
Whether to close all open violations when the signal expires.
Critical NrqlAlertConditionCritical
A list containing the critical threshold values. See Terms below for details.
Description string
The description of the NRQL alert condition.
Enabled bool
Whether to enable the alert condition. Valid values are true and false. Defaults to true.
ExpectedGroups int
Number of expected groups when using outlier detection.
ExpirationDuration int
The amount of time (in seconds) to wait before considering the signal expired.
FillOption string
Which strategy to use when filling gaps in the signal. Possible values are none, last_value or static. If static, the fill_value field will be used for filling gaps in the signal.
FillValue float64
This value will be used for filling gaps in the signal.
IgnoreOverlap bool
DEPRECATED: Use open_violation_on_group_overlap instead, but use the inverse value of your boolean - e.g. if ignore_overlap = false, use open_violation_on_group_overlap = true. This argument sets whether to trigger a violation when groups overlap. If set to true overlapping groups will not trigger a violation. This argument is only applicable in outlier conditions.

Deprecated: use open_violation_on_group_overlap attribute instead, but use the inverse of your boolean - e.g. if ignore_overlap = false, use open_violation_on_group_overlap = true

Name string
The title of the condition.
OpenViolationOnExpiration bool
Whether to create a new violation to capture that the signal expired.
OpenViolationOnGroupOverlap bool
Whether or not to trigger a violation when groups overlap. Set to true if you want to trigger a violation when groups overlap. This argument is only applicable in outlier conditions.
RunbookUrl string
Runbook URL to display in notifications.
Terms []NrqlAlertConditionTerm
DEPRECATED Use critical, and warning instead. A list of terms for this condition. See Terms below for details.

Deprecated: use critical and warning attributes instead

Type string
The type of the condition. Valid values are static, baseline, or outlier. Defaults to static.
ValueFunction string
Possible values are single_value, sum (case insensitive).
ViolationTimeLimit string
DEPRECATED: Use violation_time_limit_seconds instead. 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, THIRTY_DAYS (case insensitive).
*Note: One of violation_time_limit or violation_time_limit_seconds must be set, but not both.

Deprecated: use violation_time_limit_seconds attribute instead

ViolationTimeLimitSeconds int
Sets a time limit, in seconds, that will automatically force-close a long-lasting violation after the time limit you select. The value must be between 300 seconds (5 minutes) to 2592000 seconds (30 days) (inclusive).
*Note: One of violation_time_limit or violation_time_limit_seconds must be set, but not both.
Warning NrqlAlertConditionWarning
A list containing the warning threshold values. See Terms below for details.
nrql NrqlAlertConditionNrqlArgs
A NRQL query. See NRQL below for details.
policyId number
The ID of the policy where this condition should be used.
accountId number
The New Relic account ID of the account you wish to create the condition. Defaults to the account ID set in your environment variable NEW_RELIC_ACCOUNT_ID.
aggregationWindow number
The duration of the time window used to evaluate the NRQL query, in seconds. The value must be at least 30 seconds, and no more than 15 minutes (900 seconds). Default is 60 seconds.
baselineDirection string
The baseline direction of a baseline NRQL alert condition. Valid values are: lower_only, upper_and_lower, upper_only (case insensitive).
closeViolationsOnExpiration boolean
Whether to close all open violations when the signal expires.
critical NrqlAlertConditionCriticalArgs
A list containing the critical threshold values. See Terms below for details.
description string
The description of the NRQL alert condition.
enabled boolean
Whether to enable the alert condition. Valid values are true and false. Defaults to true.
expectedGroups number
Number of expected groups when using outlier detection.
expirationDuration number
The amount of time (in seconds) to wait before considering the signal expired.
fillOption string
Which strategy to use when filling gaps in the signal. Possible values are none, last_value or static. If static, the fill_value field will be used for filling gaps in the signal.
fillValue number
This value will be used for filling gaps in the signal.
ignoreOverlap boolean
DEPRECATED: Use open_violation_on_group_overlap instead, but use the inverse value of your boolean - e.g. if ignore_overlap = false, use open_violation_on_group_overlap = true. This argument sets whether to trigger a violation when groups overlap. If set to true overlapping groups will not trigger a violation. This argument is only applicable in outlier conditions.

Deprecated: use open_violation_on_group_overlap attribute instead, but use the inverse of your boolean - e.g. if ignore_overlap = false, use open_violation_on_group_overlap = true

name string
The title of the condition.
openViolationOnExpiration boolean
Whether to create a new violation to capture that the signal expired.
openViolationOnGroupOverlap boolean
Whether or not to trigger a violation when groups overlap. Set to true if you want to trigger a violation when groups overlap. This argument is only applicable in outlier conditions.
runbookUrl string
Runbook URL to display in notifications.
terms NrqlAlertConditionTermArgs[]
DEPRECATED Use critical, and warning instead. A list of terms for this condition. See Terms below for details.

Deprecated: use critical and warning attributes instead

type string
The type of the condition. Valid values are static, baseline, or outlier. Defaults to static.
valueFunction string
Possible values are single_value, sum (case insensitive).
violationTimeLimit string
DEPRECATED: Use violation_time_limit_seconds instead. 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, THIRTY_DAYS (case insensitive).
*Note: One of violation_time_limit or violation_time_limit_seconds must be set, but not both.

Deprecated: use violation_time_limit_seconds attribute instead

violationTimeLimitSeconds number
Sets a time limit, in seconds, that will automatically force-close a long-lasting violation after the time limit you select. The value must be between 300 seconds (5 minutes) to 2592000 seconds (30 days) (inclusive).
*Note: One of violation_time_limit or violation_time_limit_seconds must be set, but not both.
warning NrqlAlertConditionWarningArgs
A list containing the warning threshold values. See Terms below for details.
nrql NrqlAlertConditionNrqlArgs
A NRQL query. See NRQL below for details.
policy_id int
The ID of the policy where this condition should be used.
account_id int
The New Relic account ID of the account you wish to create the condition. Defaults to the account ID set in your environment variable NEW_RELIC_ACCOUNT_ID.
aggregation_window int
The duration of the time window used to evaluate the NRQL query, in seconds. The value must be at least 30 seconds, and no more than 15 minutes (900 seconds). Default is 60 seconds.
baseline_direction str
The baseline direction of a baseline NRQL alert condition. Valid values are: lower_only, upper_and_lower, upper_only (case insensitive).
close_violations_on_expiration bool
Whether to close all open violations when the signal expires.
critical NrqlAlertConditionCriticalArgs
A list containing the critical threshold values. See Terms below for details.
description str
The description of the NRQL alert condition.
enabled bool
Whether to enable the alert condition. Valid values are true and false. Defaults to true.
expected_groups int
Number of expected groups when using outlier detection.
expiration_duration int
The amount of time (in seconds) to wait before considering the signal expired.
fill_option str
Which strategy to use when filling gaps in the signal. Possible values are none, last_value or static. If static, the fill_value field will be used for filling gaps in the signal.
fill_value float
This value will be used for filling gaps in the signal.
ignore_overlap bool
DEPRECATED: Use open_violation_on_group_overlap instead, but use the inverse value of your boolean - e.g. if ignore_overlap = false, use open_violation_on_group_overlap = true. This argument sets whether to trigger a violation when groups overlap. If set to true overlapping groups will not trigger a violation. This argument is only applicable in outlier conditions.

Deprecated: use open_violation_on_group_overlap attribute instead, but use the inverse of your boolean - e.g. if ignore_overlap = false, use open_violation_on_group_overlap = true

name str
The title of the condition.
open_violation_on_expiration bool
Whether to create a new violation to capture that the signal expired.
open_violation_on_group_overlap bool
Whether or not to trigger a violation when groups overlap. Set to true if you want to trigger a violation when groups overlap. This argument is only applicable in outlier conditions.
runbook_url str
Runbook URL to display in notifications.
terms Sequence[NrqlAlertConditionTermArgs]
DEPRECATED Use critical, and warning instead. A list of terms for this condition. See Terms below for details.

Deprecated: use critical and warning attributes instead

type str
The type of the condition. Valid values are static, baseline, or outlier. Defaults to static.
value_function str
Possible values are single_value, sum (case insensitive).
violation_time_limit str
DEPRECATED: Use violation_time_limit_seconds instead. 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, THIRTY_DAYS (case insensitive).
*Note: One of violation_time_limit or violation_time_limit_seconds must be set, but not both.

Deprecated: use violation_time_limit_seconds attribute instead

violation_time_limit_seconds int
Sets a time limit, in seconds, that will automatically force-close a long-lasting violation after the time limit you select. The value must be between 300 seconds (5 minutes) to 2592000 seconds (30 days) (inclusive).
*Note: One of violation_time_limit or violation_time_limit_seconds must be set, but not both.
warning NrqlAlertConditionWarningArgs
A list containing the warning threshold values. See Terms below for details.

Outputs

All input properties are implicitly available as output properties. Additionally, the NrqlAlertCondition resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

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): NrqlAlertCondition
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        account_id: Optional[int] = None,
        aggregation_window: Optional[int] = None,
        baseline_direction: Optional[str] = None,
        close_violations_on_expiration: Optional[bool] = None,
        critical: Optional[NrqlAlertConditionCriticalArgs] = None,
        description: Optional[str] = None,
        enabled: Optional[bool] = None,
        expected_groups: Optional[int] = None,
        expiration_duration: Optional[int] = None,
        fill_option: Optional[str] = None,
        fill_value: Optional[float] = None,
        ignore_overlap: Optional[bool] = None,
        name: Optional[str] = None,
        nrql: Optional[NrqlAlertConditionNrqlArgs] = None,
        open_violation_on_expiration: Optional[bool] = None,
        open_violation_on_group_overlap: Optional[bool] = None,
        policy_id: Optional[int] = None,
        runbook_url: Optional[str] = None,
        terms: Optional[Sequence[NrqlAlertConditionTermArgs]] = None,
        type: Optional[str] = None,
        value_function: Optional[str] = None,
        violation_time_limit: Optional[str] = None,
        violation_time_limit_seconds: Optional[int] = None,
        warning: Optional[NrqlAlertConditionWarningArgs] = None) -> NrqlAlertCondition
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:

AccountId int
The New Relic account ID of the account you wish to create the condition. Defaults to the account ID set in your environment variable NEW_RELIC_ACCOUNT_ID.
AggregationWindow int
The duration of the time window used to evaluate the NRQL query, in seconds. The value must be at least 30 seconds, and no more than 15 minutes (900 seconds). Default is 60 seconds.
BaselineDirection string
The baseline direction of a baseline NRQL alert condition. Valid values are: lower_only, upper_and_lower, upper_only (case insensitive).
CloseViolationsOnExpiration bool
Whether to close all open violations when the signal expires.
Critical Pulumi.NewRelic.Inputs.NrqlAlertConditionCriticalArgs
A list containing the critical threshold values. See Terms below for details.
Description string
The description of the NRQL alert condition.
Enabled bool
Whether to enable the alert condition. Valid values are true and false. Defaults to true.
ExpectedGroups int
Number of expected groups when using outlier detection.
ExpirationDuration int
The amount of time (in seconds) to wait before considering the signal expired.
FillOption string
Which strategy to use when filling gaps in the signal. Possible values are none, last_value or static. If static, the fill_value field will be used for filling gaps in the signal.
FillValue double
This value will be used for filling gaps in the signal.
IgnoreOverlap bool
DEPRECATED: Use open_violation_on_group_overlap instead, but use the inverse value of your boolean - e.g. if ignore_overlap = false, use open_violation_on_group_overlap = true. This argument sets whether to trigger a violation when groups overlap. If set to true overlapping groups will not trigger a violation. This argument is only applicable in outlier conditions.

Deprecated: use open_violation_on_group_overlap attribute instead, but use the inverse of your boolean - e.g. if ignore_overlap = false, use open_violation_on_group_overlap = true

Name string
The title of the condition.
Nrql Pulumi.NewRelic.Inputs.NrqlAlertConditionNrqlArgs
A NRQL query. See NRQL below for details.
OpenViolationOnExpiration bool
Whether to create a new violation to capture that the signal expired.
OpenViolationOnGroupOverlap bool
Whether or not to trigger a violation when groups overlap. Set to true if you want to trigger a violation when groups overlap. This argument is only applicable in outlier conditions.
PolicyId int
The ID of the policy where this condition should be used.
RunbookUrl string
Runbook URL to display in notifications.
Terms List<Pulumi.NewRelic.Inputs.NrqlAlertConditionTermArgs>
DEPRECATED Use critical, and warning instead. A list of terms for this condition. See Terms below for details.

Deprecated: use critical and warning attributes instead

Type string
The type of the condition. Valid values are static, baseline, or outlier. Defaults to static.
ValueFunction string
Possible values are single_value, sum (case insensitive).
ViolationTimeLimit string
DEPRECATED: Use violation_time_limit_seconds instead. 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, THIRTY_DAYS (case insensitive).
*Note: One of violation_time_limit or violation_time_limit_seconds must be set, but not both.

Deprecated: use violation_time_limit_seconds attribute instead

ViolationTimeLimitSeconds int
Sets a time limit, in seconds, that will automatically force-close a long-lasting violation after the time limit you select. The value must be between 300 seconds (5 minutes) to 2592000 seconds (30 days) (inclusive).
*Note: One of violation_time_limit or violation_time_limit_seconds must be set, but not both.
Warning Pulumi.NewRelic.Inputs.NrqlAlertConditionWarningArgs
A list containing the warning threshold values. See Terms below for details.
AccountId int
The New Relic account ID of the account you wish to create the condition. Defaults to the account ID set in your environment variable NEW_RELIC_ACCOUNT_ID.
AggregationWindow int
The duration of the time window used to evaluate the NRQL query, in seconds. The value must be at least 30 seconds, and no more than 15 minutes (900 seconds). Default is 60 seconds.
BaselineDirection string
The baseline direction of a baseline NRQL alert condition. Valid values are: lower_only, upper_and_lower, upper_only (case insensitive).
CloseViolationsOnExpiration bool
Whether to close all open violations when the signal expires.
Critical NrqlAlertConditionCritical
A list containing the critical threshold values. See Terms below for details.
Description string
The description of the NRQL alert condition.
Enabled bool
Whether to enable the alert condition. Valid values are true and false. Defaults to true.
ExpectedGroups int
Number of expected groups when using outlier detection.
ExpirationDuration int
The amount of time (in seconds) to wait before considering the signal expired.
FillOption string
Which strategy to use when filling gaps in the signal. Possible values are none, last_value or static. If static, the fill_value field will be used for filling gaps in the signal.
FillValue float64
This value will be used for filling gaps in the signal.
IgnoreOverlap bool
DEPRECATED: Use open_violation_on_group_overlap instead, but use the inverse value of your boolean - e.g. if ignore_overlap = false, use open_violation_on_group_overlap = true. This argument sets whether to trigger a violation when groups overlap. If set to true overlapping groups will not trigger a violation. This argument is only applicable in outlier conditions.

Deprecated: use open_violation_on_group_overlap attribute instead, but use the inverse of your boolean - e.g. if ignore_overlap = false, use open_violation_on_group_overlap = true

Name string
The title of the condition.
Nrql NrqlAlertConditionNrql
A NRQL query. See NRQL below for details.
OpenViolationOnExpiration bool
Whether to create a new violation to capture that the signal expired.
OpenViolationOnGroupOverlap bool
Whether or not to trigger a violation when groups overlap. Set to true if you want to trigger a violation when groups overlap. This argument is only applicable in outlier conditions.
PolicyId int
The ID of the policy where this condition should be used.
RunbookUrl string
Runbook URL to display in notifications.
Terms []NrqlAlertConditionTerm
DEPRECATED Use critical, and warning instead. A list of terms for this condition. See Terms below for details.

Deprecated: use critical and warning attributes instead

Type string
The type of the condition. Valid values are static, baseline, or outlier. Defaults to static.
ValueFunction string
Possible values are single_value, sum (case insensitive).
ViolationTimeLimit string
DEPRECATED: Use violation_time_limit_seconds instead. 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, THIRTY_DAYS (case insensitive).
*Note: One of violation_time_limit or violation_time_limit_seconds must be set, but not both.

Deprecated: use violation_time_limit_seconds attribute instead

ViolationTimeLimitSeconds int
Sets a time limit, in seconds, that will automatically force-close a long-lasting violation after the time limit you select. The value must be between 300 seconds (5 minutes) to 2592000 seconds (30 days) (inclusive).
*Note: One of violation_time_limit or violation_time_limit_seconds must be set, but not both.
Warning NrqlAlertConditionWarning
A list containing the warning threshold values. See Terms below for details.
accountId number
The New Relic account ID of the account you wish to create the condition. Defaults to the account ID set in your environment variable NEW_RELIC_ACCOUNT_ID.
aggregationWindow number
The duration of the time window used to evaluate the NRQL query, in seconds. The value must be at least 30 seconds, and no more than 15 minutes (900 seconds). Default is 60 seconds.
baselineDirection string
The baseline direction of a baseline NRQL alert condition. Valid values are: lower_only, upper_and_lower, upper_only (case insensitive).
closeViolationsOnExpiration boolean
Whether to close all open violations when the signal expires.
critical NrqlAlertConditionCriticalArgs
A list containing the critical threshold values. See Terms below for details.
description string
The description of the NRQL alert condition.
enabled boolean
Whether to enable the alert condition. Valid values are true and false. Defaults to true.
expectedGroups number
Number of expected groups when using outlier detection.
expirationDuration number
The amount of time (in seconds) to wait before considering the signal expired.
fillOption string
Which strategy to use when filling gaps in the signal. Possible values are none, last_value or static. If static, the fill_value field will be used for filling gaps in the signal.
fillValue number
This value will be used for filling gaps in the signal.
ignoreOverlap boolean
DEPRECATED: Use open_violation_on_group_overlap instead, but use the inverse value of your boolean - e.g. if ignore_overlap = false, use open_violation_on_group_overlap = true. This argument sets whether to trigger a violation when groups overlap. If set to true overlapping groups will not trigger a violation. This argument is only applicable in outlier conditions.

Deprecated: use open_violation_on_group_overlap attribute instead, but use the inverse of your boolean - e.g. if ignore_overlap = false, use open_violation_on_group_overlap = true

name string
The title of the condition.
nrql NrqlAlertConditionNrqlArgs
A NRQL query. See NRQL below for details.
openViolationOnExpiration boolean
Whether to create a new violation to capture that the signal expired.
openViolationOnGroupOverlap boolean
Whether or not to trigger a violation when groups overlap. Set to true if you want to trigger a violation when groups overlap. This argument is only applicable in outlier conditions.
policyId number
The ID of the policy where this condition should be used.
runbookUrl string
Runbook URL to display in notifications.
terms NrqlAlertConditionTermArgs[]
DEPRECATED Use critical, and warning instead. A list of terms for this condition. See Terms below for details.

Deprecated: use critical and warning attributes instead

type string
The type of the condition. Valid values are static, baseline, or outlier. Defaults to static.
valueFunction string
Possible values are single_value, sum (case insensitive).
violationTimeLimit string
DEPRECATED: Use violation_time_limit_seconds instead. 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, THIRTY_DAYS (case insensitive).
*Note: One of violation_time_limit or violation_time_limit_seconds must be set, but not both.

Deprecated: use violation_time_limit_seconds attribute instead

violationTimeLimitSeconds number
Sets a time limit, in seconds, that will automatically force-close a long-lasting violation after the time limit you select. The value must be between 300 seconds (5 minutes) to 2592000 seconds (30 days) (inclusive).
*Note: One of violation_time_limit or violation_time_limit_seconds must be set, but not both.
warning NrqlAlertConditionWarningArgs
A list containing the warning threshold values. See Terms below for details.
account_id int
The New Relic account ID of the account you wish to create the condition. Defaults to the account ID set in your environment variable NEW_RELIC_ACCOUNT_ID.
aggregation_window int
The duration of the time window used to evaluate the NRQL query, in seconds. The value must be at least 30 seconds, and no more than 15 minutes (900 seconds). Default is 60 seconds.
baseline_direction str
The baseline direction of a baseline NRQL alert condition. Valid values are: lower_only, upper_and_lower, upper_only (case insensitive).
close_violations_on_expiration bool
Whether to close all open violations when the signal expires.
critical NrqlAlertConditionCriticalArgs
A list containing the critical threshold values. See Terms below for details.
description str
The description of the NRQL alert condition.
enabled bool
Whether to enable the alert condition. Valid values are true and false. Defaults to true.
expected_groups int
Number of expected groups when using outlier detection.
expiration_duration int
The amount of time (in seconds) to wait before considering the signal expired.
fill_option str
Which strategy to use when filling gaps in the signal. Possible values are none, last_value or static. If static, the fill_value field will be used for filling gaps in the signal.
fill_value float
This value will be used for filling gaps in the signal.
ignore_overlap bool
DEPRECATED: Use open_violation_on_group_overlap instead, but use the inverse value of your boolean - e.g. if ignore_overlap = false, use open_violation_on_group_overlap = true. This argument sets whether to trigger a violation when groups overlap. If set to true overlapping groups will not trigger a violation. This argument is only applicable in outlier conditions.

Deprecated: use open_violation_on_group_overlap attribute instead, but use the inverse of your boolean - e.g. if ignore_overlap = false, use open_violation_on_group_overlap = true

name str
The title of the condition.
nrql NrqlAlertConditionNrqlArgs
A NRQL query. See NRQL below for details.
open_violation_on_expiration bool
Whether to create a new violation to capture that the signal expired.
open_violation_on_group_overlap bool
Whether or not to trigger a violation when groups overlap. Set to true if you want to trigger a violation when groups overlap. This argument is only applicable in outlier conditions.
policy_id int
The ID of the policy where this condition should be used.
runbook_url str
Runbook URL to display in notifications.
terms Sequence[NrqlAlertConditionTermArgs]
DEPRECATED Use critical, and warning instead. A list of terms for this condition. See Terms below for details.

Deprecated: use critical and warning attributes instead

type str
The type of the condition. Valid values are static, baseline, or outlier. Defaults to static.
value_function str
Possible values are single_value, sum (case insensitive).
violation_time_limit str
DEPRECATED: Use violation_time_limit_seconds instead. 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, THIRTY_DAYS (case insensitive).
*Note: One of violation_time_limit or violation_time_limit_seconds must be set, but not both.

Deprecated: use violation_time_limit_seconds attribute instead

violation_time_limit_seconds int
Sets a time limit, in seconds, that will automatically force-close a long-lasting violation after the time limit you select. The value must be between 300 seconds (5 minutes) to 2592000 seconds (30 days) (inclusive).
*Note: One of violation_time_limit or violation_time_limit_seconds must be set, but not both.
warning NrqlAlertConditionWarningArgs
A list containing the warning threshold values. See Terms below for details.

Supporting Types

NrqlAlertConditionCritical

Threshold double
Duration int

Deprecated: use threshold_duration attribute instead

Operator string
ThresholdDuration int
ThresholdOccurrences string
TimeFunction string

Deprecated: use threshold_occurrences attribute instead

Threshold float64
Duration int

Deprecated: use threshold_duration attribute instead

Operator string
ThresholdDuration int
ThresholdOccurrences string
TimeFunction string

Deprecated: use threshold_occurrences attribute instead

threshold number
duration number

Deprecated: use threshold_duration attribute instead

operator string
thresholdDuration number
thresholdOccurrences string
timeFunction string

Deprecated: use threshold_occurrences attribute instead

threshold float
duration int

Deprecated: use threshold_duration attribute instead

operator str
threshold_duration int
threshold_occurrences str
time_function str

Deprecated: use threshold_occurrences attribute instead

NrqlAlertConditionNrql

Query string
EvaluationOffset int
SinceValue string

Deprecated: use evaluation_offset attribute instead

Query string
EvaluationOffset int
SinceValue string

Deprecated: use evaluation_offset attribute instead

query string
evaluationOffset number
sinceValue string

Deprecated: use evaluation_offset attribute instead

query str
evaluation_offset int
since_value str

Deprecated: use evaluation_offset attribute instead

NrqlAlertConditionTerm

Threshold double
Duration int

Deprecated: use threshold_duration attribute instead

Operator string
Priority string
ThresholdDuration int
ThresholdOccurrences string
TimeFunction string

Deprecated: use threshold_occurrences attribute instead

Threshold float64
Duration int

Deprecated: use threshold_duration attribute instead

Operator string
Priority string
ThresholdDuration int
ThresholdOccurrences string
TimeFunction string

Deprecated: use threshold_occurrences attribute instead

threshold number
duration number

Deprecated: use threshold_duration attribute instead

operator string
priority string
thresholdDuration number
thresholdOccurrences string
timeFunction string

Deprecated: use threshold_occurrences attribute instead

threshold float
duration int

Deprecated: use threshold_duration attribute instead

operator str
priority str
threshold_duration int
threshold_occurrences str
time_function str

Deprecated: use threshold_occurrences attribute instead

NrqlAlertConditionWarning

Threshold double
Duration int

Deprecated: use threshold_duration attribute instead

Operator string
ThresholdDuration int
ThresholdOccurrences string
TimeFunction string

Deprecated: use threshold_occurrences attribute instead

Threshold float64
Duration int

Deprecated: use threshold_duration attribute instead

Operator string
ThresholdDuration int
ThresholdOccurrences string
TimeFunction string

Deprecated: use threshold_occurrences attribute instead

threshold number
duration number

Deprecated: use threshold_duration attribute instead

operator string
thresholdDuration number
thresholdOccurrences string
timeFunction string

Deprecated: use threshold_occurrences attribute instead

threshold float
duration int

Deprecated: use threshold_duration attribute instead

operator str
threshold_duration int
threshold_occurrences str
time_function str

Deprecated: use threshold_occurrences attribute instead

Import

Alert conditions can be imported using a composite ID of <policy_id>:<condition_id>:<conditionType>, e.g. // For baseline conditions

 $ pulumi import newrelic:index/nrqlAlertCondition:NrqlAlertCondition foo 538291:6789035:baseline

// For static conditions

 $ pulumi import newrelic:index/nrqlAlertCondition:NrqlAlertCondition foo 538291:6789035:static

// For outlier conditions

 $ pulumi import newrelic:index/nrqlAlertCondition:NrqlAlertCondition foo 538291:6789035:outlier

The actual values for policy_id and condition_id can be retrieved from the following New Relic URL when viewing the NRQL alert condition you want to importalerts.newrelic.com/accounts/<account_id>/policies/<policy_id>/conditions/<condition_id>/edit

Package Details

Repository
https://github.com/pulumi/pulumi-newrelic
License
Apache-2.0
Notes
This Pulumi package is based on the newrelic Terraform Provider.