How To Set Up Notifications and Alerts in Apigee X Using GCP Console

Apigee X Using GCP Console

How To Set Up Notifications and Alerts in Apigee X Using GCP Console

Apigee X Using GCP Console

Written by Ali Akhtar

Technical Account Manager – Middleware

September 29, 2022

What is an Alert Policy?

Notifications and alerts play a significant role when it comes to critical business operations. Alert policies let you define a set of conditions that will generate a notification whenever the event is triggered. The notification can optionally contain documentation and metadata to provide additional information to the person receiving the alert. Alert Notification can be sent to a variety of channels including email, SMS, Slack, PagerDuty, Webhooks, Pub/Sub, and more.

Alerting capability creates awareness for the internal IT user to locate a problem while having a look at the cloud applications or infrastructure or resources so that the problem can be resolved quickly. Alerts are used to take a pre-emptive measure or a proactive approach to overcome the challenge.

In Apigee X, one of the key aspects of API Monitoring is to keep you up-to-speed with unusual events or patterns, such as spikes in traffic or latencies. To track such events, you may set up alerts that are activated when a specific event takes place in order to track the same. (An incident is a real event that causes an alarm to go off).

You can set up specific rules for an alert—for example, it might be triggered by a 500-response code (Internal Service Error) on a proxy. You may view the specifics of an incident that triggers an alert in the Events pane of the Cloud Console Alerting dashboard.

You can set up a notification alert in GCP. When an incident occurs, in order to facilitate further inquiry, Apigee provides a message with a summary of the event and links to the Cloud console and the Apigee UI.

There are 2 types of alerts in API Monitoring:

Icon

Metric-based alerts are triggered by changes in API metrics.

Icon

Log-based alerts are based on API data stored by Cloud logging.

Pre-Requisites for Setting up an Alert in GCP

You need to set up a billable project in Google Cloud Platform and create a billing for that. Once billing account is set up it will require for the permission from the Apigee instance. Using the Identity and Access Management feature of GCP, ensure that the permission is granted by the Apigee Organization Admin profile to access the GCP instance.

Billing

GCP Admin

GCP Admin

GCP

Once the GCP internal project is created user will be given permission to access Apigee under the following ownership role.

Assign Role of Apigee Org / Admin

Apigee

Metric-based alerting policies are alerting procedures that keep track of metric data gathered by Cloud Monitoring. Using the metric-based alerting policy we can create different alerts such as latency alert, throttling limit alerts, spike alert etc.

API

Initial Steps for Creating a Metric- Based Alert

You need to be assigned the given roles to set up alerts and notification channels:

  • roles/monitoring.alertPolicyEditor & roles/monitoring. notificationChannelEditor

There are 2 types of alerts in API Monitoring:

  • Metric-based alerts that are triggered by changes in API metrics.
  • Log-based alerts that are based on API data stored by Cloud logging.

Policy

Metric-Based Alerts:

Metric-based alerts are sent out when an API data metric hits a certain point or begins to fluctuate significantly. Two key properties are used to define an alert rule:

  • The metric: The quantity that triggers the alert for eg, the number of requests.
  • The threshold: The level that the metric must reach to trigger the alert.

Initial Steps for Creating a Metric-Based Alert:

  • Open the Create alerting policy dashboard in the Google Cloud Console in a new tab.
  • Click ADD CONDITION. This opens a new window where you can add the alert condition.

Condition

  • Optional: Add a title for the condition in the Untitled Condition field. We’ll leave it blank for this example, in which case the condition is given a default title.
  • Copy and paste the following in the Find resource type and metric field: Apigee proxy (v2)

The Target pane will appear as shown in the attached image.

Target

The pane displays the Select a metric field, where you can specify the metric, such as total traffic or latency percentile. After completing the initial steps above, you can continue by selecting a metric and adding conditions for the alert.

Editing the Alert Policy

Policy

Once the alert is created you can edit the alert policy by selecting the metric, add filter, or transform the data.

Create Different Policies

Policy

You can enable different policies in the Google Cloud Platform. You may also create log-based alerting policies, which notify you when a particular message appears in your logs. These policies are not based on metrics. This content does not apply to log-based alerting policies.

You can also explore different transformation and filter options of Metric explorer whenever needed.

Metrics Explorer

Metrics

Finally, this is how you will get incident details in GCP.

Incident Details

Incident

Royal Cyber has extensive knowledge in implementing and configuring Apigee custom alerts in GCP. With global implementation expertise in Apigee, we have the right set of people and processes in place to help your business in this digital transformation journey. For more information, you can email us at [email protected] or visit www.royalcyber.com.

Recent Blogs

  • How to Write Test Cases: Introduction and Best Practices
    Learn to write effective test cases. Master best practices, templates, and tips to enhance software …
    Read More »
  • MuleSoft Admin Co-Pilot: Revolutionize Integration Management
    In today’s fast-paced digital landscape, seamless data integration is crucial for business
    Read More »
  • Revolutionizing Customer Support with Salesforce Einstein GPT for Service Cloud
    Harness the power of AI with Salesforce Einstein GPT for Service Cloud. Unlock innovative ways …
    Read More »