Creating a notification channel
Creating a notification channel with users
To create a notification channel:
-
On the left side of the window, select the Notification channels section.
-
Click Create channel on the right of the page.
-
Specify the channel parameters:
-
Name. Enter a name for the channel.
-
Method. Specify the notification method.
-
Recipients. List notification recipients.
Note
To get notifications, the user must:
- Have the
monitoring.viewer
role for the folder the alert is configured in. - In the management console settings
:- Enable Monitoring.
- Specify an e-mail address, phone number, and Telegram account or group.
To specify a Telegram account or group:
-
Add the @YandexCloudNotify_bot
Telegram bot:- To contacts to send notifications in private messages
- To a group to send notifications to that group
-
Execute the
/start
command and copy the authorization code the bot generates in response. -
In the management console settings
, click Set up in the Telegram field. -
Paste the authentication code and click Confirm.
- Have the
-
-
Click Create. The channel will appear in the list.
Creating a notification channel that invokes a Cloud Functions function
Note
Currently, using a function in Cloud Functions for notifications is available for escalations only.
You can specify a Cloud Functions function for notification method. When an escalation fires, this function will be invoked.
To set up notifications with Cloud Functions:
- Create a function and a function version in the same folder where the escalation resides.
- In the settings, enable asynchronous invocation.
- Create a service account with the
functions.functionInvoker
andfunctions.viewer
roles. You will need that account to invoke your function. - Create an escalation and select the Cloud Functions notification method.
- In the Cloud function list, select the function you created earlier.
- In the Service account list, select the account that will be used to invoke the function.
Format of messages when invoking the Cloud Functions function
When the Cloud Functions function is invoked, it gets a message in JSON format:
{
"alertId": "",
"alertName": "",
"folderId": "",
"cloudId": "",
"status": "",
"annotations": {
"key1": "value1",
"key2": "value2"
}
}
alertId
: ID of the triggered alert (text).alertName
: Name of the triggered alert (text).folderId
: ID of the folder the alert was triggered in (text).cloudId
: ID of the cloud the alert was triggered in (text).status
: Alert status (text).annotations
: Values of annotations for the triggered alert (key:value
dictionary).