Create and manage notification channels | Cloud Monitoring | Google Cloud, Form Email Notifications – Google Workspace Marketplace

Google notification

This section describes version 1.2 of the payload diagram. Certain fields may not appear in all returned packages or present empty values, depending on the configuration of the alert rule, the state of the incident or the monitored resource. Some fields use integrated structures as values. These structures are described by reference, because their content can also vary.

Create and manage notification channels

This document explains how to configure notification channels using the Google Cloud console. Cloud Monitoring uses these channels to warn you or send a notification to your on -call team when an alert rule is triggered. When you create an alert rule, you can select users who receive a notification by selecting them from the list of configured notification channels. For example, you can configure alerts that monitor Compute Engine instances to publish a Pub/Sub subject and warn the Slack channel of the on -call team.

If your favorite notification channel is not compatible, consider creating a pipeline that is based on sending notifications to pub/sub. To get a Python example using Flask, see the Create Personalized notifications page with Cloud Monitoring and Cloud Run. For other examples, see the Git Cloud-Alerting-Notification-Forwarding deposit.

To configure notification channels using the Cloud Monitoring API, see Create and manage API notification channels.

Noticed : Data sent to chain recipients may contain sensitive information. Consult your regulatory practices before creating the notification channel.

For more information on notifications of the alert rules, see the following pages:

  • For more information on the delay between the start of a problem and the creation of an alert, consult the latency section of notifications.
  • To find out more about the number of notifications generated for an alert rule, see the Incident Notifications section.

By default, an alert rule only sends notification to the creation of an incident. To receive a notification when the incident is open or closed, modify the alert rule. In the notifications section, select Notify the closure of the incident.

Before you start

To obtain the authorizations necessary to display and configure the notification channels using the Google Cloud console, ask your administrator to assign you the IAM editor monitoring role (Roles/Monitoring.Editor) on your project. To find out more about the allocation of roles, see the Manage access section.

You can also obtain the required authorizations via personalized roles or other predefined roles.

To find out more about Cloud Monitoring Roles, see the Control Access page with Identity and Access Management.

Create a notification channel

When you create an alert rule, you can select any notification channel configured and add it to your rule. You can preconfigure your notification channels, or configure them as part of the creation of an alert rule. For more information, see Create a channel on demand.

Noticed : We recommend that you create several notification channels for redundancy purposes. Google has no control over a large number of delivery systems after having transmitted the notification to them. In addition, only one Google service is compatible with Cloud Mobile App, Pagerduty, Webhooks and Slacks. If you use one of these notification channels, use redundant messaging, SMS or Pub/Sub.

To create a notification channel using the Google Cloud console, follow the specific instructions in the channel contained in the following table:

E-mail address

To add an e-mail notification channel, proceed as follows:

  1. In the Google Cloud console, select Monitoring, Then notificationsAlert, or click the following button: access the alert interface
  2. Click on Modify notification channels.
  3. In the section E-mail, click on New.
  4. Enter a single email address and a description.
  5. Click on Save.

If you use a group e-mail address as a notification channel for an alert rule, configure the group to accept e-mails from [email protected] .

You can create messaging channels when creating an alert rule. To find out more, see Create a chain on demand.

Mobile Application

Use the Google Cloud’s mobile application to monitor the resources of the Google Cloud console and monitoring information wherever you are. The notifications of the mobile application of the Google Cloud console are sent to a specific device or user:

List of notification channels for the mobile application of the Google Cloud console

  • The value Device (Device) indicates that notifications are only sent to the specific device that has created the notification channel. For device levels on the device scale, the field Display Name (Name to display) Includes device information.
  • User indicates that notifications are sent to all your devices on which the Google Cloud Console mobile application is installed.

Cloud Monitoring determines the scope of notifications when creating the channel. You can neither select nor modify the scope.

To configure a mobile application notification channel in the Google Cloud console for a specific Google Cloud project, proceed as follows:

  1. Install the Google Cloud Console mobile application from the application download platform for your mobile device.
  2. Select a project to display in the Google Cloud console mobile application. Once the project has been selected, an exchange of data between the application and the selected Google Cloud project occurs. A notification channel is created when there is no. After a few minutes, it is listed in the section Mobile devices of the page Notification channels.

To add your mobile device as a notification channel for an alert rule, go to the section Notifications and select Google Cloud Console (mobile), Then choose your mobile device from the list.

Pagerduty

Integration with Pagerduty allows unidirectional or bidirectional synchronization with monitoring. Regardless of your configuration, the following conditions apply:

  • When an incident is created in monitoring, a mirror incident is also open in Pagerduty.
  • You cannot use Pagerduty to close a monitoring incident.

If you use one -way synchronization and correct the incident in Pagerduty, the state of the incident in Pagerduty is dissociated from the state of the incident in monitoring. Indeed, if you resolve an incident in Pagerduty, it is definitely closed in Pagerduty and cannot be reopened.

If you use bidirectional synchronization, monitoring controls the state indicated by Pagerduty. If you correct the incident in Pagerduty and it is open by monitoring, the incident is reopened in Pagerduty.

