import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* Use this resource to create and manage NRQL alert conditions in New Relic.
*
* > **IMPORTANT!** Version 2.0.0 of the New Relic Terraform Provider introduces some [additional requirements](https://www.terraform.io/providers/newrelic/newrelic/latest/docs/guides/migration_guide_v2) for configuring the provider.
*
* Before upgrading to version 2.0.0 or later, it is recommended to upgrade to the most recent 1.x version of the provider and ensure that your environment successfully runs `pulumi preview` without unexpected changes.
*
* ## Example Usage
*
* ##### Type: `static` (default)
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as newrelic from "@pulumi/newrelic";
*
* const foo = new newrelic.AlertPolicy("foo", {name: "foo"});
* const fooNrqlAlertCondition = new newrelic.NrqlAlertCondition("foo", {
* accountId: "12345678",
* policyId: foo.id,
* type: "static",
* name: "foo",
* description: "Alert when transactions are taking too long",
* titleTemplate: "Issue in environment: {{ tags.environment }}",
* targetEntity: "MXxBUE18QVBQTElDQVRJT058MQ",
* runbookUrl: "https://www.example.com",
* enabled: true,
* violationTimeLimitSeconds: 3600,
* fillOption: "static",
* fillValue: 1,
* aggregationWindow: 60,
* aggregationMethod: "event_flow",
* aggregationDelay: "120",
* expirationDuration: 120,
* openViolationOnExpiration: true,
* closeViolationsOnExpiration: true,
* ignoreOnExpectedTermination: true,
* slideBy: 30,
* nrql: {
* query: "SELECT average(duration) FROM Transaction where appName = 'Your App'",
* },
* critical: {
* operator: "above",
* threshold: 5.5,
* thresholdDuration: 300,
* thresholdOccurrences: "ALL",
* },
* warning: {
* operator: "above",
* threshold: 3.5,
* thresholdDuration: 600,
* thresholdOccurrences: "ALL",
* },
* });
* ```
* See additional examples.
*
* ## NRQL
*
* The `nrql` block supports the following arguments:
*
* - `query` - (Required) The NRQL query to execute for the condition.
* - `dataAccountId` - (Optional) The account ID to use for the alert condition's query as specified in the the `query` field. If `dataAccountId` is not specified, then the condition's query will be evaluated against the `accountId`. Note that the `accountId` must have read privileges for the `dataAccountId` or else the condition will be invalid.
* - `evaluationOffset` - (Optional) **DEPRECATED:** Use `aggregationMethod` instead. Represented in minutes and must be within 1-20 minutes (inclusive). NRQL queries are evaluated based on their `aggregationWindow` size. The start time depends on this value. It's recommended to set this to 3 windows. An offset of less than 3 windows will trigger incidents sooner, but you may see more false positives and negatives due to data latency. With `evaluationOffset` set to 3 windows and an `aggregationWindow` of 60 seconds, the NRQL time window applied to your query will be: `SINCE 3 minutes ago UNTIL 2 minutes ago`. `evaluationOffset` cannot be set with `aggregationMethod`, `aggregationDelay`, or `aggregationTimer`.
* - `sinceValue` - (Optional) **DEPRECATED:** Use `aggregationMethod` instead. The value to be used in the `SINCE minutes ago` clause for the NRQL query. Must be between 1-20 (inclusive).
*
* ## 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. At least one `critical` or `warning` term must be defined.
*
* 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 supports the following arguments:
*
* - `operator` - (Optional) Valid values are `above`, `aboveOrEquals`, `below`, `belowOrEquals`, `equals`, or `notEquals` (case insensitive). Defaults to `equals`. Note that when using a `type` of `baseline`, the only valid option here is `above`.
* - `priority` - (Optional) `critical` or `warning`. Defaults to `critical`.
* - `threshold` - (Required) The value which will trigger an incident.
*
For _baseline_ NRQL alert conditions, the value must be in the range [1, 1000]. The value is the number of standard deviations from the baseline that the metric must exceed in order to create an incident.
* - `thresholdDuration` - (Optional) The duration, in seconds, that the threshold must violate in order to create an incident. Value must be a multiple of the `aggregationWindow` (which has a default of 60 seconds).
*
For _baseline_ NRQL alert conditions, the value must be within 120-86400 seconds (inclusive).
*
For _static_ NRQL alert conditions, the value must be within 60-86400 seconds (inclusive).
*
* - `thresholdOccurrences` - (Optional) The criteria for how many data points must be in violation for the specified threshold duration. Valid values are: `all` or `atLeastOnce` (case insensitive).
* - `duration` - (Optional) **DEPRECATED:** Use `thresholdDuration` instead. The duration of time, in _minutes_, that the threshold must violate for in order to create an incident. Must be within 1-120 (inclusive).
* - `timeFunction` - (Optional) **DEPRECATED:** Use `thresholdOccurrences` instead. The criteria for how many data points must be in violation for the specified threshold duration. Valid values are: `all` or `any`.
* - `prediction` - (Optional) **BETA PREVIEW: the `prediction` field is in limited release and only enabled for preview on a per-account basis.** Use `prediction` to open alerts when your static threshold is predicted to be reached in the future. The `prediction` field is only available for _static_ NRQL alert conditions. See Prediction below for details.
* - `disableHealthStatusReporting` - (Optional) `true` or `false`. Defaults to `false` when field not included in TF config. Violations will not change system health status for this term.
* - `disableEventCreation` - (Optional) **BETA PREVIEW: the `disableEventCreation` field is in limited release and only enabled for preview on a per-account basis.** `true` or `false`. Defaults to `false` when field not included in TF config. When set to `true`, violations will not create events.
*
* > **NOTE:** When a `critical` or `warning` block is added to this resource, using either `duration` or `thresholdDuration` (one of the two) is mandatory. Both of these should not be specified.
*
* > **NOTE:** When a `critical` or `warning` block is added to this resource, using either `timeFunction` or `thresholdOccurrences` (one of the two) is mandatory. Both of these should not be specified.
*
* ### Prediction
*
* > **BETA PREVIEW:** The `prediction` block is in limited release and only enabled for preview on a per-account basis.
*
* > **NOTE:** The `prediction` block is only available for _static_ NRQL alert conditions.
*
* The `prediction` block supports the following arguments:
*
* - `predictBy` - (Optional) The duration, in seconds, that the prediction should look into the future. Default is 3600 seconds (1 hour).
* - `preferPredictionViolation` - (Optional) If a prediction incident is open when a term's static threshold is breached by the actual signal, default behavior is to close the prediction incident and open a static incident. Setting `preferPredictionViolation` to `true` overrides this behavior leaving the prediction incident open and preventing a static incident from opening. Default is false.
*
* ## Outlier Configuration
*
* > **BETA PREVIEW:** The `outlier` condition type is in limited release and only enabled for preview on a per-account basis.
*
* > **NOTE:** The `outlierConfiguration` block is only available for _outlier_ NRQL alert conditions.
*
* The `outlierConfiguration` block supports the following nested block:
* - `dbscan` - (Required) The DBSCAN algorithm configuration block.
*
* `dbscan` supports the following arguments:
* - `epsilon` - (Required) The maximum distance between two samples for one to be considered as in the neighborhood of the other. Value must be > 0.
* - `minimumPoints` - (Required) The number of samples in a neighborhood for a point to be considered as a core point. This includes the point itself. Value must be >= 1.
* - `evaluationGroupFacet` - (Optional) NRQL facet attribute used to segment data into groups (e.g. `host`, `region`) before running outlier detection. Omit to evaluate all results together.
*
* Notes:
* - Currently only `dbscan` is supported.
*
* ## Additional Examples
*
* ##### Type: `baseline`
*
* [Baseline NRQL alert conditions](https://docs.newrelic.com/docs/alerts/new-relic-alerts/defining-conditions/create-baseline-alert-conditions) are dynamic in nature and adjust to the behavior of your data. The example below demonstrates a baseline NRQL alert condition for alerting when transaction durations are above a specified threshold and dynamically adjusts based on data trends.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as newrelic from "@pulumi/newrelic";
*
* const foo = new newrelic.AlertPolicy("foo", {name: "foo"});
* const fooNrqlAlertCondition = new newrelic.NrqlAlertCondition("foo", {
* type: "baseline",
* accountId: "12345678",
* name: "foo",
* policyId: foo.id,
* description: "Alert when transactions are taking too long",
* enabled: true,
* runbookUrl: "https://www.example.com",
* violationTimeLimitSeconds: 3600,
* aggregationMethod: "event_flow",
* aggregationDelay: "120",
* slideBy: 30,
* baselineDirection: "upper_only",
* signalSeasonality: "weekly",
* nrql: {
* query: "SELECT percentile(duration, 95) FROM Transaction WHERE appName = 'ExampleAppName'",
* },
* critical: {
* operator: "above",
* threshold: 5.5,
* thresholdDuration: 300,
* thresholdOccurrences: "all",
* },
* warning: {
* operator: "above",
* threshold: 3.5,
* thresholdDuration: 600,
* thresholdOccurrences: "all",
* },
* });
* ```
*
*
* ##### Type: `outlier`
*
* > **BETA PREVIEW:** The `outlier` condition type is in limited release and only enabled for preview on a per-account basis.
*
* [Outlier NRQL alert conditions](https://docs.newrelic.com/docs/alerts/create-alert/set-thresholds/outlier-detection/) are dynamic in nature and adjust to the behavior of your data. The example below demonstrates an outlier NRQL alert condition for detecting anomalies using the DBSCAN clustering algorithm.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as newrelic from "@pulumi/newrelic";
*
* const outlierPolicy = new newrelic.AlertPolicy("outlier_policy", {name: "outlier-demo"});
* const outlierCondition = new newrelic.NrqlAlertCondition("outlier_condition", {
* accountId: "12345678",
* policyId: outlierPolicy.id,
* type: "outlier",
* name: "Outlier duration anomaly",
* description: "Detect hosts with anomalous average duration",
* enabled: true,
* violationTimeLimitSeconds: 3600,
* aggregationWindow: 60,
* aggregationMethod: "event_flow",
* nrql: {
* query: "SELECT average(duration) FROM Transaction FACET host",
* },
* outlierConfiguration: {
* dbscan: {
* epsilon: 0.15,
* minimumPoints: 5,
* evaluationGroupFacet: "host",
* },
* },
* critical: {
* operator: "above",
* threshold: 0,
* thresholdDuration: 300,
* thresholdOccurrences: "all",
* },
* });
* ```
*
*
*
* ## Tags
*
* Manage NRQL alert condition tags with `newrelic.EntityTags`. For up-to-date documentation about the tagging resource, please check newrelic.EntityTags
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as newrelic from "@pulumi/newrelic";
*
* const foo = new newrelic.AlertPolicy("foo", {name: "foo"});
* const fooNrqlAlertCondition = new newrelic.NrqlAlertCondition("foo", {
* accountId: "12345678",
* policyId: foo.id,
* type: "static",
* name: "foo",
* description: "Alert when transactions are taking too long",
* runbookUrl: "https://www.example.com",
* enabled: true,
* violationTimeLimitSeconds: 3600,
* fillOption: "static",
* fillValue: 1,
* aggregationWindow: 60,
* aggregationMethod: "event_flow",
* aggregationDelay: "120",
* expirationDuration: 120,
* openViolationOnExpiration: true,
* closeViolationsOnExpiration: true,
* slideBy: 30,
* nrql: {
* query: "SELECT average(duration) FROM Transaction where appName = 'Your App'",
* },
* critical: {
* operator: "above",
* threshold: 5.5,
* thresholdDuration: 300,
* thresholdOccurrences: "ALL",
* },
* warning: {
* operator: "above",
* threshold: 3.5,
* thresholdDuration: 600,
* thresholdOccurrences: "ALL",
* },
* });
* const myConditionEntityTags = new newrelic.EntityTags("my_condition_entity_tags", {
* guid: fooNrqlAlertCondition.entityGuid,
* tags: [
* {
* key: "my-key",
* values: [
* "my-value",
* "my-other-value",
* ],
* },
* {
* key: "my-key-2",
* values: ["my-value-2"],
* },
* ],
* });
* ```
*
* ## Upgrade from 1.x to 2.x
*
* There have been several deprecations in the `newrelic.NrqlAlertCondition`
* resource. Users will need to make some updates in order to have a smooth
* upgrade.
*
* An example resource from 1.x might look like the following.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as newrelic from "@pulumi/newrelic";
*
* const z = new newrelic.NrqlAlertCondition("z", {
* policyId: zNewrelicAlertPolicy.id,
* name: "zleslie-test",
* type: "static",
* runbookUrl: "https://localhost",
* enabled: true,
* violationTimeLimit: "TWENTY_FOUR_HOURS",
* critical: {
* operator: "above",
* thresholdDuration: 120,
* threshold: 3,
* thresholdOccurrences: "AT_LEAST_ONCE",
* },
* nrql: {
* query: "SELECT count(*) FROM TransactionError WHERE appName like '%Dummy App%' FACET appName",
* },
* });
* ```
*
* After making the appropriate adjustments mentioned in the deprecation warnings,
* the resource now looks like the following.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as newrelic from "@pulumi/newrelic";
*
* const z = new newrelic.NrqlAlertCondition("z", {
* policyId: zNewrelicAlertPolicy.id,
* name: "zleslie-test",
* type: "static",
* runbookUrl: "https://localhost",
* enabled: true,
* violationTimeLimitSeconds: 86400,
* terms: [{
* priority: "critical",
* operator: "above",
* threshold: 3,
* duration: 5,
* timeFunction: "any",
* }],
* nrql: {
* query: "SELECT count(*) FROM TransactionError WHERE appName like '%Dummy App%' FACET appName",
* },
* });
* ```
*
* ## Import
*
* NRQL alert conditions can be imported using a composite ID of `::`, e.g.
*
* // For `baseline` conditions
*
* ```sh
* $ pulumi import newrelic:index/nrqlAlertCondition:NrqlAlertCondition foo 538291:6789035:baseline
*
* // For `static` conditions
* $ pulumi import newrelic:index/nrqlAlertCondition:NrqlAlertCondition foo 538291:6789035:static
* ```
*
* > **NOTE:** The value of `conditionType` in the import composite ID must be a valid condition type - `static` or `baseline`. Also note that deprecated arguments will *not* be set when importing.
*
* Users can find the actual values for `policyId` and `conditionId` from the New Relic One UI under respective policy and condition.
*/
export declare class NrqlAlertCondition extends pulumi.CustomResource {
/**
* Get an existing NrqlAlertCondition resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input, state?: NrqlAlertConditionState, opts?: pulumi.CustomResourceOptions): NrqlAlertCondition;
/**
* Returns true if the given object is an instance of NrqlAlertCondition. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is NrqlAlertCondition;
/**
* 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`.
*/
readonly accountId: pulumi.Output;
/**
* How long we wait for data that belongs in each aggregation window. Depending on your data, a longer delay may increase accuracy but delay notifications. Use `aggregationDelay` with the `eventFlow` and `cadence` methods. The maximum delay is 1200 seconds (20 minutes) when using `eventFlow` and 3600 seconds (60 minutes) when using `cadence`. In both cases, the minimum delay is 0 seconds and the default is 120 seconds. `aggregationDelay` cannot be set with `nrql.evaluation_offset`.
*/
readonly aggregationDelay: pulumi.Output;
/**
* Determines when we consider an aggregation window to be complete so that we can evaluate the signal for incidents. Possible values are `cadence`, `eventFlow` or `eventTimer`. Default is `eventFlow`. `aggregationMethod` cannot be set with `nrql.evaluation_offset`.
*/
readonly aggregationMethod: pulumi.Output;
/**
* How long we wait after each data point arrives to make sure we've processed the whole batch. Use `aggregationTimer` with the `eventTimer` method. The timer value can range from 0 seconds to 1200 seconds (20 minutes); the default is 60 seconds. `aggregationTimer` cannot be set with `nrql.evaluation_offset`.
*/
readonly aggregationTimer: pulumi.Output;
/**
* 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 21600 seconds (6 hours). Default is 60 seconds.
*/
readonly aggregationWindow: pulumi.Output;
/**
* The baseline direction of a _baseline_ NRQL alert condition. Valid values are: `lowerOnly`, `upperAndLower`, `upperOnly` (case insensitive).
*/
readonly baselineDirection: pulumi.Output;
/**
* Whether to close all open incidents when the signal expires.
*/
readonly closeViolationsOnExpiration: pulumi.Output;
/**
* A list containing the `critical` threshold values. At least one `critical` or `warning` threshold must be defined. See Terms below for details.
*/
readonly critical: pulumi.Output;
/**
* The description of the NRQL alert condition.
*/
readonly description: pulumi.Output;
/**
* Whether to enable the alert condition. Valid values are `true` and `false`. Defaults to `true`.
*/
readonly enabled: pulumi.Output;
/**
* The unique entity identifier of the NRQL Condition in New Relic.
*/
readonly entityGuid: pulumi.Output;
/**
* How long we wait until the signal starts evaluating. The maximum delay is 7200 seconds (120 minutes).
*/
readonly evaluationDelay: pulumi.Output;
/**
* The amount of time (in seconds) to wait before considering the signal expired. The value must be at least 30 seconds, and no more than 172800 seconds (48 hours).
*/
readonly expirationDuration: pulumi.Output;
/**
* Which strategy to use when filling gaps in the signal. Possible values are `none`, `lastValue` or `static`. If `static`, the `fillValue` field will be used for filling gaps in the signal.
*/
readonly fillOption: pulumi.Output;
/**
* This value will be used for filling gaps in the signal.
*/
readonly fillValue: pulumi.Output;
/**
* Whether an alert condition should ignore expected termination of a signal when considering whether to create a loss of signal incident. Defaults to false.
*/
readonly ignoreOnExpectedTermination: pulumi.Output;
/**
* The title of the condition.
*/
readonly name: pulumi.Output;
/**
* A NRQL query. See NRQL below for details.
*/
readonly nrql: pulumi.Output;
/**
* Whether to create a new incident to capture that the signal expired.
*/
readonly openViolationOnExpiration: pulumi.Output;
/**
* **BETA PREVIEW:** The configuration block for `outlier` NRQL alert conditions. See Outlier Configuration below for details.
*/
readonly outlierConfiguration: pulumi.Output;
/**
* The ID of the policy where this condition should be used.
*/
readonly policyId: pulumi.Output;
/**
* Runbook URL to display in notifications.
*/
readonly runbookUrl: pulumi.Output;
/**
* Seasonality under which a condition's signal(s) are evaluated. Only available for baseline conditions. Valid values are: `NEW_RELIC_CALCULATION`, `HOURLY`, `DAILY`, `WEEKLY`, or `NONE`. To have New Relic calculate seasonality automatically, set to `NEW_RELIC_CALCULATION`. To turn off seasonality completely, set to `NONE`.
*/
readonly signalSeasonality: pulumi.Output;
/**
* Gathers data in overlapping time windows to smooth the chart line, making it easier to spot trends. The `slideBy` value is specified in seconds and must be smaller than and a factor of the `aggregationWindow`.
*/
readonly slideBy: pulumi.Output;
/**
* BETA PREVIEW: The GUID of the entity explicitly targeted by the condition. Issues triggered by this condition will affect the health status of this entity instead of having the affected entity detected automatically. The entity's account ID must be either `accountId` or `nrql.data_account_id`.
*/
readonly targetEntity: pulumi.Output;
/**
* **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
*/
readonly terms: pulumi.Output;
/**
* The custom title to be used when incidents are opened by the condition. Setting this field will override the default title. Must be [Handlebars](https://handlebarsjs.com/) format.
*/
readonly titleTemplate: pulumi.Output;
/**
* The type of the condition. Valid values are `static`, `baseline`, or `outlier`. Defaults to `static`.
* \***Note**: **BETA PREVIEW: the `outlier` field is in limited release and only enabled for preview on a per-account basis.**
*/
readonly type: pulumi.Output;
/**
* **DEPRECATED:** Use `violationTimeLimitSeconds` instead. Sets a time limit, in hours, that will automatically force-close a long-lasting incident 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 `violationTimeLimit` _or_ `violationTimeLimitSeconds` must be set, but not both.
*
* @deprecated use `violationTimeLimitSeconds` attribute instead
*/
readonly violationTimeLimit: pulumi.Output;
/**
* Sets a time limit, in seconds, that will automatically force-close a long-lasting incident after the time limit you select. The value must be between 300 seconds (5 minutes) to 2592000 seconds (30 days) (inclusive).
* \***Note**: One of `violationTimeLimit` _or_ `violationTimeLimitSeconds` must be set, but not both.
*/
readonly violationTimeLimitSeconds: pulumi.Output;
/**
* A list containing the `warning` threshold values. At least one `critical` or `warning` threshold must be defined. See Terms below for details.
*/
readonly warning: pulumi.Output;
/**
* Create a NrqlAlertCondition resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: NrqlAlertConditionArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering NrqlAlertCondition resources.
*/
export interface NrqlAlertConditionState {
/**
* 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`.
*/
accountId?: pulumi.Input;
/**
* How long we wait for data that belongs in each aggregation window. Depending on your data, a longer delay may increase accuracy but delay notifications. Use `aggregationDelay` with the `eventFlow` and `cadence` methods. The maximum delay is 1200 seconds (20 minutes) when using `eventFlow` and 3600 seconds (60 minutes) when using `cadence`. In both cases, the minimum delay is 0 seconds and the default is 120 seconds. `aggregationDelay` cannot be set with `nrql.evaluation_offset`.
*/
aggregationDelay?: pulumi.Input;
/**
* Determines when we consider an aggregation window to be complete so that we can evaluate the signal for incidents. Possible values are `cadence`, `eventFlow` or `eventTimer`. Default is `eventFlow`. `aggregationMethod` cannot be set with `nrql.evaluation_offset`.
*/
aggregationMethod?: pulumi.Input;
/**
* How long we wait after each data point arrives to make sure we've processed the whole batch. Use `aggregationTimer` with the `eventTimer` method. The timer value can range from 0 seconds to 1200 seconds (20 minutes); the default is 60 seconds. `aggregationTimer` cannot be set with `nrql.evaluation_offset`.
*/
aggregationTimer?: pulumi.Input;
/**
* 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 21600 seconds (6 hours). Default is 60 seconds.
*/
aggregationWindow?: pulumi.Input;
/**
* The baseline direction of a _baseline_ NRQL alert condition. Valid values are: `lowerOnly`, `upperAndLower`, `upperOnly` (case insensitive).
*/
baselineDirection?: pulumi.Input;
/**
* Whether to close all open incidents when the signal expires.
*/
closeViolationsOnExpiration?: pulumi.Input;
/**
* A list containing the `critical` threshold values. At least one `critical` or `warning` threshold must be defined. See Terms below for details.
*/
critical?: pulumi.Input;
/**
* The description of the NRQL alert condition.
*/
description?: pulumi.Input;
/**
* Whether to enable the alert condition. Valid values are `true` and `false`. Defaults to `true`.
*/
enabled?: pulumi.Input;
/**
* The unique entity identifier of the NRQL Condition in New Relic.
*/
entityGuid?: pulumi.Input;
/**
* How long we wait until the signal starts evaluating. The maximum delay is 7200 seconds (120 minutes).
*/
evaluationDelay?: pulumi.Input;
/**
* The amount of time (in seconds) to wait before considering the signal expired. The value must be at least 30 seconds, and no more than 172800 seconds (48 hours).
*/
expirationDuration?: pulumi.Input;
/**
* Which strategy to use when filling gaps in the signal. Possible values are `none`, `lastValue` or `static`. If `static`, the `fillValue` field will be used for filling gaps in the signal.
*/
fillOption?: pulumi.Input;
/**
* This value will be used for filling gaps in the signal.
*/
fillValue?: pulumi.Input;
/**
* Whether an alert condition should ignore expected termination of a signal when considering whether to create a loss of signal incident. Defaults to false.
*/
ignoreOnExpectedTermination?: pulumi.Input;
/**
* The title of the condition.
*/
name?: pulumi.Input;
/**
* A NRQL query. See NRQL below for details.
*/
nrql?: pulumi.Input;
/**
* Whether to create a new incident to capture that the signal expired.
*/
openViolationOnExpiration?: pulumi.Input;
/**
* **BETA PREVIEW:** The configuration block for `outlier` NRQL alert conditions. See Outlier Configuration below for details.
*/
outlierConfiguration?: pulumi.Input;
/**
* The ID of the policy where this condition should be used.
*/
policyId?: pulumi.Input;
/**
* Runbook URL to display in notifications.
*/
runbookUrl?: pulumi.Input;
/**
* Seasonality under which a condition's signal(s) are evaluated. Only available for baseline conditions. Valid values are: `NEW_RELIC_CALCULATION`, `HOURLY`, `DAILY`, `WEEKLY`, or `NONE`. To have New Relic calculate seasonality automatically, set to `NEW_RELIC_CALCULATION`. To turn off seasonality completely, set to `NONE`.
*/
signalSeasonality?: pulumi.Input;
/**
* Gathers data in overlapping time windows to smooth the chart line, making it easier to spot trends. The `slideBy` value is specified in seconds and must be smaller than and a factor of the `aggregationWindow`.
*/
slideBy?: pulumi.Input;
/**
* BETA PREVIEW: The GUID of the entity explicitly targeted by the condition. Issues triggered by this condition will affect the health status of this entity instead of having the affected entity detected automatically. The entity's account ID must be either `accountId` or `nrql.data_account_id`.
*/
targetEntity?: pulumi.Input;
/**
* **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
*/
terms?: pulumi.Input[] | undefined>;
/**
* The custom title to be used when incidents are opened by the condition. Setting this field will override the default title. Must be [Handlebars](https://handlebarsjs.com/) format.
*/
titleTemplate?: pulumi.Input;
/**
* The type of the condition. Valid values are `static`, `baseline`, or `outlier`. Defaults to `static`.
* \***Note**: **BETA PREVIEW: the `outlier` field is in limited release and only enabled for preview on a per-account basis.**
*/
type?: pulumi.Input;
/**
* **DEPRECATED:** Use `violationTimeLimitSeconds` instead. Sets a time limit, in hours, that will automatically force-close a long-lasting incident 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 `violationTimeLimit` _or_ `violationTimeLimitSeconds` must be set, but not both.
*
* @deprecated use `violationTimeLimitSeconds` attribute instead
*/
violationTimeLimit?: pulumi.Input;
/**
* Sets a time limit, in seconds, that will automatically force-close a long-lasting incident after the time limit you select. The value must be between 300 seconds (5 minutes) to 2592000 seconds (30 days) (inclusive).
* \***Note**: One of `violationTimeLimit` _or_ `violationTimeLimitSeconds` must be set, but not both.
*/
violationTimeLimitSeconds?: pulumi.Input;
/**
* A list containing the `warning` threshold values. At least one `critical` or `warning` threshold must be defined. See Terms below for details.
*/
warning?: pulumi.Input;
}
/**
* The set of arguments for constructing a NrqlAlertCondition resource.
*/
export interface NrqlAlertConditionArgs {
/**
* 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`.
*/
accountId?: pulumi.Input;
/**
* How long we wait for data that belongs in each aggregation window. Depending on your data, a longer delay may increase accuracy but delay notifications. Use `aggregationDelay` with the `eventFlow` and `cadence` methods. The maximum delay is 1200 seconds (20 minutes) when using `eventFlow` and 3600 seconds (60 minutes) when using `cadence`. In both cases, the minimum delay is 0 seconds and the default is 120 seconds. `aggregationDelay` cannot be set with `nrql.evaluation_offset`.
*/
aggregationDelay?: pulumi.Input;
/**
* Determines when we consider an aggregation window to be complete so that we can evaluate the signal for incidents. Possible values are `cadence`, `eventFlow` or `eventTimer`. Default is `eventFlow`. `aggregationMethod` cannot be set with `nrql.evaluation_offset`.
*/
aggregationMethod?: pulumi.Input;
/**
* How long we wait after each data point arrives to make sure we've processed the whole batch. Use `aggregationTimer` with the `eventTimer` method. The timer value can range from 0 seconds to 1200 seconds (20 minutes); the default is 60 seconds. `aggregationTimer` cannot be set with `nrql.evaluation_offset`.
*/
aggregationTimer?: pulumi.Input;
/**
* 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 21600 seconds (6 hours). Default is 60 seconds.
*/
aggregationWindow?: pulumi.Input;
/**
* The baseline direction of a _baseline_ NRQL alert condition. Valid values are: `lowerOnly`, `upperAndLower`, `upperOnly` (case insensitive).
*/
baselineDirection?: pulumi.Input;
/**
* Whether to close all open incidents when the signal expires.
*/
closeViolationsOnExpiration?: pulumi.Input;
/**
* A list containing the `critical` threshold values. At least one `critical` or `warning` threshold must be defined. See Terms below for details.
*/
critical?: pulumi.Input;
/**
* The description of the NRQL alert condition.
*/
description?: pulumi.Input;
/**
* Whether to enable the alert condition. Valid values are `true` and `false`. Defaults to `true`.
*/
enabled?: pulumi.Input;
/**
* How long we wait until the signal starts evaluating. The maximum delay is 7200 seconds (120 minutes).
*/
evaluationDelay?: pulumi.Input;
/**
* The amount of time (in seconds) to wait before considering the signal expired. The value must be at least 30 seconds, and no more than 172800 seconds (48 hours).
*/
expirationDuration?: pulumi.Input;
/**
* Which strategy to use when filling gaps in the signal. Possible values are `none`, `lastValue` or `static`. If `static`, the `fillValue` field will be used for filling gaps in the signal.
*/
fillOption?: pulumi.Input;
/**
* This value will be used for filling gaps in the signal.
*/
fillValue?: pulumi.Input;
/**
* Whether an alert condition should ignore expected termination of a signal when considering whether to create a loss of signal incident. Defaults to false.
*/
ignoreOnExpectedTermination?: pulumi.Input;
/**
* The title of the condition.
*/
name?: pulumi.Input;
/**
* A NRQL query. See NRQL below for details.
*/
nrql: pulumi.Input;
/**
* Whether to create a new incident to capture that the signal expired.
*/
openViolationOnExpiration?: pulumi.Input;
/**
* **BETA PREVIEW:** The configuration block for `outlier` NRQL alert conditions. See Outlier Configuration below for details.
*/
outlierConfiguration?: pulumi.Input;
/**
* The ID of the policy where this condition should be used.
*/
policyId: pulumi.Input;
/**
* Runbook URL to display in notifications.
*/
runbookUrl?: pulumi.Input;
/**
* Seasonality under which a condition's signal(s) are evaluated. Only available for baseline conditions. Valid values are: `NEW_RELIC_CALCULATION`, `HOURLY`, `DAILY`, `WEEKLY`, or `NONE`. To have New Relic calculate seasonality automatically, set to `NEW_RELIC_CALCULATION`. To turn off seasonality completely, set to `NONE`.
*/
signalSeasonality?: pulumi.Input;
/**
* Gathers data in overlapping time windows to smooth the chart line, making it easier to spot trends. The `slideBy` value is specified in seconds and must be smaller than and a factor of the `aggregationWindow`.
*/
slideBy?: pulumi.Input;
/**
* BETA PREVIEW: The GUID of the entity explicitly targeted by the condition. Issues triggered by this condition will affect the health status of this entity instead of having the affected entity detected automatically. The entity's account ID must be either `accountId` or `nrql.data_account_id`.
*/
targetEntity?: pulumi.Input;
/**
* **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
*/
terms?: pulumi.Input[] | undefined>;
/**
* The custom title to be used when incidents are opened by the condition. Setting this field will override the default title. Must be [Handlebars](https://handlebarsjs.com/) format.
*/
titleTemplate?: pulumi.Input;
/**
* The type of the condition. Valid values are `static`, `baseline`, or `outlier`. Defaults to `static`.
* \***Note**: **BETA PREVIEW: the `outlier` field is in limited release and only enabled for preview on a per-account basis.**
*/
type?: pulumi.Input;
/**
* **DEPRECATED:** Use `violationTimeLimitSeconds` instead. Sets a time limit, in hours, that will automatically force-close a long-lasting incident 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 `violationTimeLimit` _or_ `violationTimeLimitSeconds` must be set, but not both.
*
* @deprecated use `violationTimeLimitSeconds` attribute instead
*/
violationTimeLimit?: pulumi.Input;
/**
* Sets a time limit, in seconds, that will automatically force-close a long-lasting incident after the time limit you select. The value must be between 300 seconds (5 minutes) to 2592000 seconds (30 days) (inclusive).
* \***Note**: One of `violationTimeLimit` _or_ `violationTimeLimitSeconds` must be set, but not both.
*/
violationTimeLimitSeconds?: pulumi.Input;
/**
* A list containing the `warning` threshold values. At least one `critical` or `warning` threshold must be defined. See Terms below for details.
*/
warning?: pulumi.Input;
}
//# sourceMappingURL=nrqlAlertCondition.d.ts.map