App Connect

 View Only

Using IBM® App Connect to interact with Amazon CloudWatch

By Shahmini Arumugam posted Mon December 05, 2022 12:46 AM

  

Co-author – Srihari Ananda Kumar 

 

Amazon CloudWatch is a monitoring and management service that offers data and useful insights for on-premises, hybrid, and AWS resources and applications that run on AWS in real-time. CloudWatch can be used to collect and track metrics, which are the variables used to measure resources and applications.

Building a flow in IBM App Connect with Amazon CloudWatch

Use App Connect to build flows that integrate with Amazon CloudWatch and other applications. The connector is displayed as Amazon CloudWatch on the App Connect User Interface (UI). 

To allow App Connect to connect to your Amazon CloudWatch account, you need to fill in the connection fields that you see in the App Connect Designer Catalog page or flow editor.

For more information on connection fields and Templates gallery, see How to use App Connect with Amazon CloudWatch.

Amazon CloudWatch objects

The following are the Amazon CloudWatch objects that can be run in App Connect.

Objects

Description

Metrics          

Metrics are data of the system's performance.

Metric streams        

Metric streams are used to continually stream CloudWatch metrics to a destination of your choice, with near-real-time delivery and low latency.

Metric alarms          

A metric alarm watches a single CloudWatch metric or the result of a math expression based on CloudWatch metrics.

Composite alarms Composite alarms determine their states by monitoring the states of other alarms.

Log events

A log event is a record of activities recorded by AWS user-deployed applications or AWS-provisioned resources that are being monitored.

Log streams 

A log stream is a sequence of log events that share the same source. Each separate source of logs in CloudWatch Logs makes up a separate log stream.

Log groups    

A log group is a group of log streams that share the same retention, monitoring, and access control settings.

Export tasks Exports data from a log group to an Amazon S3 bucket.

Scenario 1: Trigger an alarm whenever the threshold is violated based on the Amazon CloudWatch published metric data

Consider this scenario where an alarm is triggered whenever the published metric data breaches the threshold value set in Amazon CloudWatch. For each threshold violation, an email gets sent to the intended recipient by AWS Simple Notification Service (SNS).




Make sure that you have configured the alarm threshold on your AWS endpoint before running the flow. You can configure the alarm threshold based on your requirements.
 

For this example, an alarm has been created with the threshold value set to 1 or greater for a period of 5 minutes. This means that if the flow fails more than once in 5 minutes, an alarm is triggered, and an email notification gets sent by AWS SNS.

For example, the following are the snippets taken from the AWS endpoint on the alarm conditions or rule:





 In this flow:

  1. The event-driven flow is triggered whenever a case is created in Salesforce.
  2. A Zendesk Service ticket is created based on the Salesforce case details.
  3. If the Zendesk Service ticket is created successfully, Amazon CloudWatch Publish custom metric data operation creates the metrics and namespace. If the metric and namespace exist, it then updates the record accordingly. It saves the Results as Success.

    For example:

  4. If the Zendesk Service ticket creation fails because the ticket is created with an incorrect or empty value, Amazon CloudWatch Publish custom metric data operation creates the metrics and namespace. If the metric and namespace exist, it then updates the record accordingly. It saves the Results as Failure.

    For example:


    In this case, the Zendesk Service ticket creation fails. Hence, Amazon CloudWatch publishes the custom metric data with the metric details in AWS. The metric is stored in AWS with Results as Failure

    An Add error catch option is added and configured to trigger the Amazon CloudWatch Publish custom metric data operation.

    By monitoring this metric data, AWS will trigger an alarm if the Add error catch is triggered more than once in 5 minutes. 
    When a threshold violation happens, an alarm is raised, and an email notification gets sent to the intended person by AWS SNS.


    For example:

Resources

Try out our templates

You can view the following use cases in the Templates gallery in your App Connect Designer instance.

  • Trigger an alarm whenever the threshold is violated based on the Amazon CloudWatch published metric data

    Template URL: https://<your-instance-id>/templates/Trigger%20an%20alarm%20whenever%20the%20threshold%20is%20violated%20based%20on%20the%20Amazon%20CloudWatch%20published%20metric%20data

You must enable the Designer AI features in your containerized environment in order to access the App Connect templates. For more information, see The preloaded IBM App Connect templates.

You can also import these use cases directly into your App Connect Designer. These templates are added to a public GitHub repository at https://github.com/ot4i/app-connect-templates/tree/cp4i-templates/resources.

0 comments
33 views

Permalink