To configure the notifications Pagerduty, proceed as follows:

  1. In Pagerduty : Create a pagerduty account on the pagerduty website.
  2. Add the Pagerduty notification channel:
    1. In the Google Cloud console, select Monitoring, Then notificationsAlert, or click the following button: access the alert interface
    2. Click on Modify notification channels.
    3. In the section Pagerduty, click on New.
    4. Enter it Display Name (Name to display). This name must correspond to the one provided to Pagerduty when you have added the integration.
    5. Enter it Integration service key generated by Pagerduty in the field Service key.
    6. Click on Save.
    1. Open Pagerduty
    2. Select Configuration, select Services, then the service name you entered when configuring integration.
    3. Click on Modify the parameters, select Create incidents, Then uncheck the box Create alerts and incidents.

    When you create an alert rule, select Pagerduty in the section Notifications And choose your PageRDUTY configuration.

    The JSON Pagerduty package is in the following format:

    To display an example and the Detail field scheme, develop the following sections.

    JSON examples

    By default, the alert backend is trying to generate a JSON package in version 1 format.2. To find out more about this formatting, see the next section.

    Here is an example of this type of package:

      < "incident": < "incident_id": "0.opqiw61fsv7p", "scoping_project_id": "internal-project", "scoping_project_number": 12345, "url": "https://console.cloud.google.com/monitoring/alerting/incidents/0.lxfiw61fsv7p?project=internal-project", "started_at": 1577840461, "ended_at": 1577877071, "state": "closed", "resource_id": "11223344", "resource_name": "internal-project gke-cluster-1-default-pool-e2df4cbd-dgp3", "resource_display_name": "gke-cluster-1-default-pool-e2df4cbd-dgp3", "resource_type_display_name": "VM Instance", "resource": < "type": "gce_instance", "labels": < "instance_id": "11223344", "project_id": "internal-project", "zone": "us-central1-c" >>, "Metric": < "type": "compute.googleapis.com/instance/cpu/utilization", "displayName": "CPU utilization", "labels": < "instance_name": "the name of the VM instance" >>, "metadata": < "system_labels": < "labelkey": "labelvalue" >, "User_labels": < "labelkey": "labelvalue" >>, "Policy_Name": "Monitor-Project-Cluster", "Policy_user_labels": < "user-label-1" : "important label", "user-label-2" : "another label" >, "Condition_name": "VM Instance - CPU Utilization [Max]", "Threshold_value": "0.9 "," observed_Value ":" 0.835 "," condition ": < "name": "projects/internal-project/alertPolicies/1234567890123456789/conditions/1234567890123456789", "displayName": "VM Instance - CPU utilization [MAX]", "conditionThreshold": < "filter": "metric.type=\\"compute.googleapis.com/instance/cpu/utilization\\" resource.type=\\"gce_instance\\" metadata.system_labels.\\"state\\"=\\"ACTIVE\\"", "aggregations": [ < "alignmentPeriod": "120s", "perSeriesAligner": "ALIGN_MEAN" >], "comparison": "comparison_gt", "thresholdvalue": 0.9, "Duration": "0s", "trigger": < "count": 1 >>>, "Documentation": < "content": "TEST ALERT\n\npolicy.name=projects/internal-project/alertPolicies/1234567890123456789\n\npolicy.display_name=Monitored-Project-NO-GROUPBY\n\ncondition.name=projects/nternal-project/alertPolicies/1234567890123456789/conditions/1234567890123456789\n\ncondition.display_name=VM Instance - CPU utilization [MAX]\n\nproject=internal-project\n\nresrouce.project=internal-project \n\nDONE\n", "mime_type": "text/markdown" >, "SUMMARY": "CPU UTILIZATION FOR INTERNAL-PROJECT GKE-CLUSTER-1-16-DEFAUL-E2DF4CBD-DGP3 With Metric Labels and System Labels RETURNED TO Normal with a value of 0.835.">," version ":" 1.2 "> 

    Scheme structure, version 1.2

    This section describes version 1.2 of the payload diagram. Certain fields may not appear in all returned packages or present empty values, depending on the configuration of the alert rule, the state of the incident or the monitored resource. Some fields use integrated structures as values. These structures are described by reference, because their content can also vary.

    In a returned package, the fields may appear in any order. In the following description, they are organized in related groups.

    <
    “version”: “1.2 “,
    “incident”:: < Incident information “incident_id” : chain ; ID generated for this incident.
    “scoping_project_id” : Channel, ID of the project that hosts the scope of metrics.
    “Scoping_Project_Number” : project number surveillance
    “URL” : channel, URL of the Google Cloud console for this incident.
    “Started_at” : Number, time (in seconds of the Epoch Unix) at which the incident was opened.
    “Ended_at” : number (in seconds Epoch Unix) during which the incident was closed. Only informed when State is closed .
    “State” : chain, condition of the incident: open or closed . If the value is open, Ended_at is zero.
    “Summary” : chain, textual summary of the incident generated.
    “apigee_url” : chain, apigee URL of this incident, only for the types of APIGEE Environment and Proxy* resources* .
    “Observed_Value” : chain, observed value having triggered/resolved the alert, can be empty if the condition has expired.

    Information on the monitored resource for which the incident was opened.

    “Resource”:: <
    “kind” : chain, identifier of the type of monitored resource subject to an alert (for example, GCE_INSTANCE; see list of monitored resources).
    “Labels” : Object/key-valley pairs for labels associated with the supervised resource.
    >,
    “Resource_type_display_name” : chain, name to display the type of monitored resource.
    “Resource_id” : chain, instance ID of the monitored resource, same value as Resource.labels.instance_id .
    “Resource_display_name” : chain, name to display supervised resources.
    “Resource_name” : chain, name generated for this supervised resource; Contains the values ​​of other fields.

    Information on the type of metric of time series data.

    “Metric”:: <
    “kind” : chain, identifier of the type of metric subject to an alert (for example, compute.googleapis.com/Instance/CPU/Utilization; See list of metrics).
    “Displayename” : chain, name to display metric type.
    “Labels” : Object/Value pairs for labels associated with metrics.
    >,
    “Metadata”:: <
    “System_labels” : Object/key-key pairs for system metadata labels.
    “User_labels” : object/key-key pairs for user metadata labels.
    >,

    Information on the alert rule and the condition that opened/resolved the incident.
    The values ​​are extracted from the alertpolicy object concerned.

    “Policy_name” : chain, name to display for the alert rule.
    “Policy_user_labels” : key/value pairs for all user wording associated with the rule.
    “documentation” : object, structure integrated in documentation format .
    “condition” : object, structure integrated in condition format .
    “condition_name” : chain, name to display condition, same value as condition.dispute .
    “Threshold_Value” : chain (threshold value of this condition) can be empty if the condition is not a threshold condition.
    >,
    >

    Rules relating to abandonment

    The payload scheme is subject to the regulations relating to the abandonment of Google Cloud described in section 1.4 (d) Terms of use of Google Cloud Platform. Note that the diagram does not control the formats of the generated field values ​​and that these formats may change without notice. For example, incident.Summary, incident.documentation.happy and incident.URL are intended to include data belonging to their fields, but the scheme has no constraints to guarantee a precise analysis of these fields. You can use the value as a whole and expect it to respect the regulations relating to abandonments, but do not rely on the analysis of the generated fields.

    Sms

    To configure notifications by SMS, proceed as follows:

    1. In the Google Cloud console, select Monitoring, Then notificationsAlert, or click the following button: access the alert interface
    2. Click on Modify notification channels.
    3. In the section Sms, click on Add.
    4. Inform the dialog box, then click on Save.

    When you configure your alert rule, select the type of notification Sms And choose a validated phone number from the list.

    Slack

    Noticed : To perform these steps, you must be the owner or administrator of Workspace Slack. For more information, see Manage invitation requests.

    Integration of monitoring with Slack allows your alert rules to publish data on a Slack channel when a incident is created. To configure Slack notifications, proceed as follows:

    1. In Slack : Create a workspace and a Slack channel on the Slack site. Save the channel URL.
    2. In the Google Cloud console, select Monitoring, Then notificationsAlert, or click the following button: access the alert interface
    3. Click on Modify notification channels.
    4. In the section Slack, click on Add To open the Slack connection page:
      1. Select your Slack workspace.
      2. Click on To allow To allow Cloud Monitoring to access your Slack workspace. This action brings you back to the monitoring configuration page of your notification channel.
      3. In the field Slack canal name, Enter the name of the Slack channel you want to use for notifications.
      4. In the field Cloud alert name, Enter a short investigation. Monitoring displays the value of this field on the page Notification channel.
      5. (Optional) to test the connection between Cloud Monitoring and your Slack workspace, click on Send a test message. If the connection results, a message this is a test alert notification. is displayed in the Slack notification channel that you specified. Consult the notification channel to confirm the reception.
      /prompt @google cloud monitoring

      When you create an alert rule, select Slack in the section Notifications And choose your Slack configuration.

      Webhooks

      Noticed: Webhooks are only compatible with public termination points. If you need the notifications to be sent to a non -public termination point, create a Pub/Sub notification channel and configure a subscription to the Pub/Sub. For more information, see the failure section of webhook notifications when configured for a private termination point.

      Noticed: If a cloud function is configured as a webhook termination point for a notification channel, make sure that the user calling the function has the required authentication authorization. To find out more, consult the sections Authentify functions for function calls and activate access to a function.

      Attention: To receive notifications with Google Cat, deploy a Cloud Run service and send your notifications to ad. For an example of this configuration, see Create personalized notifications with Cloud Monitoring and Cloud Run.

      Do not configure a webhook notification, then configure Google Cat to use this webhook.

      To configure the notifications by webhook, proceed as follows:

      1. Webhooks manager : Identify the URL of the public termination point which will receive data from monitoring webhooks.
      2. In the Google Cloud console, select Monitoring, Then notificationsAlert, or click the following button: access the alert interface
      3. Click on Modify notification channels.
      4. In the section Webhook, click on Add.
      5. Fill the dialog box.
      6. Click on Test the connection To send a test charge of test at the end point of the webhook. You can access the reception termination point to check the broadcast.
      7. Click on Save.

      When you create an alert rule, select Webhook in the section Notifications And choose your webhook configuration. The notifications sent by Error Reporting follow diagram 1.0, while those sent by monitoring follow diagram 1.2:

      JSON examples

      By default, the alert backend is trying to generate a JSON package in version 1 format.2. To find out more about this formatting, see the next section.

      Here is an example of this type of package:

        < "incident": < "incident_id": "0.opqiw61fsv7p", "scoping_project_id": "internal-project", "scoping_project_number": 12345, "url": "https://console.cloud.google.com/monitoring/alerting/incidents/0.lxfiw61fsv7p?project=internal-project", "started_at": 1577840461, "ended_at": 1577877071, "state": "closed", "resource_id": "11223344", "resource_name": "internal-project gke-cluster-1-default-pool-e2df4cbd-dgp3", "resource_display_name": "gke-cluster-1-default-pool-e2df4cbd-dgp3", "resource_type_display_name": "VM Instance", "resource": < "type": "gce_instance", "labels": < "instance_id": "11223344", "project_id": "internal-project", "zone": "us-central1-c" >>, "Metric": < "type": "compute.googleapis.com/instance/cpu/utilization", "displayName": "CPU utilization", "labels": < "instance_name": "the name of the VM instance" >>, "metadata": < "system_labels": < "labelkey": "labelvalue" >, "User_labels": < "labelkey": "labelvalue" >>, "Policy_Name": "Monitor-Project-Cluster", "Policy_user_labels": < "user-label-1" : "important label", "user-label-2" : "another label" >, "Condition_name": "VM Instance - CPU Utilization [Max]", "Threshold_value": "0.9 "," observed_Value ":" 0.835 "," condition ": < "name": "projects/internal-project/alertPolicies/1234567890123456789/conditions/1234567890123456789", "displayName": "VM Instance - CPU utilization [MAX]", "conditionThreshold": < "filter": "metric.type=\\"compute.googleapis.com/instance/cpu/utilization\\" resource.type=\\"gce_instance\\" metadata.system_labels.\\"state\\"=\\"ACTIVE\\"", "aggregations": [ < "alignmentPeriod": "120s", "perSeriesAligner": "ALIGN_MEAN" >], "comparison": "comparison_gt", "thresholdvalue": 0.9, "Duration": "0s", "trigger": < "count": 1 >>>, "Documentation": < "content": "TEST ALERT\n\npolicy.name=projects/internal-project/alertPolicies/1234567890123456789\n\npolicy.display_name=Monitored-Project-NO-GROUPBY\n\ncondition.name=projects/nternal-project/alertPolicies/1234567890123456789/conditions/1234567890123456789\n\ncondition.display_name=VM Instance - CPU utilization [MAX]\n\nproject=internal-project\n\nresrouce.project=internal-project \n\nDONE\n", "mime_type": "text/markdown" >, "SUMMARY": "CPU UTILIZATION FOR INTERNAL-PROJECT GKE-CLUSTER-1-16-DEFAUL-E2DF4CBD-DGP3 With Metric Labels and System Labels RETURNED TO Normal with a value of 0.835.">," version ":" 1.2 "> 

      Scheme structure, version 1.2

      This section describes version 1.2 of the payload diagram. Certain fields may not appear in all returned packages or present empty values, depending on the configuration of the alert rule, the state of the incident or the monitored resource. Some fields use integrated structures as values. These structures are described by reference, because their content can also vary.

      In a returned package, the fields may appear in any order. In the following description, they are organized in related groups.

      <
      “version”: “1.2 “,
      “incident”:: < Incident information “incident_id” : chain ; ID generated for this incident.
      “scoping_project_id” : Channel, ID of the project that hosts the scope of metrics.
      “Scoping_Project_Number” : project number surveillance
      “URL” : channel, URL of the Google Cloud console for this incident.
      “Started_at” : Number, time (in seconds of the Epoch Unix) at which the incident was opened.
      “Ended_at” : number (in seconds Epoch Unix) during which the incident was closed. Only informed when State is closed .
      “State” : chain, condition of the incident: open or closed . If the value is open, Ended_at is zero.
      “Summary” : chain, textual summary of the incident generated.
      “apigee_url” : chain, apigee URL of this incident, only for the types of APIGEE Environment and Proxy* resources* .
      “Observed_Value” : chain, observed value having triggered/resolved the alert, can be empty if the condition has expired.

      Information on the monitored resource for which the incident was opened.

      “Resource”:: <
      “kind” : chain, identifier of the type of monitored resource subject to an alert (for example, GCE_INSTANCE; see list of monitored resources).
      “Labels” : Object/key-valley pairs for labels associated with the supervised resource.
      >,
      “Resource_type_display_name” : chain, name to display the type of monitored resource.
      “Resource_id” : chain, instance ID of the monitored resource, same value as Resource.labels.instance_id .
      “Resource_display_name” : chain, name to display supervised resources.
      “Resource_name” : chain, name generated for this supervised resource; Contains the values ​​of other fields.

      Information on the type of metric of time series data.

      “Metric”:: <
      “kind” : chain, identifier of the type of metric subject to an alert (for example, compute.googleapis.com/Instance/CPU/Utilization; See list of metrics).
      “Displayename” : chain, name to display metric type.
      “Labels” : Object/Value pairs for labels associated with metrics.
      >,
      “Metadata”:: <
      “System_labels” : Object/key-key pairs for system metadata labels.
      “User_labels” : object/key-key pairs for user metadata labels.
      >,

      Information on the alert rule and the condition that opened/resolved the incident.
      The values ​​are extracted from the alertpolicy object concerned.

      “Policy_name” : chain, name to display for the alert rule.
      “Policy_user_labels” : key/value pairs for all user wording associated with the rule.
      “documentation” : object, structure integrated in documentation format .
      “condition” : object, structure integrated in condition format .
      “condition_name” : chain, name to display condition, same value as condition.dispute .
      “Threshold_Value” : chain (threshold value of this condition) can be empty if the condition is not a threshold condition.
      >,
      >

      Basic authentication

      In addition to the request of webhook, Cloud Monitoring sends the username and password in accordance with the HTTP specification of basic authentication. Cloud Monitoring requires your server to return a 401 response with the appropriate www-authenticate header. For more information on basic authentication, see the following resources:

      Token authentication

      Authentication by token requires a request chain parameter in the URL of the termination point as well as the key that the server expects to be secret between itself and monitoring. You will find below an example of URL including a token:

      If Monitoring publishes an incident on the URL of the termination point, your server can validate the associated token. This authentication method is more effective when used with SSL/TLS to encrypt the HTTP request in order to prevent computer hackers from learning the token.

      To get an example of a python server, see this server example.

      Rules relating to abandonment

      The payload scheme is subject to the regulations relating to the abandonment of Google Cloud described in section 1.4 (d) Terms of use of Google Cloud Platform. Note that the diagram does not control the formats of the generated field values ​​and that these formats may change without notice. For example, incident.Summary, incident.documentation.happy and incident.URL are intended to include data belonging to their fields, but the scheme has no constraints to guarantee a precise analysis of these fields. You can use the value as a whole and expect it to respect the regulations relating to abandonments, but do not rely on the analysis of the generated fields.

      Pub/Sub

      This section explains how to configure Pub/Sub notification channels. To ensure redundancy, we recommend that you create several notification channels. We recommend that you associate advertising/sub to the mobile application of the Google Cloud console, Pagerduty, Webhooks or Slacks, because Pub/SU uses a different distribution mechanism.

      To configure an pub/sub notification channel:

      1. Activate the Pub/Sub API and create a subject
      2. Configure the notification channel for a subject
      3. Authorize a service account
      4. Define the notification channel in an alert rule

      To understand the data scheme, see example of a diagram.

      To receive alert notifications, you must also create one of the following subscriptions: sweater, push or bigquery.

      When the subscription is in a project different from that of the subject, create a service account in the subscriber project and attribute the role roles/pubsub.subcribe .

      Before you start

      When you add the first notification channel for a Google Cloud project, Cloud Monitoring creates a service account for this project. He also gives the role Identity and Access Management Service Service Agent Monitoring in the Service Account. This service account allows monitoring to send notifications to notification channels based on PUB/SU of this project.

      The service account has the following format:

      service-Project_Number@GCP-SA-MONITORING-NOTIFICATION.I am.GSERVICEACCOUNT.com

      The name of the notification service account includes a number Google Cloud project. You will find the name, ID and project number in the project dashboard in the Google Cloud console. You can also recover it using the following command:

      Gcloud Projects Describe Project_id --Format = "Value (Project_Number)"

      You can display and modify the service account using the Google Cloud console or Google Cloud.

      Activate the Pub/Sub API and create a subject

      1. Activate the PUB/SUP API for your Google Cloud project:
        Activate the Pub/Sub API
        1. Select the Google Cloud project in which you plan to create the Pub/Sub subject.
        2. Click on Enable When it appears. No action is required when the message API activated appears.
        GCLOUD PUBSUB TOPICS CREATE NotificationTOPIC

        Then configure your Pub/Sub notification channels.

        Configure notifications for a subject

        To create an advertising/sub notification channel, you can use the monitoring, google cloud cl cl or the Google Cloud console. After creating the notification channel, authorize the notifications service account to publish each subject you use as a notification channel.

        For more information on using the monitoring or Google Cloud API to create the notification channel, see Create channels.

        To create the notification channel using the Google Cloud console, proceed as follows:

        1. In the Google Cloud console, select Monitoring, Then notificationsAlert, or click the following button: access the alert interface
        2. Select the Google Cloud project which contains the Pub/Sub subject you created.
        3. Click on Modify notification channels.
        4. In the section Pub/Sub, click on New. The dialog box Created Pub/Sub Channel (PUB/SUB canal) displays the name of the service account created by Monitoring.
        5. Authorize the service account. Your service account can publish all subjects or specific subjects:
          • To publish all subjects, select Manage roles and add the role Publisher pub/sub. Once you have finished the configuration of the notification channel, ignore the next section, entitled Authorize the service account, and go to the Define the notification channel in an alert rule.
          • To publish specific subjects, go to the next step and authorize the service account to publish specific subjects once the notification channel is configured. To obtain instructions, see the section Authorize the service account.
        6. Enter a name to display for your channel and the name of the Pub/Sub subject.
        7. (Optional) to verify that the channel is properly configured, click on Send a test notification.
        8. Select Add a chain.

        Then allow the service account.

        Authorize the service account

        Noticed : Perform this step when you create the notification channel using the API or Google Cloud Cli, and when you have ignored the authorization step when you use the Google Cloud console.

        Authorization allows the notification service account to publish each PUB/SU subject that you use as a notification channel. This section describes the procedure to follow for:

        • Authorize a service account for a specific subject.
        • Allow a service account for all subjects.
        Authorize a service account for a specific subject

        You can allow a service account to publish a specific subject using the Google Cloud console and Google Cloud. This section describes both approaches.

        To authorize your service account for a specific subject using the Google Cloud console, proceed as follows:

        1. In the Google Cloud console, select Pub/Sub, Then Themes, or click on the following button: Access the PUB/SUP topics
        2. Select the subject.
        3. In the tab Authorizations, select Add a main account.
        4. In the field New main account, Enter the name of the notifications service account. The service account uses the following denomination agreement:

        service-Project_Number@GCP-SA-MONITORING-NOTIFICATION.I am.GSERVICEACCOUNT.com

        To authorize your service account for a specific subject using Google Cloud Cli, assign the IAM Pubsub role in the service account.Publisher for the subject. For example, the following command configures the IAM role for the notificationtopic subject:

        GCLOUD PUBSUB TOPICS ADD-IAM-POLICY-BINDING \ Projects/Project_Number/Topics/NotificationTOPIC -ROLE = ROLES/PUBSUB.Publisher \ --Member = Service -Count: Service-Project_Number@GCP-SA-MONITORING-NOTIFICATION.I am.GSERVICEACCOUNT.com

        The response to a successful execution of the Add-Iam-Policy-Binding command presents itself as follows:

        Updated iam Policy for Topic [NotificationTOPIC]. Bindings: ‐ Members: ‐ Service -discover: Service-Project_Number@GCP-SA-MONITORING-NOTIFICATION.I am.GSERVICEACCOUNT.Com Role: Roles/Pubsub.Publisher Etag: BWWCDOIW1PC = version: 1

        To find out more, see the Pubsub Topics Add-Jeam-Policy-Binding reference page .

        Authorize a service account for all subjects

        To authorize your service account for all subjects, proceed as follows:

        Select the option

        1. In the Google Cloud console, select I AM or click the following button: access IAM
        2. Select Include the attributions of roles provided by Google, as illustrated in the following image:
        3. Look for the service account in the following format:

        service-Project_Number@GCP-SA-MONITORING-NOTIFICATION.I am.GSERVICEACCOUNT.com

        Then define the notification channel in an alert rule.

        Define the notification channel in an alert rule

        To use a PUB/SU notification channel in an alert rule, select the type of channel Pub/Sub, Then the subject.

        Example of diagram

        To display an example of JSON package and the diagram, develop the following sections.

        JSON examples

        By default, the alert backend is trying to generate a JSON package in version 1 format.2. To find out more about this formatting, see the next section.

        Here is an example of this type of package:

          < "incident": < "incident_id": "0.opqiw61fsv7p", "scoping_project_id": "internal-project", "scoping_project_number": 12345, "url": "https://console.cloud.google.com/monitoring/alerting/incidents/0.lxfiw61fsv7p?project=internal-project", "started_at": 1577840461, "ended_at": 1577877071, "state": "closed", "resource_id": "11223344", "resource_name": "internal-project gke-cluster-1-default-pool-e2df4cbd-dgp3", "resource_display_name": "gke-cluster-1-default-pool-e2df4cbd-dgp3", "resource_type_display_name": "VM Instance", "resource": < "type": "gce_instance", "labels": < "instance_id": "11223344", "project_id": "internal-project", "zone": "us-central1-c" >>, "Metric": < "type": "compute.googleapis.com/instance/cpu/utilization", "displayName": "CPU utilization", "labels": < "instance_name": "the name of the VM instance" >>, "metadata": < "system_labels": < "labelkey": "labelvalue" >, "User_labels": < "labelkey": "labelvalue" >>, "Policy_Name": "Monitor-Project-Cluster", "Policy_user_labels": < "user-label-1" : "important label", "user-label-2" : "another label" >, "Condition_name": "VM Instance - CPU Utilization [Max]", "Threshold_value": "0.9 "," observed_Value ":" 0.835 "," condition ": < "name": "projects/internal-project/alertPolicies/1234567890123456789/conditions/1234567890123456789", "displayName": "VM Instance - CPU utilization [MAX]", "conditionThreshold": < "filter": "metric.type=\\"compute.googleapis.com/instance/cpu/utilization\\" resource.type=\\"gce_instance\\" metadata.system_labels.\\"state\\"=\\"ACTIVE\\"", "aggregations": [ < "alignmentPeriod": "120s", "perSeriesAligner": "ALIGN_MEAN" >], "comparison": "comparison_gt", "thresholdvalue": 0.9, "Duration": "0s", "trigger": < "count": 1 >>>, "Documentation": < "content": "TEST ALERT\n\npolicy.name=projects/internal-project/alertPolicies/1234567890123456789\n\npolicy.display_name=Monitored-Project-NO-GROUPBY\n\ncondition.name=projects/nternal-project/alertPolicies/1234567890123456789/conditions/1234567890123456789\n\ncondition.display_name=VM Instance - CPU utilization [MAX]\n\nproject=internal-project\n\nresrouce.project=internal-project \n\nDONE\n", "mime_type": "text/markdown" >, "SUMMARY": "CPU UTILIZATION FOR INTERNAL-PROJECT GKE-CLUSTER-1-16-DEFAUL-E2DF4CBD-DGP3 With Metric Labels and System Labels RETURNED TO Normal with a value of 0.835.">," version ":" 1.2 "> 

        Scheme structure, version 1.2

        This section describes version 1.2 of the payload diagram. Certain fields may not appear in all returned packages or present empty values, depending on the configuration of the alert rule, the state of the incident or the monitored resource. Some fields use integrated structures as values. These structures are described by reference, because their content can also vary.

        In a returned package, the fields may appear in any order. In the following description, they are organized in related groups.

        <
        “version”: “1.2 “,
        “incident”:: < Incident information “incident_id” : chain ; ID generated for this incident.
        “scoping_project_id” : Channel, ID of the project that hosts the scope of metrics.
        “Scoping_Project_Number” : project number surveillance
        “URL” : channel, URL of the Google Cloud console for this incident.
        “Started_at” : Number, time (in seconds of the Epoch Unix) at which the incident was opened.
        “Ended_at” : number (in seconds Epoch Unix) during which the incident was closed. Only informed when State is closed .
        “State” : chain, condition of the incident: open or closed . If the value is open, Ended_at is zero.
        “Summary” : chain, textual summary of the incident generated.
        “apigee_url” : chain, apigee URL of this incident, only for the types of APIGEE Environment and Proxy* resources* .
        “Observed_Value” : chain, observed value having triggered/resolved the alert, can be empty if the condition has expired.

        Information on the monitored resource for which the incident was opened.

        “Resource”:: <
        “kind” : chain, identifier of the type of monitored resource subject to an alert (for example, GCE_INSTANCE; see list of monitored resources).
        “Labels” : Object/key-valley pairs for labels associated with the supervised resource.
        >,
        “Resource_type_display_name” : chain, name to display the type of monitored resource.
        “Resource_id” : chain, instance ID of the monitored resource, same value as Resource.labels.instance_id .
        “Resource_display_name” : chain, name to display supervised resources.
        “Resource_name” : chain, name generated for this supervised resource; Contains the values ​​of other fields.

        Information on the type of metric of time series data.

        “Metric”:: <
        “kind” : chain, identifier of the type of metric subject to an alert (for example, compute.googleapis.com/Instance/CPU/Utilization; See list of metrics).
        “Displayename” : chain, name to display metric type.
        “Labels” : Object/Value pairs for labels associated with metrics.
        >,
        “Metadata”:: <
        “System_labels” : Object/key-key pairs for system metadata labels.
        “User_labels” : object/key-key pairs for user metadata labels.
        >,

        Information on the alert rule and the condition that opened/resolved the incident.
        The values ​​are extracted from the alertpolicy object concerned.

        “Policy_name” : chain, name to display for the alert rule.
        “Policy_user_labels” : key/value pairs for all user wording associated with the rule.
        “documentation” : object, structure integrated in documentation format .
        “condition” : object, structure integrated in condition format .
        “condition_name” : chain, name to display condition, same value as condition.dispute .
        “Threshold_Value” : chain (threshold value of this condition) can be empty if the condition is not a threshold condition.
        >,
        >

        Rules relating to abandonment

        The payload scheme is subject to the regulations relating to the abandonment of Google Cloud described in section 1.4 (d) Terms of use of Google Cloud Platform. Note that the diagram does not control the formats of the generated field values ​​and that these formats may change without notice. For example, incident.Summary, incident.documentation.happy and incident.URL are intended to include data belonging to their fields, but the scheme has no constraints to guarantee a precise analysis of these fields. You can use the value as a whole and expect it to respect the regulations relating to abandonments, but do not rely on the analysis of the generated fields.

        Create a chain on demand

        When you add a notification channel to an alert rule, you must select a channel in a list. To update the list of options when you create an alert rule, proceed as follows:

        Notification dialog box displaying the updating and channel management buttons

        1. In the notification dialog box, click on Channel Notification Manage (Manage notification channels). You are redirected to the window Channel notification (Notification channels) of a new tab.
        2. To add a new notification channel, search for its type, click on New, Then follow the instructions specific to the channel appearing in the previous table.
        3. Return to the original tab and, in the notification dialog box, click on refreshUpdate .
        4. Select the notification channel from the updated list.

        Test a notification channel

        Cloud Monitoring does not test the notification channels. However, you can verify that a notification channel is properly configured by creating an alert rule and configuring the condition for it to be triggered.

        For example, you can check the configuration of your notification channels by applying the following procedure:

        1. If your Google Cloud project does not include a compute Engine instance, create a.
        2. Create an alert rule to monitor the use of the processor by this body. If your Google Cloud project contains several instances, add a filter to select a single instance.
        3. Configure the fields of condition trigger as following:
          1. Select Threshold in the field Condition type.
          2. Select Lower than the threshold for the field Threshold position.
          3. Select a value greater than the use of the processor for your instance. For example, if the graph indicates that the use of the processor is approximately 5%, define the threshold on 10%.
          4. Develop Advanced options, Then select No new tests for the field Longest window.

          These parameters configure the rule so that it is triggered when the use of the processor of a compute Engine instance is below the specified threshold. Since you have selected a threshold higher than the use of the processor of your instance, the condition is triggered.

          Edit and delete notification channels

          To modify or delete a notification channel using the Google Cloud console, proceed as follows:

          1. In the Google Cloud console, select Monitoring, Then notificationsAlert, or click the following button: access the alert interface
          2. Click on Modify notification channels. The dashboard of Notification channels Contains a section for each type of notification channel. Each section lists all configurations for this type:
            • To modify an input, click on editTo modify. Click on Save Once the changes made.
            • To delete an input, click Delete DELETE. Click on DELETE in the confirmation dialog box.

          Show the newspapers of the notification channel

          You can use the newspaper explorer to display errors in the notification channel:

          1. In the Google Cloud console, select Logging, Then Newspaper explorer, or click the following button: access the newspaper explorer
          2. Enter and run your request. For specific requests for errors in notification channels, see the Cloud Monitoring Requests section.

          Comment

          Unless otherwise indicated, the content of this page is governed by a Creative Commons Assignment 4 license.0, and code samples are governed by a Apache 2 license.0. For more information, see the rules of the Google Developers site. Java is a registered trademark of Oracle and/or its affiliated companies.

          Last update on 2023/08/26 (UTC).

          Google notification

          Icon app

          Form Email Notifications

          Send emails, generate PDF, certificates, invoices, news letters, professional documents, integrate them in Slack, Zappier, Google Chat or other applications.

          Update sheet: September 20, 2023

          More information on user reviews

          Using "Form Email Notifications" (by Form Notify), you can send personalized email notifications, generate invoices, certificates, newsletters, commercial letters and other PDFs and perfect documents. You can find detailed information on what the additional module can do for you by visiting our Form Notify https website: // www.formnotify.com/Product By using this, you (owner of the form) can - warn anyone by automatically sending a rich HTML e -mail - Create, configure and personalize the notification by e -mail for formal respondents - Send an E -mail personalized to respondents and other employees - Generate perfect PDFs to the nearest pixel, such as an invoice, a newsletter, a certificate, a commercial letter or any other professional aspect document - Limit the form by opening and By closing according to a specific date and/or an hour of recurring time - return the past responses of the form - Configure several processors that can send emails to different recipients - temporarily suspend the sending of notifications - Pain the generation of the document -Join a PDF to your e -mail notifications - Use expressions to customize the value according to the form responses - Integrate the QR code into the e -mail - Import and export your configured data - Warn all the people you want By configuring web hooks and integrating them into applications such as Google Chat, Slack, Zappier, IFTTTT or other Web Services - Notify users by phone via PUSH notification - Integration with any application using HTTP REST. - Import and export of web hooks - Send the quiz scores to parents as part of the notification - Keep the form open during certain periods developed by notification form (https: // Formnotify.com) To report problems with this additional module, please visit https: // forms.Gle/TSMVVAFVWLJEXAAV7

          Additional Information

          Not available prices

          Confidentiality

          Terms of use

          Form Email Notifications will ask you for the authorizations below. Learn more

          Form email notifications will need to access your Google account

          Form email notifications may thus carry out the following actions:

          Consult, modify, create and delete all your Google Docs documents

          Show, create and delete your own configuration data in Google Drive

          Show, create and delete your own configuration data in Google Drive

          Consult, modify, create and delete only the specific Google Drive files that you use with this application

          Show and manage the forms in which this application has been installed

Thanks! You've already liked this
No comments