Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace CreateAlarmDetails

The configuration details for creating an alarm.

Properties

Optional body

body: undefined | string

The human-readable content of the delivered alarm notification. Oracle recommends providing guidance to operators for resolving the alarm condition. Consider adding links to standard runbook practices. Avoid entering confidential information.

Example: {@code High CPU usage alert. Follow runbook instructions for resolution.}

compartmentId

compartmentId: string

The OCID of the compartment containing the alarm.

Optional definedTags

definedTags: undefined | object

Usage of predefined tag keys. These predefined keys are scoped to namespaces. Example: {@code {"Operations": {"CostCenter": "42"}}}

destinations

destinations: Array<string>

A list of destinations for alarm notifications. Each destination is represented by the OCID of a related resource, such as a NotificationTopic. Supported destination services: Notifications, Streaming. Limit: One destination per supported destination service.

displayName

displayName: string

A user-friendly name for the alarm. It does not have to be unique, and it's changeable. Avoid entering confidential information.

This value determines the title of each alarm notification.

Example: {@code High CPU Utilization}

Optional freeformTags

freeformTags: undefined | object

Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {@code {"Department": "Finance"}}

isEnabled

isEnabled: boolean

Whether the alarm is enabled.

Example: {@code true}

Optional isNotificationsPerMetricDimensionEnabled

isNotificationsPerMetricDimensionEnabled: undefined | false | true

When set to {@code true}, splits alarm notifications per metric stream. When set to {@code false}, groups alarm notifications across metric streams. Example: {@code true}

Optional messageFormat

messageFormat: MessageFormat

The format to use for alarm notifications. The formats are:

  • {@code RAW} - Raw JSON blob. Default value. When the {@code destinations} attribute specifies {@code Streaming}, all alarm notifications use this format.
  • {@code PRETTY_JSON}: JSON with new lines and indents. Available when the {@code destinations} attribute specifies {@code Notifications} only.
  • {@code ONS_OPTIMIZED}: Simplified, user-friendly layout. Available when the {@code destinations} attribute specifies {@code Notifications} only. Applies to Email subscription types only.

metricCompartmentId

metricCompartmentId: string

The OCID of the compartment containing the metric being evaluated by the alarm.

Optional metricCompartmentIdInSubtree

metricCompartmentIdInSubtree: undefined | false | true

When true, the alarm evaluates metrics from all compartments and subcompartments. The parameter can only be set to true when metricCompartmentId is the tenancy OCID (the tenancy is the root compartment). A true value requires the user to have tenancy-level permissions. If this requirement is not met, then the call is rejected. When false, the alarm evaluates metrics from only the compartment specified in metricCompartmentId. Default is false.

Example: {@code true}

namespace

namespace: string

The source service or application emitting the metric that is evaluated by the alarm.

Example: {@code oci_computeagent}

Optional notificationVersion

notificationVersion: undefined | string

The version of the alarm notification to be delivered. Allowed value: {@code 1.X} The value must start with a number (up to four digits), followed by a period and an uppercase X.

Optional overrides

overrides: Array<AlarmOverride>

A set of overrides that control evaluations of the alarm.

Each override can specify values for query, severity, body, and pending duration. When an alarm contains overrides, the Monitoring service evaluates each override in order, beginning with the first override in the array (index position {@code 0}), and then evaluates the alarm's base values ({@code ruleName} value of {@code BASE}).

Optional pendingDuration

pendingDuration: undefined | string

The period of time that the condition defined in the alarm must persist before the alarm state changes from "OK" to "FIRING". For example, a value of 5 minutes means that the alarm must persist in breaching the condition for five minutes before the alarm updates its state to "FIRING".

The duration is specified as a string in ISO 8601 format ({@code PT10M} for ten minutes or {@code PT1H} for one hour). Minimum: PT1M. Maximum: PT1H. Default: PT1M.

Under the default value of PT1M, the first evaluation that breaches the alarm updates the state to \"FIRING\".

The alarm updates its status to \"OK\" when the breaching condition has been clear for the most recent minute.

Example: {@code PT5M}

query

query: string

The Monitoring Query Language (MQL) expression to evaluate for the alarm. The Alarms feature of the Monitoring service interprets results for each returned time series as Boolean values, where zero represents false and a non-zero value represents true. A true value means that the trigger rule condition has been met. The query must specify a metric, statistic, interval, and trigger rule (threshold or absence). Supported values for interval depend on the specified time range. More interval values are supported for smaller time ranges. You can optionally specify dimensions and grouping functions. Supported grouping functions: {@code grouping()}, {@code groupBy()}. For information about writing MQL expressions, see Editing the MQL Expression for a Query. For details about MQL, see Monitoring Query Language (MQL) Reference. For available dimensions, review the metric definition for the supported service. See Supported Services.

Example of threshold alarm:

-----

CpuUtilization[1m]{availabilityDomain=\"cumS:PHX-AD-1\"}.groupBy(availabilityDomain).percentile(0.9) > 85

-----

Example of absence alarm:

-----

CpuUtilization[1m]{availabilityDomain=\"cumS:PHX-AD-1\"}.absent()

-----

Optional repeatNotificationDuration

repeatNotificationDuration: undefined | string

The frequency for re-submitting alarm notifications, if the alarm keeps firing without interruption. Format defined by ISO 8601. For example, {@code PT4H} indicates four hours. Minimum: PT1M. Maximum: P30D.

Default value: null (notifications are not re-submitted).

Example: {@code PT2H}

Optional resolution

resolution: undefined | string

The time between calculated aggregation windows for the alarm. Supported value: {@code 1m}

Optional resourceGroup

resourceGroup: undefined | string

Resource group that you want to match. A null value returns only metric data that has no resource groups. The alarm retrieves metric data associated with the specified resource group only. Only one resource group can be applied per metric. A valid resourceGroup value starts with an alphabetical character and includes only alphanumeric characters, periods (.), underscores (_), hyphens (-), and dollar signs ($). Avoid entering confidential information.

Example: {@code frontend-fleet}

Optional ruleName

ruleName: undefined | string

Identifier of the alarm's base values for alarm evaluation, for use when the alarm contains overrides. A valid ruleName value starts with an alphabetic character and includes only alphanumeric characters, underscores and square brackets. Minimum number of characters: 3. Default value is {@code BASE}. For information about alarm overrides, see {@link #alarmOverride(AlarmOverrideRequest) alarmOverride}.

severity

severity: string

The perceived type of response required when the alarm is in the "FIRING" state.

Example: {@code CRITICAL}

Optional suppression

suppression: model.Suppression

The configuration details for suppressing an alarm.

Functions

getDeserializedJsonObj

getJsonObj