Monitoring: Alarm¶
Manage OCI Monitoring resources from Kubernetes. This page is generated from checked-in package metadata, CRD schemas, and sample manifests.
Resource Snapshot¶
| Field | Value |
|---|---|
| Service | monitoring |
| Resource | Alarm |
| API Version | monitoring.oracle.com/v1beta1 |
| Package | Monitoring |
| Support Status | Preview |
| Latest Released Version | v2.1.0-alpha |
| Install Namespace | oci-service-operator-monitoring-system |
Quick Links¶
- Resource Guide Index
- Setup Guide
- Package Page
- API Reference
- Spec Reference
- Status Reference
- Rendered Sample (
config/samples/monitoring_v1beta1_alarm.yaml)
Spec Fields¶
This summary shows the top-level spec fields. Use the full API reference for nested fields, defaults, and enum values.
| Field | Description | Type | Required |
|---|---|---|---|
alarmSummary |
Customizable alarm summary (alarmSummary alarm message parameter (https://docs.oracle.com/iaas/Content/Monitoring/alarm-message-format.htm)). Optionally include dynamic variables (https://docs.oracle.com/iaas/Content/Monitoring/Tasks/update-alarm-dynamic-variables.htm). The alarm summary appears within the body of the alarm message and in responses to ListAlarmsStatus GetAlarmHistory and RetrieveDimensionStates. |
string |
No |
body |
The human-readable content of the delivered alarm notification. Optionally include dynamic variables (https://docs.oracle.com/iaas/Content/Monitoring/Tasks/update-alarm-dynamic-variables.htm). Oracle recommends providing guidance to operators for resolving the alarm condition. Consider adding links to standard runbook practices. Avoid entering confidential information. Example: High CPU usage alert. Follow runbook instructions for resolution. |
string |
No |
compartmentId |
The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the alarm. | string |
Yes |
definedTags |
Usage of predefined tag keys. These predefined keys are scoped to namespaces. Example: {"Operations": {"CostCenter": "42"}} |
map[string, map[string, string]] |
No |
destinations |
A list of destinations for alarm notifications. Each destination is represented by the OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of a related resource, such as a NotificationTopic. Supported destination services: Notifications, Streaming. Limit: One destination per supported destination service. | list[string] |
Yes |
displayName |
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: High CPU Utilization |
string |
Yes |
evaluationSlackDuration |
Customizable slack period to wait for metric ingestion before evaluating the alarm. Specify a string in ISO 8601 format (PT10M for ten minutes or PT1H for one hour). Minimum: PT3M. Maximum: PT2H. Default: PT3M. For more information about the slack period, see About the Internal Reset Period (https://docs.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#reset). |
string |
No |
freeformTags |
Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"Department": "Finance"} |
map[string, string] |
No |
isEnabled |
Whether the alarm is enabled. Example: true |
boolean |
Yes |
isNotificationsPerMetricDimensionEnabled |
When set to true, splits alarm notifications per metric stream. When set to false, groups alarm notifications across metric streams. Example: true |
boolean |
No |
messageFormat |
The format to use for alarm notifications. The formats are: * RAW - Raw JSON blob. Default value. When the destinations attribute specifies Streaming, all alarm notifications use this format. * PRETTY_JSON: JSON with new lines and indents. Available when the destinations attribute specifies Notifications only. * ONS_OPTIMIZED: Simplified, user-friendly layout. Available when the destinations attribute specifies Notifications only. Applies to Email subscription types only. |
string |
No |
metricCompartmentId |
The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the metric being evaluated by the alarm. | string |
Yes |
metricCompartmentIdInSubtree |
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: true |
boolean |
No |
namespace |
The source service or application emitting the metric that is evaluated by the alarm. Example: oci_computeagent |
string |
Yes |
notificationTitle |
Customizable notification title (title alarm message parameter (https://docs.oracle.com/iaas/Content/Monitoring/alarm-message-format.htm)). Optionally include dynamic variables (https://docs.oracle.com/iaas/Content/Monitoring/Tasks/update-alarm-dynamic-variables.htm). The notification title appears as the subject line in a formatted email message and as the title in a Slack message. |
string |
No |
notificationVersion |
The version of the alarm notification to be delivered. Allowed value: 1.X The value must start with a number (up to four digits), followed by a period and an uppercase X. |
string |
No |
overrides |
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 0), and then evaluates the alarm's base values (ruleName value of BASE). |
list[object] |
No |
pendingDuration |
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 (PT10M for ten minutes or 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: PT5M |
string |
No |
query |
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. Also, you can customize the absence detection period (https://docs.oracle.com/iaas/Content/Monitoring/Tasks/create-edit-alarm-query-absence-detection-period.htm). Supported grouping functions: grouping(), groupBy(). For information about writing MQL expressions, see Editing the MQL Expression for a Query (https://docs.oracle.com/iaas/Content/Monitoring/Tasks/query-metric-mql.htm). For details about MQL, see Monitoring Query Language (MQL) Reference (https://docs.oracle.com/iaas/Content/Monitoring/Reference/mql.htm). For available dimensions, review the metric definition for the supported service. See Supported Services (https://docs.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#SupportedServices). 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() ----- Example of absence alarm with custom absence detection period of 20 hours: ----- CpuUtilization[1m]{availabilityDomain="cumS:PHX-AD-1"}.absent(20h) ----- |
string |
Yes |
repeatNotificationDuration |
The frequency for re-submitting alarm notifications, if the alarm keeps firing without interruption. Format defined by ISO 8601. For example, PT4H indicates four hours. Minimum: PT1M. Maximum: P30D. Default value: null (notifications are not re-submitted). Example: PT2H |
string |
No |
resolution |
The time between calculated aggregation windows for the alarm. Supported value: 1m |
string |
No |
resourceGroup |
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: frontend-fleet |
string |
No |
ruleName |
Identifier of the alarm's base values for alarm evaluation, for use when the alarm contains overrides. Default value is BASE. For information about alarm overrides, see AlarmOverride. |
string |
No |
severity |
The perceived type of response required when the alarm is in the "FIRING" state. Example: CRITICAL |
string |
Yes |
suppression |
The configuration details for suppressing an alarm. | object |
No |
Status Fields¶
This summary shows the top-level status fields. Use the full API reference for nested fields, defaults, and enum values.
| Field | Description | Type | Required |
|---|---|---|---|
alarmSummary |
Customizable alarm summary (alarmSummary alarm message parameter (https://docs.oracle.com/iaas/Content/Monitoring/alarm-message-format.htm)). Optionally include dynamic variables (https://docs.oracle.com/iaas/Content/Monitoring/Tasks/update-alarm-dynamic-variables.htm). The alarm summary appears within the body of the alarm message and in responses to ListAlarmsStatus GetAlarmHistory and RetrieveDimensionStates. |
string |
No |
body |
The human-readable content of the delivered alarm notification. Optionally include dynamic variables (https://docs.oracle.com/iaas/Content/Monitoring/Tasks/update-alarm-dynamic-variables.htm). Oracle recommends providing guidance to operators for resolving the alarm condition. Consider adding links to standard runbook practices. Avoid entering confidential information. Example: High CPU usage alert. Follow runbook instructions for resolution. |
string |
No |
compartmentId |
The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the alarm. | string |
No |
definedTags |
Usage of predefined tag keys. These predefined keys are scoped to namespaces. Example: {"Operations": {"CostCenter": "42"}} |
map[string, map[string, string]] |
No |
destinations |
A list of destinations for alarm notifications. Each destination is represented by the OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of a related resource, such as a NotificationTopic. Supported destination services: Notifications, Streaming. Limit: One destination per supported destination service. | list[string] |
No |
displayName |
A user-friendly name for the alarm. It does not have to be unique, and it's changeable. This value determines the title of each alarm notification. Example: High CPU Utilization |
string |
No |
evaluationSlackDuration |
Customizable slack period to wait for metric ingestion before evaluating the alarm. Specify a string in ISO 8601 format (PT10M for ten minutes or PT1H for one hour). Minimum: PT3M. Maximum: PT2H. Default: PT3M. For more information about the slack period, see About the Internal Reset Period (https://docs.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#reset). |
string |
No |
freeformTags |
Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"Department": "Finance"} |
map[string, string] |
No |
id |
The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the alarm. | string |
No |
isEnabled |
Whether the alarm is enabled. Example: true |
boolean |
No |
isNotificationsPerMetricDimensionEnabled |
When set to true, splits alarm notifications per metric stream. When set to false, groups alarm notifications across metric streams. |
boolean |
No |
lifecycleState |
The current lifecycle state of the alarm. Example: DELETED |
string |
No |
messageFormat |
The format to use for alarm notifications. The formats are: * RAW - Raw JSON blob. Default value. When the destinations attribute specifies Streaming, all alarm notifications use this format. * PRETTY_JSON: JSON with new lines and indents. Available when the destinations attribute specifies Notifications only. * ONS_OPTIMIZED: Simplified, user-friendly layout. Available when the destinations attribute specifies Notifications only. Applies to Email subscription types only. |
string |
No |
metricCompartmentId |
The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the metric being evaluated by the alarm. | string |
No |
metricCompartmentIdInSubtree |
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: true |
boolean |
No |
namespace |
The source service or application emitting the metric that is evaluated by the alarm. Example: oci_computeagent |
string |
No |
notificationTitle |
Customizable notification title (title alarm message parameter (https://docs.oracle.com/iaas/Content/Monitoring/alarm-message-format.htm)). Optionally include dynamic variables (https://docs.oracle.com/iaas/Content/Monitoring/Tasks/update-alarm-dynamic-variables.htm). The notification title appears as the subject line in a formatted email message and as the title in a Slack message. |
string |
No |
notificationVersion |
The version of the alarm notification to be delivered. Allowed value: 1.X The value must start with a number (up to four digits), followed by a period and an uppercase X. |
string |
No |
overrides |
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 0), and then evaluates the alarm's base values (ruleName value of BASE). |
list[object] |
No |
pendingDuration |
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 (PT10M for ten minutes or 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: PT5M |
string |
No |
query |
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. Also, you can customize the absence detection period (https://docs.oracle.com/iaas/Content/Monitoring/Tasks/create-edit-alarm-query-absence-detection-period.htm). Supported grouping functions: grouping(), groupBy(). For information about writing MQL expressions, see Editing the MQL Expression for a Query (https://docs.oracle.com/iaas/Content/Monitoring/Tasks/query-metric-mql.htm). For details about MQL, see Monitoring Query Language (MQL) Reference (https://docs.oracle.com/iaas/Content/Monitoring/Reference/mql.htm). For available dimensions, review the metric definition for the supported service. See Supported Services (https://docs.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#SupportedServices). 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() ----- Example of absence alarm with custom absence detection period of 20 hours: ----- CpuUtilization[1m]{availabilityDomain="cumS:PHX-AD-1"}.absent(20h) ----- |
string |
No |
repeatNotificationDuration |
The frequency for re-submitting alarm notifications, if the alarm keeps firing without interruption. Format defined by ISO 8601. For example, PT4H indicates four hours. Minimum: PT1M. Maximum: P30D. Default value: null (notifications are not re-submitted). Example: PT2H |
string |
No |
resolution |
The time between calculated aggregation windows for the alarm. Supported value: 1m |
string |
No |
resourceGroup |
Resource group to match for metric data retrieved by the alarm. A resource group is a custom string that you can match when retrieving custom metrics. 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 ($). Example: frontend-fleet |
string |
No |
ruleName |
Identifier of the alarm's base values for alarm evaluation, for use when the alarm contains overrides. Default value is BASE. For information about alarm overrides, see AlarmOverride. |
string |
No |
severity |
The perceived type of response required when the alarm is in the "FIRING" state. Example: CRITICAL |
string |
No |
status |
- | object |
Yes |
suppression |
The configuration details for suppressing an alarm. | object |
No |
timeCreated |
The date and time the alarm was created. Format defined by RFC3339. Example: 2023-02-01T01:02:29.600Z |
string |
No |
timeUpdated |
The date and time the alarm was last updated. Format defined by RFC3339. Example: 2023-02-03T01:02:29.600Z |
string |
No |
Sample Manifest¶
This example is generated from the checked-in sample manifest at config/samples/monitoring_v1beta1_alarm.yaml. Replace placeholder values before applying it.
#
# Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
#
#
# Replace the compartment OCIDs and destination OCID below before running e2e.
# Update spec.displayName or spec.query if you want to force a fresh create instead of
# binding to an existing Alarm with the same compartment and display name.
#
apiVersion: monitoring.oracle.com/v1beta1
kind: Alarm
metadata:
name: alarm-sample
spec:
displayName: osok-alarm-sample
compartmentId: ocid1.compartment.oc1..exampleuniqueID
metricCompartmentId: ocid1.compartment.oc1..exampleuniqueID
namespace: oci_computeagent
query: CpuUtilization[1m].mean() > 85
severity: CRITICAL
destinations:
- ocid1.onstopic.oc1..exampleuniqueID
isEnabled: true