Custom Metrics Walkthrough
Walk through common use cases with custom metrics: publishing, querying, creating an alarm, and triggering the alarm to observe its
Task 1: Publish Custom Metrics
Task 2: Query the Published Custom Metrics
Task 3: Create an Alarm
Create an alarm to get an email when the number of product orders (
productOrder) in a 5-minute time period is higher than 100.
The following instructions show how to use Basic mode in the Console. For basic alarm instructions, see Editing the MQL Expression When Creating an Alarm (for Advanced mode, including MQL) and Creating an Alarm (for CLI and API).
- Open the Create alarm page:
- Open the navigation menu and click Observability & Management. Under Monitoring, click Alarm Definitions.
- Click Create alarm.
- Provide values for the following fields:
- Alarm name (under Define alarm): Too Many Product Orders
- Alarm severity: Info
- Alarm body: High number of product orders received (over 100 in a five-minute period).
- Compartment (under Metric description): The compartment containing the resources that you want to monitor. By default, the first accessible compartment is selected.
- Metric namespace: mymetricsnamespace
- Resource group: divisionX
- Metric name: productOrder
- Interval: 5m
- Statistic: Sum
- Trigger rule:
- Operator: greater than
- Value: 100
- Trigger delay minutes: 1
- Destination (under Define alarm notifications): Select Notifications.
Create a topic: Provide values for the following fields:
- Topic name: extreme-product-order-volume
- Topic description: Channel to notify of high number of product orders received (over 100 in a five-minute period).
- Subscription protocol: Email
- Subscription email: (enter your email address)
The metric chart under the Define alarm section dynamically displays the last six hours of emitted metrics for
productOrderunder the resource group
- Click Save alarm.
Notifications sends a confirmation request to the email address configured in the new subscription.
- Confirm the new email subscription. See Confirming a Subscription.
Trigger the Alarm
Trigger the alarm to observe its
- Publish a set of data points to trigger the alarm. Send a request that shows over 100 orders within 5 minutes.
For instructions, see Publishing Custom Metrics.
- Get the alarm's details.
For instructions, see Getting an Alarm's Details.
The alarm is in
- Check your email.
For reference, see Email (Formatted) on the overview page.
The email indicates that the alarm is in