

# Detect common application problems with CloudWatch Application Insights
CloudWatch Application InsightsAmazon CloudWatch Application Insights support for containerized applications and microservices from the Container Insights console.

You can display CloudWatch Application Insights detected problems for Amazon ECS and Amazon EKS on your Container Insights dashboard.Amazon CloudWatch Application Insights monitoring for SAP HANA databases.

You can monitor SAP HANA databases with Application Insights.Amazon CloudWatch Application Insights support for monitoring all resources in an account.

You can onboard and monitor all resources in an account.Amazon CloudWatch Application Insights support for Amazon FSx.

You can monitor metrics retrieved from Amazon FSx.Amazon CloudWatch Application Insights support for setting up container monitoring.

You can monitor containers using best practices with Amazon CloudWatch Application Insights.Amazon CloudWatch Application Insights monitoring for Oracle databases on Amazon RDS and Amazon EC2.

You can monitor metrics and logs retrieved from Oracle with Amazon CloudWatch Application Insights.Amazon CloudWatch Application Insights monitoring for Prometheus JMX exporter metrics.

You can monitor metrics retrieved from Prometheus JMX exporter with Amazon CloudWatch Application Insights.Amazon CloudWatch Application Insights monitoring for Aurora for MySQL database clusters.

You can monitor Aurora for MySQL database clusters (RDS Aurora) with Amazon CloudWatch Application Insights.CloudFormation support for Amazon CloudWatch Application Insights applications.

You can add CloudWatch Application Insights monitoring, including key metrics and telemetry, to your application, database, and web server, directly from CloudFormation templates.Set up monitors for .NET applications using SQL Server on the backend with CloudWatch Application Insights

You can use the documentation tutorial to help you to set up monitors for .NET applications using SQL Server on the backend with CloudWatch Application Insights.Amazon CloudWatch Application Insights monitoring for Postgre SQL on Amazon RDS and Amazon EC2.

You can monitor applications built with PostgreSQL running on Amazon RDS or Amazon EC2.

You can use Amazon CloudWatch Application Insights to detect problems with your applications. CloudWatch Application Insights facilitates observability for your applications and underlying AWS resources. It helps you set up the best monitors for your application resources to continuously analyze data for signs of problems with your applications. Application Insights, which is powered by [SageMaker](https://docs.aws.amazon.com/sagemaker/latest/dg/wahtis.html) and other AWS technologies, provides automated dashboards that show potential problems with monitored applications, which help you to quickly isolate ongoing issues with your applications and infrastructure. The enhanced visibility into the health of your applications that Application Insights provides helps reduce mean time to repair (MTTR) to troubleshoot your application issues.

When you add your applications to Amazon CloudWatch Application Insights, it scans the resources in the applications and recommends and configures metrics and logs on [CloudWatch](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/WhatIsCloudWatch.html) for application components. Example application components include SQL Server backend databases and Microsoft IIS/Web tiers. Application Insights analyzes metric patterns using historical data to detect anomalies, and continuously detects errors and exceptions from your application, operating system, and infrastructure logs. It correlates these observations using a combination of classification algorithms and built-in rules. Then, it automatically creates dashboards that show the relevant observations and problem severity information to help you prioritize your actions. For common problems in .NET and SQL application stacks, such as application latency, SQL Server failed backups, memory leaks, large HTTP requests, and canceled I/O operations, it provides additional insights that point to a possible root cause and steps for resolution. Built-in integration with [AWS SSM OpsCenter](https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter.html) allows you to resolve issues by running the relevant Systems Manager Automation document. 

**Topics**
+ [What is Amazon CloudWatch Application Insights?](appinsights-what-is.md)
+ [How Application Insights works](appinsights-how-works.md)
+ [Prerequisites, IAM policies, and permissions](appinsights-accessing.md)
+ [Set up application for monitoring](appinsights-setting-up.md)
+ [

# Application Insights cross-account observability
](appinsights-cross-account.md)
+ [Work with component configurations](component-config.md)
+ [Use CloudFormation templates](appinsights-cloudformation.md)
+ [

# Tutorial: Set up monitoring for SAP ASE
](appinsights-tutorial-sap-ase.md)
+ [Tutorial: Set up monitoring for SAP HANA](appinsights-tutorial-sap-hana.md)
+ [

# Tutorial: Set up monitoring for SAP NetWeaver
](appinsights-tutorial-sap-netweaver.md)
+ [View and troubleshoot Application Insights](appinsights-troubleshooting.md)
+ [Supported logs and metrics](appinsights-logs-and-metrics.md)

# What is Amazon CloudWatch Application Insights?
What is Amazon CloudWatch Application Insights?

CloudWatch Application Insights helps you monitor your applications that use Amazon EC2 instances along with other [application resources](#appinsights-components). It identifies and sets up key metrics, logs, and alarms across your application resources and technology stack (for example, your Microsoft SQL Server database, web (IIS) and application servers, OS, load balancers, and queues). It continuously monitors metrics and logs to detect and correlate anomalies and errors. When errors and anomalies are detected, Application Insights generates [CloudWatch Events](https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/WhatIsCloudWatchEvents.html) that you can use to set up notifications or take actions. To assist with troubleshooting, it creates automated dashboards for detected problems, which include correlated metric anomalies and log errors, along with additional insights to point you to a potential root cause. The automated dashboards help you to take remedial actions to keep your applications healthy and to prevent impact to the end-users of your application. It also creates OpsItems so that you can resolve problems using [AWS SSM OpsCenter](https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter.html).

You can configure important counters, such as Mirrored Write Transaction/sec, Recovery Queue Length, and Transaction Delay, as well as Windows Event Logs on CloudWatch. When a failover event or problem occurs with your SQL HA workload, such as a restricted access to query a target database, CloudWatch Application Insights provides automated insights .

CloudWatch Application Insights integrates with [AWS Launch Wizard](https://docs.aws.amazon.com/launchwizard/latest/userguide/what-is-launch-wizard.html) to provide a one-click monitoring setup experience for deploying SQL Server HA workloads on AWS. When you select the option to set up monitoring and insights with Application Insights on the [Launch Wizard console](https://console.aws.amazon.com/launchwizard), CloudWatch Application Insights automatically sets up relevant metrics, logs, and alarms on CloudWatch, and starts monitoring newly deployed workloads. You can view automated insights and detected problems, along with the health of your SQL Server HA workloads, on the CloudWatch console.

**Topics**
+ [

## Features
](#appinsights-features)
+ [

## Concepts
](#appinsights-concepts)
+ [

## Pricing
](#appinsights-pricing)
+ [

## Related services
](#appinsights-related-services)
+ [

## Supported application components
](#appinsights-components)
+ [

## Supported technology stacks
](#appinsights-stack)

## Features


Application Insights provides the following features.

**Automatic set up of monitors for application resources**  
CloudWatch Application Insights reduces the time it takes to set up monitoring for your applications. It does this by scanning your application resources, providing a customizable list of recommended metrics and logs, and setting them up on CloudWatch to provide necessary visibility into your application resources, such as Amazon EC2 and Elastic Load Balancers (ELB). It also sets up dynamic alarms on monitored metrics. The alarms are automatically updated based on anomalies detected in the previous two weeks. 

**Problem detection and notification**  
CloudWatch Application Insights detects signs of potential problems with your application, such as metric anomalies and log errors. It correlates these observations to surface potential problems with your application. It then generates CloudWatch Events, [which can be configured to receive notifications or take actions](appinsights-cloudwatch-events.md). This eliminates the need for you to create individual alarms on metrics or log errors. Additionally, you can [Configure Amazon SNS notifications](appinsights-problem-notifications.md) to receive alerts for detected problems.

**Troubleshooting**  
CloudWatch Application Insights creates CloudWatch automatic dashboards for problems that are detected. The dashboards show details about the problem, including the associated metric anomalies and log errors to help you with troubleshooting. They also provide additional insights that point to potential root causes of the anomalies and errors. 

## Concepts


The following concepts are important for understanding how Application Insights monitors your application.

**Component**  
An auto-grouped, standalone, or custom grouping of similar resources that make up an application. We recommend grouping similar resources into custom components for better monitoring.

**Observation**  
An individual event (metric anomaly, log error, or exception) that is detected with an application or application resource.

**Problem**  
Problems are detected by correlating, classifying, and grouping related observations. 

For definitions of other key concepts for CloudWatch Application Insights, see [ Amazon CloudWatch Concepts](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html).

## Pricing


CloudWatch Application Insights sets up recommended metrics and logs for selected application resources using CloudWatch metrics, Logs, and Events for notifications on detected problems. These features are charged to your AWS account according to [CloudWatch pricing](https://aws.amazon.com/cloudwatch/pricing). For detected problems, [SSM OpsItems](https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-working-with-OpsItems.html) are also created by Application Insights to notify you about problems. Additionally, Application Insights creates [SSM Parameter Store parameters](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-parameter-store.html) to configure the CloudWatch agents on your instances. The Amazon EC2 Systems Manager features are charged according to [SSM pricing](https://aws.amazon.com/systems-manager/pricing/). You are not charged for setup assistance, monitoring, data analysis, or problem detection.

### Costs for CloudWatch Application Insights


Costs for Amazon EC2 include usage of the following features:
+ CloudWatch Agent
  + CloudWatch Agent log groups
  + CloudWatch Agent metrics
  + Prometheus log groups (for JMX workloads)

Costs for all resources include usage of the following features:
+ CloudWatch alarms (majority of cost)
+ SSM OpsItems (minimal cost)

### Example cost calculation


The costs in this example are considered according to the following scenario.

You created a resource group that includes the following:
+ An Amazon EC2 instance with SQL Server installed.
+ An attached Amazon EBS volume.

When you onboard this resource group with CloudWatch Application Insights, the SQL Server workload installed on the Amazon EC2 instance is detected. CloudWatch Application Insights starts monitoring the following metrics.

The following metrics are monitored for the SQL Server instance:
+ CPUUtilization
+ StatusCheckFailed
+ Memory % Committed Bytes in Use
+ Memory Available Mbytes
+ Network Interface Bytes Total/sec
+ Paging File % Usage
+ Physical Disk % Disk Time
+ Processor % Processor Time
+ SQLServer:Buffer Manager cache hit ratio
+ SQLServer:Buffer Manager life expectancy
+ SQLServer:General Statistics Processes blocked
+ SQLServer:General Statistics User Connections
+ SQLServer:Locks Number of Deadlocks/sec
+ SQLServer:SQL Statistics Batch Requests/sec
+ System Processor Queue Length

The following metrics are monitored for the volumes attached to the SQL Server instance:
+ VolumeReadBytes
+ VolumeWriteBytes
+ VolumeReadOps
+ VolumeWriteOps
+ VolumeTotalReadTime
+ VolumeTotalWriteTime
+ VolumeIdleTime
+ VolumeQueueLength
+ VolumeThroughputPercentage
+ VolumeConsumedReadWriteOps
+ BurstBalance

For this scenario, the costs are calculated according to the [CloudWatch pricing](https://aws.amazon.com/cloudwatch/pricing/) page and the [SSM pricing](https://aws.amazon.com/systems-manager/pricing/) page:
+ **Custom metrics**

  For this scenario, 13 of the above metrics are emitted to CloudWatch using the CloudWatch agent. These metrics are treated as custom metrics. The cost for each custom metric is \$1.3/month. The total cost for these custom metrics is 13 \$1 \$1.3 = \$13.90/month.
+ **Alarms**

  For this scenario, CloudWatch Application Insights monitors 26 metrics in total, which creates 26 alarms. The cost for each alarm is \$1.1/month. The total cost for alarms is 26 \$1 \$1.1 = \$12.60/month. 
+ **Data ingestion and error logs**

  The cost of data ingestion is \$1.05/GB and storage for the SQL Server error log is \$1.03/GB. The total cost for data ingestion and the error log is \$1.05/GB \$1 \$1.03/GB= \$1.08/GB.
+ **Amazon EC2 Systems Manager OpsItems**

  An SSM OpsItem is created for each problem detected by CloudWatch Application Insights. For *n* number of problems in your application, the total cost is \$1.00267 \$1 *n*/month.

## Related services


The following services are used along with CloudWatch Application Insights:

**Related AWS services**
+ **Amazon CloudWatch** provides system‐wide visibility into resource utilization, application performance, and operational health. It collects and tracks metrics, sends alarm notifications, automatically updates resources that you are monitoring based on the rules that you define, and allows you to monitor your own custom metrics. CloudWatch Application Insights is initiated through CloudWatch—specifically, within the CloudWatch default operational dashboards. For more information, see the [https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/WhatIsCloudWatch.html](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/WhatIsCloudWatch.html).
+ **CloudWatch Container Insights** collects, aggregates, and summarizes metrics and logs from your containerized applications and microservices. You can use Container Insights to monitor Amazon ECS, Amazon Elastic Kubernetes Service, and Kubernetes platforms on Amazon EC2. When Application Insights is enabled on the Container Insights or Application Insights consoles, Application Insights displays detected problems on your Container Insights dashboard. For more information, see [Container Insights](ContainerInsights.md) .
+ **Amazon DynamoDB** is a fully managed NoSQL database service that lets you offload the administrative burdens of operating and scaling a distributed database so that you don't have to worry about hardware provisioning, setup and configuration, replication, software patching, or cluster scaling. DynamoDB also offers encryption at rest, which eliminates the operational burden and complexity involved in protecting sensitive data.
+ **Amazon EC2 **provides scalable computing capacity in the AWS Cloud. You can use Amazon EC2 to launch as many or as few virtual servers as you need, to configure security and networking, and to manage storage. You can scale up or down to handle changes in requirements or spikes in popularity, which reduces your need to forecast traffic. For more information, see the [https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts.html](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts.html) or [https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/concepts.html](https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/concepts.html).
+ **Amazon Elastic Block Store (Amazon EBS)** provides block-level storage volumes for use with Amazon EC2 instances. Amazon EBS volumes behave like raw, unformatted block devices. You can mount these volumes as devices on your instances. Amazon EBS volumes that are attached to an instance are exposed as storage volumes that persist independently from the life of the instance. You can create a file system on top of these volumes, or use them in any way you would use a block device (such as a hard drive). You can dynamically change the configuration of a volume attached to an instance. For more information, see the [Amazon EBS User Guide](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AmazonEBS.html).
+ **Amazon EC2 Auto Scaling **helps ensure that you have the correct number of EC2 instances available to handle the load for your application. For more information, see the [https://docs.aws.amazon.com/autoscaling/ec2/userguide/what-is-amazon-ec2-auto-scaling.html](https://docs.aws.amazon.com/autoscaling/ec2/userguide/what-is-amazon-ec2-auto-scaling.html).
+ **Elastic Load Balancing **distributes incoming applications or network traffic across multiple targets, such as EC2 instances, containers, and IP addresses, in multiple Availability Zones. For more information, see the [https://docs.aws.amazon.com/elasticloadbalancing/latest/userguide/what-is-load-balancing.html](https://docs.aws.amazon.com/elasticloadbalancing/latest/userguide/what-is-load-balancing.html).
+ **IAM **is a web service that helps you to securely control access to AWS resources for your users. Use IAM to control who can use your AWS resources (authentication), and to control the resources they can use and how they can use them (authorization). For more information, see [Authentication and Access Control for Amazon CloudWatch](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/auth-and-access-control-cw.html).
+ **AWS Lambda** lets you build serverless applications composed of functions that are triggered by events and automatically deploy them using CodePipeline and AWS CodeBuild. For more information, see [AWS Lambda Applications](https://docs.aws.amazon.com/lambda/latest/dg/deploying-lambda-apps.html). 
+ **AWS Launch Wizard for SQL Server** reduces the time it takes to deploy SQL Server high availability solution to the cloud. You input your application requirements, including performance, number of nodes, and connectivity on the service console, and AWS Launch Wizard identifies the right AWS resources to deploy and run your SQL Server Always On application. 
+ **AWS Resource Groups **help you to organize the resources that make up your application. With Resource Groups, you can manage and automate tasks on a large number of resources at one time. Only one Resource Group can be registered for a single application. For more information, see the [https://docs.aws.amazon.com/ARG/latest/userguide/welcome.html](https://docs.aws.amazon.com/ARG/latest/userguide/welcome.html).
+ **Amazon SQS **offers a secure, durable, and available hosted queue that allows you to integrate and decouple distributed software systems and components. For more information, see the [https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/welcome.html](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/welcome.html).
+ **AWS Step Functions** is a serverless function composer that allows you to sequence a variety of AWS services and resources, including AWS Lambda functions, into structured, visual workflows. For more information, see the [AWS Step Functions User Guide](https://docs.aws.amazon.com/step-functions/latest/dg/welcome.html).
+ **AWS SSM OpsCenter **aggregates and standardizes OpsItems across services while providing contextual investigation data about each OpsItem, related OpsItems, and related resources. OpsCenter also provides Systems Manager Automation documents (runbooks) that you can use to quickly resolve issues. You can specify searchable, custom data for each OpsItem. You can also view automatically-generated summary reports about OpsItems by status and source. For more information, see the [https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter.html](https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter.html).
+ **Amazon API Gateway** is an AWS service for creating, publishing, maintaining, monitoring, and securing REST, HTTP, and WebSocket APIs at any scale. API developers can create APIs that access AWS or other web services, as well as data stored in the AWS Cloud. For more information, see the [Amazon API Gateway User Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/welcome.html).
**Note**  
Application Insights supports only REST API protocols (v1 of the API Gateway service).
+ **Amazon Elastic Container Service (Amazon ECS)** is a fully managed container orchestration service. You can use Amazon ECS to run your most sensitive and mission-critical applications. For more information, see the [Amazon Elastic Container Service Developer Guide](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/Welcome.html).
+ **Amazon Elastic Kubernetes Service (Amazon EKS)** is a managed service that you can use to run Kubernetes on AWS without having to install, operate, and maintain your own Kubernetes control plane or nodes. Kubernetes is an open-source system for automating the deployment, scaling, and management of containerized applications. For more information, see the [Amazon EKS User Guide](https://docs.aws.amazon.com/eks/latest/userguide/what-is-eks.html).
+ **Kubernetes on Amazon EC2**. Kubernetes is open-source software that helps you deploy and manage containerized applications at scale. Kubernetes manages clusters of Amazon EC2 compute instances and runs containers on those instances with processes for deployment, maintenance, and scaling. With Kubernetes, you can run any type of containerized application with the same toolset on-premises and in the cloud. For more information, see [Kubernetes Documentation: Getting started](https://kubernetes.io/docs/setup/).
+ **Amazon FSx** helps you to launch and run popular file systems that are fully managed by AWS. With Amazon FSx, you can leverage the feature sets and performance of common open source and commercially-licensed file systems to avoid time-consuming administrative tasks. For more information, see the [Amazon FSx Documentation](https://docs.aws.amazon.com/fsx/).
+ **Amazon Simple Notification Service (SNS)** is a fully-managed messaging service for both application-to-application and application-to-person communication. You can configure Amazon SNS for monitoring by Application Insights. When Amazon SNS is configured as a resource for monitoring, Application Insights tracks SNS metrics to help determine why SNS messages may encounter issues or fail.
+ **Amazon Elastic File System (Amazon EFS)** is a fully-managed elastic NFS file system for use with AWS Cloud services and on-premises resources. It is built to scale to petabytes on demand without disrupting applications. It grows and shrinks automatically as you add and remove files, which eliminates the need to provision and manage capacity to accommodate growth. For more information, see the [Amazon Elastic File System documentation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AmazonEFS.html).

**Related third-party services**
+ For some workloads and applications monitored in Application Insights, **Prometheus JMX exporter** is installed using AWS Systems Manager Distributor so that CloudWatch Application Insights can retrieve Java-specific metrics. When you choose to monitor a Java application, Application Insights automatically installs the Prometheus JMX exporter for you. 

## Supported application components


CloudWatch Application Insights scans your resource group to identify application components. Components can be standalone, auto-grouped (such as instances in an Auto Scaling group or behind a load balancer), or custom (by grouping together individual Amazon EC2 instances). 

The following components are supported by CloudWatch Application Insights:

**AWS components**
+ Amazon EC2
+ Amazon EBS
+ Amazon RDS
+ Elastic Load Balancing: Application Load Balancer and Classic Load Balancer (all target instances of these load balancers are identified and configured).
+ Amazon EC2 Auto Scaling groups: AWS Auto Scaling (Auto Scaling groups are dynamically configured for all target instances; if your application scales up, CloudWatch Application Insights automatically configures the new instances). Auto Scaling groups are not supported for CloudFormation stack-based resource groups.
+ AWS Lambda
+ Amazon Simple Queue Service (Amazon SQS)
+ Amazon DynamoDB table
+ Amazon S3 bucket metrics
+ AWS Step Functions
+ Amazon API Gateway REST API stages
+ Amazon Elastic Container Service (Amazon ECS): cluster, service, and task
+ Amazon Elastic Kubernetes Service (Amazon EKS): cluster
+ Kubernetes on Amazon EC2: Kubernetes cluster running on EC2
+ Amazon SNS topic

Any other component type resources are not currently tracked by CloudWatch Application Insights. If a component type that is supported does not appear in your Application Insights application, the component may already be registered and managed by another application you own that is monitored by Application Insights. 

## Supported technology stacks


You can use CloudWatch Application Insights to monitor your applications running on Windows Server and Linux operating systems by selecting the application tier dropdown menu option for one of the following technologies: 
+ Front‐end: Microsoft Internet Information Services (IIS) Web Server
+ Worker‐tier: 
  + .NET Framework 
  + .NET Core
+ Applications:
  + Java
  + SAP NetWeaver standard, distributed, and high availability deployments
+ Active Directory
+ SharePoint
+ Databases: 
  + Microsoft SQL Server running on Amazon RDS or Amazon EC2 (including SQL Server High Availability configurations. See, [Component configuration examples](component-configuration-examples.md)).
  + MySQL running on Amazon RDS, Amazon Aurora, or Amazon EC2
  + PostgreSQL running on Amazon RDS or Amazon EC2
  + Amazon DynamoDB table
  + Oracle running on Amazon RDS or Amazon EC2
  + SAP HANA database on a single Amazon EC2 instance and multiple EC2 instances
  + Cross-AZ SAP HANA database high availability setup
  + SAP Sybase ASE database on a single Amazon EC2 instance
  + Cross-AZ SAP Sybase ASE database high availability setup

If none of the technology stacks listed above apply to your application resources, you can monitor your application stack by choosing **Custom** from the application tier dropdown menu on the **Manage monitoring** page.

# How Amazon CloudWatch Application Insights works
How Application Insights works

CloudWatch Application Insights provides monitoring of your application resources. The following information describes how Application Insights works.

**Topics**
+ [

## How Application Insights monitors applications
](#appinsights-how-works-sub)
+ [

## Data retention
](#appinsights-retention)
+ [

## Quotas
](#appinsights-limits)
+ [

# AWS Systems Manager (SSM) packages used by CloudWatch Application Insights
](appinsights-ssm-packages.md)
+ [

# AWS Systems Manager (SSM) Documents used by CloudWatch Application Insights
](appinsights-ssm-documents.md)

## How Application Insights monitors applications


The following information describes how Application Insights monitors applications.

**Application discovery and configuration**  
The first time an application is added to CloudWatch Application Insights it scans the application components to recommend key metrics, logs, and other data sources to monitor for your application. You can then configure your application based on these recommendations. 

**Data preprocessing**  
CloudWatch Application Insights continuously analyzes the data sources being monitored across the application resources to discover metric anomalies and log errors (observations). 

**Intelligent problem detection**  
The CloudWatch Application Insights engine detects problems in your application by correlating observations using classification algorithms and built-in rules. To assist in troubleshooting, it creates automated CloudWatch dashboards, which include contextual information about the problems. 

**Alert and action**  
When CloudWatch Application Insights detects a problem with your application, it generates CloudWatch Events to notify you of the problem. See [Application Insights CloudWatch Events for detected problems](appinsights-cloudwatch-events.md) for more information about how to set up these Events. Additionally, you can [configure Amazon SNS notifications](appinsights-problem-notifications.md) to receive alerts for detected problems.

**Example scenario**

You have an ASP .NET application that is backed by a SQL Server database. Suddenly, your database begins to malfunction because of high memory pressure. This leads to application performance degradation and possibly HTTP 500 errors in your web servers and load balancer.

With CloudWatch Application Insights and its intelligent analytics, you can identify the application layer that is causing the problem by checking the dynamically created dashboard that shows the related metrics and log file snippets. In this case, the problem might be at the SQL database layer.

## Data retention


CloudWatch Application Insights retains problems for 55 days and observations for 60 days.

## Quotas


For default quotas for CloudWatch Application Insights, see [Amazon CloudWatch Application Insights endpoints and quotas](https://docs.aws.amazon.com/general/latest/gr/applicationinsights.html). Unless otherwise noted, each quota is per AWS Region. Contact [AWS Support](https://console.aws.amazon.com/support/home#/case/create?issueType=technical) to request an increase in your service quota. Many services contain quotas that cannot be changed. For more information about the quotas for a specific service, see the documentation for that service. 

# AWS Systems Manager (SSM) packages used by CloudWatch Application Insights
SSM packages used by Application Insights

The packages listed in this section are used by Application Insights, and can be independently managed and deployed with AWS Systems Manager Distributor. For more information about SSM Distributor, see [AWS Systems Manager Distributor](https://docs.aws.amazon.com/systems-manager/latest/userguide/distributor.html) in the *AWS Systems Manager User Guide*.

**Topics**
+ [

## `AWSObservabilityExporter-JMXExporterInstallAndConfigure`
](#configure-java)
+ [

## `AWSObservabilityExporter-SAP-HANADBExporterInstallAndConfigure`
](#appinsights-ssm-sap-prometheus)
+ [

## `AWSObservabilityExporter-HAClusterExporterInstallAndConfigure`
](#appinsights-ssm-sap-prometheus-ha)
+ [

## `AWSObservabilityExporter-SAP-SAPHostExporterInstallAndConfigure`
](#appinsights-ssm-sap-host-exporter)
+ [

## `AWSObservabilityExporter-SQLExporterInstallAndConfigure`
](#appinsights-ssm-sql-prometheus)

## `AWSObservabilityExporter-JMXExporterInstallAndConfigure`


You can retrieve workload-specific Java metrics from [Prometheus JMX exporter](https://prometheus.io/docs/instrumenting/exporters/#third-party-exporters) for Application Insights to configure and monitor alarms. In the Application Insights console, on the **Manage monitoring** page, select **JAVA application** from the **Application tier** dropdown. Then under **JAVA Prometheus exporter configuration**, select your **Collection method** and **JMX port number**. 

To use [AWS Systems Manager Distributor](https://docs.aws.amazon.com/systems-manager/latest/userguide/distributor.html) to package, install, and configure the AWS-provided Prometheus JMX exporter package independently of Application Insights, complete the following steps.

**Prerequisites for using the Prometheus JMX exporter SSM package**
+ SSM agent version 2.3.1550.0 or later installed
+ The JAVA\$1HOME environment variable is set

**Install and configure the `AWSObservabilityExporter-JMXExporterInstallAndConfigure` package**  
The `AWSObservabilityExporter-JMXExporterInstallAndConfigure` package is an SSM Distributor package that you can use to install and configure [Prometheus JMX Exporter](https://github.com/prometheus/jmx_exporter). When Java metrics are sent by the Prometheus JMX exporter, the CloudWatch agent can be configured to retrieve the metrics for the CloudWatch service.

1. Based on your preferences, prepare the [Prometheus JMX exporter YAML configuration file](https://github.com/prometheus/jmx_exporter#configuration) located in the Prometheus GitHub repository. Use the example configuration and option descriptions to guide you.

1. Copy the Prometheus JMX exporter YAML configuration file encoded as Base64 to a new SSM parameter in [SSM Parameter Store](https://console.aws.amazon.com/systems-manager/parameters).

1. Navigate to the [SSM Distributor](https://console.aws.amazon.com/systems-manager/distributor) console and open the **Owned by Amazon** tab. Select **AWSObservabilityExporter-JMXExporterInstallAndConfigure** and choose **Install one time**.

1. Update the SSM parameter you created in the first step by replacing "Additional Arguments" with the following:

   ```
   {
     "SSM_EXPORTER_CONFIGURATION": "{{ssm:<SSM_PARAMETER_STORE_NAME>}}",
     "SSM_EXPOSITION_PORT": "9404"
   }
   ```
**Note**  
Port 9404 is the default port used to send Prometheus JMX metrics. You can update this port.

**Example: Configure CloudWatch agent to retrieve Java metrics**

1. Install the Prometheus JMX exporter, as described in the previous procedure. Then verify that it is correctly installed on your instance by checking the port status.

   Successful installation on Windows instance example

   ```
   PS C:\> curl http://localhost:9404 (http://localhost:9404/)
   StatusCode : 200
   StatusDescription : OK
   Content : # HELP jvm_info JVM version info
   ```

   Successful installation on Linux instance example

   ```
   $ curl localhost:9404
   # HELP jmx_config_reload_failure_total Number of times configuration have failed to be reloaded.
   # TYPE jmx_config_reload_failure_total counter
   jmx_config_reload_failure_total 0.0
   ```

1. Create the Prometheus service discovery YAML file. The following example service discovery file performs the following:
   + Specifies the Prometheus JMX exporter host port as `localhost: 9404`.
   + Attaches labels (`Application`, `ComponentName`, and `InstanceId`) to the metrics, which can be set as CloudWatch metric dimensions.

   ```
   $ cat prometheus_sd_jmx.yaml 
   - targets:
     - 127.0.0.1:9404
     labels:
       Application: myApp
       ComponentName: arn:aws:elasticloadbalancing:us-east-1:123456789012:loadbalancer/app/sampl-Appli-MMZW8E3GH4H2/aac36d7fea2a6e5b
       InstanceId: i-12345678901234567
   ```

1. Create the Prometheus JMX exporter configuration YAML file. The following example configuration file specifies the following:
   + The metrics retrieval job interval and timeout period.
   + The metrics retrieval jobs (`jmx` and `sap`), also known as scraping, which include the job name, maximum time series returned at a time, and service discovery file path. 

   ```
   $ cat prometheus.yaml 
   global:
     scrape_interval: 1m
     scrape_timeout: 10s
   scrape_configs:
     - job_name: jmx
       sample_limit: 10000
       file_sd_configs:
         - files: ["/tmp/prometheus_sd_jmx.yaml"]
     - job_name: sap
       sample_limit: 10000
       file_sd_configs:
         - files: ["/tmp/prometheus_sd_sap.yaml"]
   ```

1. Verify that the CloudWatch agent is installed on your Amazon EC2 instance and that the version is 1.247346.1b249759 or later. To install the CloudWatch agent on your EC2 instance, see [Installing the CloudWatch Agent](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/install-CloudWatch-Agent-on-EC2-Instance.html). To verify the version, see [Finding information about CloudWatch agent versions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/troubleshooting-CloudWatch-Agent.html#CloudWatch-Agent-troubleshooting-agent-version).

1. Configure the CloudWatch agent. For more information about how to configure the CloudWatch agent configuration file, see [Manually create or edit the CloudWatch agent configuration file](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Agent-Configuration-File-Details.html). The following example CloudWatch agent configuration file performs the following:
   + Specifies the Prometheus JMX exporter configuration file path.
   + Specifies the target log group to which to publish EMF metric logs.
   + Specifies two sets of dimensions for each metric name.
   + Sends 8 (4 metric names \$1 2 sets of dimensions per metric name) CloudWatch metrics.

   ```
   {
      "logs":{
         "logs_collected":{
            ....
         },
         "metrics_collected":{
            "prometheus":{
               "cluster_name":"prometheus-test-cluster",
               "log_group_name":"prometheus-test",
               "prometheus_config_path":"/tmp/prometheus.yaml",
               "emf_processor":{
                  "metric_declaration_dedup":true,
                  "metric_namespace":"CWAgent",
                  "metric_unit":{
                     "jvm_threads_current":"Count",
                     "jvm_gc_collection_seconds_sum":"Second",
                     "jvm_memory_bytes_used":"Bytes"
                  },
                  "metric_declaration":[
                     {
                        "source_labels":[
                           "job"
                        ],
                        "label_matcher":"^jmx$",
                        "dimensions":[
                           [
                              "InstanceId",
                              "ComponentName"
                           ],
                           [
                              "ComponentName"
                           ]
                        ],
                        "metric_selectors":[
                           "^java_lang_threading_threadcount$",
                           "^java_lang_memory_heapmemoryusage_used$",
                           "^java_lang_memory_heapmemoryusage_committed$"
                        ]
                     }
                  ]
               }
            }
         }
      },
      "metrics":{
         ....
      }
   }
   ```

## `AWSObservabilityExporter-SAP-HANADBExporterInstallAndConfigure`


You can retrieve workload-specific SAP HANA metrics from [Prometheus HANA database exporter](https://prometheus.io/docs/instrumenting/exporters/#third-party-exporters) for Application Insights to configure and monitor alarms. For more information, see [Set up your SAP HANA database for monitoring](appinsights-tutorial-sap-hana.md#appinsights-tutorial-sap-hana-set-up) in this guide.

To use [AWS Systems Manager Distributor](https://docs.aws.amazon.com/systems-manager/latest/userguide/distributor.html) to package, install, and configure the AWS-provided Prometheus HANA database exporter package independently of Application Insights, complete the following steps.

**Prerequisites for using the Prometheus HANA database exporter SSM package**
+ SSM agent version 2.3.1550.0 or later installed
+ SAP HANA database
+ Linux operating system (SUSE Linux, RedHat Linux)
+ A secret with SAP HANA database monitoring credentials, using AWS Secrets Manager. Create a secret using the key/value pairs format, specify the key username, and enter the database user for the value. Add a second key password, and then enter the password for the value. For more information about how to create secrets, see [Create a secret](https://docs.aws.amazon.com/secretsmanager/latest/userguide/manage_create-basic-secret.html) in the *AWS Secrets Manager User Guide*. The secret must be formatted as follows:

  ```
  {
    "username": "<database_user>",
    "password": "<database_password>"
  }
  ```

**Install and configure the `AWSObservabilityExporter-SAP-HANADBExporterInstallAndConfigure` package**  
The `AWSObservabilityExporter-SAP-HANADBExporterInstallAndConfigure` package is an SSM Distributor package that you can use to install and configure [Prometheus HANA database Exporter](https://github.com/prometheus/jmx_exporter). When HANA database metrics are sent by the Prometheus HANA database exporter, the CloudWatch agent can be configured to retrieve the metrics for the CloudWatch service.

1. Create an SSM parameter in [SSM Parameter Store](https://console.aws.amazon.com/systems-manager/parameters) to store the Exporter configurations. The following is an example parameter value.

   ```
   {\"exposition_port\":9668,\"multi_tenant\":true,\"timeout\":600,\"hana\":{\"host\":\"localhost\",\"port\":30013,\"aws_secret_name\":\"HANA_DB_CREDS\",\"scale_out_mode\":true}}
   ```
**Note**  
In this example, the export runs only on the Amazon EC2 instance with the active `SYSTEM` database, and it will remain idle on the other EC2 instances in order to avoid duplicate metrics. The exporter can retrieve all of the database tenant information from the `SYSTEM` database.

1. Create an SSM parameter in [SSM Parameter Store](https://console.aws.amazon.com/systems-manager/parameters) to store the Exporter metrics queries. The package can accept more than one metrics parameter. Each parameter must have a valid JSON object format. The following is an example parameter value:

   ```
   {\"SELECT MAX(TIMESTAMP) TIMESTAMP, HOST, MEASURED_ELEMENT_NAME CORE, SUM(MAP(CAPTION, 'User Time', TO_NUMBER(VALUE), 0)) USER_PCT, SUM(MAP(CAPTION, 'System Time', TO_NUMBER(VALUE), 0)) SYSTEM_PCT, SUM(MAP(CAPTION, 'Wait Time', TO_NUMBER(VALUE), 0)) WAITIO_PCT, SUM(MAP(CAPTION, 'Idle Time', 0, TO_NUMBER(VALUE))) BUSY_PCT, SUM(MAP(CAPTION, 'Idle Time', TO_NUMBER(VALUE), 0)) IDLE_PCT FROM sys.M_HOST_AGENT_METRICS WHERE MEASURED_ELEMENT_TYPE = 'Processor' GROUP BY HOST, MEASURED_ELEMENT_NAME;\":{\"enabled\":true,\"metrics\":[{\"name\":\"hanadb_cpu_user\",\"description\":\"Percentage of CPU time spent by HANA DB in user space, over the last minute (in seconds)\",\"labels\":[\"HOST\",\"CORE\"],\"value\":\"USER_PCT\",\"unit\":\"percent\",\"type\":\"gauge\"},{\"name\":\"hanadb_cpu_system\",\"description\":\"Percentage of CPU time spent by HANA DB in Kernel space, over the last minute (in seconds)\",\"labels\":[\"HOST\",\"CORE\"],\"value\":\"SYSTEM_PCT\",\"unit\":\"percent\",\"type\":\"gauge\"},{\"name\":\"hanadb_cpu_waitio\",\"description\":\"Percentage of CPU time spent by HANA DB in IO mode, over the last minute (in seconds)\",\"labels\":[\"HOST\",\"CORE\"],\"value\":\"WAITIO_PCT\",\"unit\":\"percent\",\"type\":\"gauge\"},{\"name\":\"hanadb_cpu_busy\",\"description\":\"Percentage of CPU time spent by HANA DB, over the last minute (in seconds)\",\"labels\":[\"HOST\",\"CORE\"],\"value\":\"BUSY_PCT\",\"unit\":\"percent\",\"type\":\"gauge\"},{\"name\":\"hanadb_cpu_idle\",\"description\":\"Percentage of CPU time not spent by HANA DB, over the last minute (in seconds)\",\"labels\":[\"HOST\",\"CORE\"],\"value\":\"IDLE_PCT\",\"unit\":\"percent\",\"type\":\"gauge\"}]}}
   ```

   For more information about metrics queries, see the [https://github.com/SUSE/hanadb_exporter/blob/master/metrics.json](https://github.com/SUSE/hanadb_exporter/blob/master/metrics.json) repo on GitHub.

1. Navigate to the [SSM Distributor](https://console.aws.amazon.com/systems-manager/distributor) console and open the **Owned by Amazon** tab. Select **AWSObservabilityExporter-SAP-HANADBExporterInstallAndConfigure\$1** and choose **Install one time**.

1. Update the SSM parameter you created in the first step by replacing "Additional Arguments" with the following:

   ```
   {
     "SSM_EXPORTER_CONFIG": "{{ssm:<*SSM_CONFIGURATIONS_PARAMETER_STORE_NAME>*}}",
     "SSM_SID": "<SAP_DATABASE_SID>",
     "SSM_EXPORTER_METRICS_1": "{{ssm:<SSM_FIRST_METRICS_PARAMETER_STORE_NAME>}}",
     "SSM_EXPORTER_METRICS_2": "{{ssm:<SSM_SECOND_METRICS_PARAMETER_STORE_NAME>}}"
   }
   ```

1. Select the Amazon EC2 instances with SAP HANA database, and choose **Run**.

## `AWSObservabilityExporter-HAClusterExporterInstallAndConfigure`


You can retrieve workload-specific High Availability (HA) cluster metrics from [Prometheus HANA cluster exporter](https://prometheus.io/docs/instrumenting/exporters/#third-party-exporters) for Application Insights to configure and monitor alarms for an SAP HANA database High Availability setup. For more information, see [Set up your SAP HANA database for monitoring](appinsights-tutorial-sap-hana.md#appinsights-tutorial-sap-hana-set-up) in this guide.

To use [AWS Systems Manager Distributor](https://docs.aws.amazon.com/systems-manager/latest/userguide/distributor.html) to package, install, and configure the AWS-provided Prometheus HA cluster exporter package independently of Application Insights, complete the following steps.

**Prerequisites for using the Prometheus HA cluster exporter SSM package**
+ SSM agent version 2.3.1550.0 or later installed
+ HA cluster for Pacemaker, Corosync, SBD, and DRBD
+ Linux operating system (SUSE Linux, RedHat Linux)

**Install and configure the `AWSObservabilityExporter-HAClusterExporterInstallAndConfigure` package**  
The `AWSObservabilityExporter-HAClusterExporterInstallAndConfigure` package is an SSM Distributor package that you can use to install and configure Prometheus HA Cluster Exporter. When cluster metrics are sent by the Prometheus HANA database exporter, the CloudWatch agent can be configured to retrieve the metrics for the CloudWatch service.

1. Create an SSM parameter in [SSM Parameter Store](https://console.aws.amazon.com/systems-manager/parameters) to store the Exporter configurations in JSON format. The following is an example parameter value.

   ```
   {\"port\":\"9664\",\"address\":\"0.0.0.0\",\"log-level\":\"info\",\"crm-mon-path\":\"/usr/sbin/crm_mon\",\"cibadmin-path\":\"/usr/sbin/cibadmin\",\"corosync-cfgtoolpath-path\":\"/usr/sbin/corosync-cfgtool\",\"corosync-quorumtool-path\":\"/usr/sbin/corosync-quorumtool\",\"sbd-path\":\"/usr/sbin/sbd\",\"sbd-config-path\":\"/etc/sysconfig/sbd\",\"drbdsetup-path\":\"/sbin/drbdsetup\",\"enable-timestamps\":false}
   ```

   For more information about the exporter configurations, see the [https://github.com/ClusterLabs/ha_cluster_exporter/blob/master/ha_cluster_exporter.yaml](https://github.com/ClusterLabs/ha_cluster_exporter/blob/master/ha_cluster_exporter.yaml) repo on GitHub.

1. Navigate to the [SSM Distributor](https://console.aws.amazon.com/systems-manager/distributor) console and open the **Owned by Amazon** tab. Select **AWSObservabilityExporter-HAClusterExporterInstallAndConfigure\$1** and choose **Install one time**.

1. Update the SSM parameter you created in the first step by replacing "Additional Arguments" with the following:

   ```
   {
     "SSM_EXPORTER_CONFIG": "{{ssm:<*SSM_CONFIGURATIONS_PARAMETER_STORE_NAME>*}}"
   }
   ```

1. Select the Amazon EC2 instances with SAP HANA database, and choose **Run**.

## `AWSObservabilityExporter-SAP-SAPHostExporterInstallAndConfigure`


You can retrieve workload-specific SAP NetWeaver metrics from [Prometheus SAP host exporter](https://prometheus.io/docs/instrumenting/exporters/#third-party-exporters) for Application Insights to configure and monitor alarms for SAP NetWeaver Distributed and High Availability deployments.

To use [AWS Systems Manager Distributor](https://docs.aws.amazon.com/systems-manager/latest/userguide/distributor.html) to package, install, and configure the SAP host exporter package independently of Application Insights, complete the following steps.

**Prerequisites for using the Prometheus SAP host exporter SSM package**
+ SSM agent version 2.3.1550.0 or later installed
+ SAP NetWeaver application servers
+ Linux operating system (SUSE Linux, RedHat Linux)

**Install and configure the `AWSObservabilityExporter-SAP-SAPHostExporterInstallAndConfigure` package**  
The `AWSObservabilityExporter-SAP-SAPHostExporterInstallAndConfigure` package is an SSM Distributor package that you can use to install and configure SAP NetWeaver Prometheus metrics exporter. When SAP NetWeaver metrics are sent by the Prometheus exporter, the CloudWatch agent can be configured to retrieve the metrics for the CloudWatch service.

1. Create an SSM parameter in [SSM Parameter Store](https://console.aws.amazon.com/systems-manager/parameters) to store the Exporter configurations in JSON format. The following is an example parameter value.

   ```
   {\"address\":\"0.0.0.0\",\"port\":\"9680\",\"log-level\":\"info\",\"is-HA\":false}
   ```
   + **address**

     The target address to which to send the Prometheus metrics. The default value is `localhost`.
   + **port**

     The target port to which to send the Prometheus metrics. The default value is `9680`.
   + **is-HA**

     `true` for SAP NetWeaver High Availability deployments. For all other deployments the value is `false`.

1. Navigate to the [SSM Distributor](https://console.aws.amazon.com/systems-manager/distributor) console and open the **Owned by Amazon** tab. Select **AWSObservabilityExporter-SAP-SAPHostExporterInstallAndConfigure** and choose **Install one time**.

1. Update the SSM parameter you created in the first step by replacing "Additional Arguments" with the following:

   ```
   {
     "SSM_EXPORTER_CONFIG": "{{ssm:<SSM_CONFIGURATIONS_PARAMETER_STORE_NAME>}}",
     "SSM_SID": "<SAP_DATABASE_SID>",
     "SSM_INSTANCES_NUM": "<instances_number seperated by comma>"
   }
   ```

   **Example**

   ```
   {
     "SSM_EXPORTER_CONFIG": "{{ssm:exporter_config_paramter}}",
     "SSM_INSTANCES_NUM": "11,12,10",
     "SSM_SID": "PR1"
   }
   ```

1. Select the Amazon EC2 instances with SAP NetWeaver applications, and choose **Run**.

**Note**  
The Prometheus exporter services the SAP NetWeaver metrics on a local endpoint. The local endpoint can be accessed by only the operating system users on the Amazon EC2 instance. Therefore, after the exporter package is installed, the metrics are available to all of the operating system users. The default local endpoint is `localhost:9680/metrics`.

## `AWSObservabilityExporter-SQLExporterInstallAndConfigure`


You can retrieve workload-specific SQL Server metrics from [Prometheus SQL exporter](https://prometheus.io/docs/instrumenting/exporters/#third-party-exporters) for Application Insights to monitor key metrics. 

To use [AWS Systems Manager Distributor](https://docs.aws.amazon.com/systems-manager/latest/userguide/distributor.html) to package, install, and configure the SQL exporter package independently of Application Insights, complete the following steps.

**Prerequisites for using the Prometheus SQL exporter SSM package**
+ SSM agent version 2.3.1550.0 or later installed
+ Amazon EC2 instance running SQL Server on Windows with SQL Server user authentication enabled.
+ A SQL Server user with the following permissions:

  ```
  GRANT VIEW ANY DEFINITION TO
  ```

  ```
  GRANT VIEW SERVER STATE TO
  ```
+ A secret containing the database connection string using AWS Secrets Manager. For more information about how to create secrets, see [Create a secret](https://docs.aws.amazon.com/secretsmanager/latest/userguide/manage_create-basic-secret.html) in the *AWS Secrets Manager User Guide*. The secret must be formatted as follows:

  ```
  {
    "data_source_name":"sqlserver://<username>:<password>@localhost:1433"
  }
  ```
**Note**  
If the password or username contains special characters, you must percent encode the special characters to ensure a successful connection to the database.

**Install and configure the `AWSObservabilityExporter-SQLExporterInstallAndConfigure` package**  
The `AWSObservabilityExporter-SQLExporterInstallAndConfigure` package is an SSM Distributor package that you can use to install and configure SQL Prometheus metrics exporter. When metrics are sent by the Prometheus exporter, the CloudWatch agent can be configured to retrieve the metrics for the CloudWatch service.

1. Based on your preferences, prepare the SQL Exporter YAML configuration. The following sample configuration has a single metric configured. Use the [example configuration](https://github.com/burningalchemist/sql_exporter/blob/master/examples/sql_exporter.yml) to update the configuration with additional metrics or create your own configuration.

   ```
   ---
   global:
     scrape_timeout_offset: 500ms
     min_interval: 0s
     max_connections: 3
     max_idle_connections: 3
   target:
     aws_secret_name: <SECRET_NAME>
     collectors:
       - mssql_standard
   collectors:
     - collector_name: mssql_standard
       metrics: 
       - metric_name: mssql_batch_requests
         type: counter
         help: 'Number of command batches received.'
         values: [cntr_value]
         query: |
           SELECT cntr_value
           FROM sys.dm_os_performance_counters WITH (NOLOCK)
           WHERE counter_name = 'Batch Requests/sec'
   ```

1. Copy the Prometheus SQL exporter YAML configuration file encoded as Base64 to a new SSM parameter in [SSM Parameter Store](https://console.aws.amazon.com/systems-manager/parameters).

1. Navigate to the [SSM Distributor](https://console.aws.amazon.com/systems-manager/distributor) console and open the **Owned by Amazon** tab. Select **AWSObservabilityExporter-SQLExporterInstallAndConfigure** and choose **Install one time**.

1. Replace the "Additional Arguments" with the following information. The `SSM_PARAMETER_NAME` is the name of the parameter you created in Step 2.

   ```
   {
     "SSM_EXPORTER_CONFIGURATION": 
       "{{ssm:<SSM_PARAMETER_STORE_NAME>}}",
       "SSM_PROMETHEUS_PORT": "9399",
       "SSM_WORKLOAD_NAME": "SQL"                         
   }
   ```

1. Select the Amazon EC2 instance with the SQL Server database, then choose run.

# AWS Systems Manager (SSM) Documents used by CloudWatch Application Insights
SSM documents used by Application Insights

Application Insights uses the SSM Documents listed in this section to define the actions that AWS Systems Manager performs on your managed instances. These documents use the `Run Command` capability of Systems Manager to automate the tasks necessary for carrying out Application Insights monitoring capabilities. The run schedules for these documents are maintained by Application Insights and can't be altered.

For more information about SSM Documents, see [AWS Systems Manager Documents](https://docs.aws.amazon.com/systems-manager/latest/userguide/documents.html) in the *AWS Systems Manager User Guide*.

## Documents managed by CloudWatch Application Insights


The following table lists the SSM documents that are managed by Application Insights.


| Document name | Description | Run schedule | 
| --- | --- | --- | 
|  `AWSEC2-DetectWorkload`  |  Auto detects applications running in your application environment that can be set up to be monitored by Application Insights.  |  This document runs hourly in your application environment to get up-to-date application details.  | 
|  `AWSEC2-CheckPerformanceCounterSets`  |  Checks whether Performance Counter namespaces are enabled on your Amazon EC2 Windows instances.  |  This document runs hourly in your application environment and only monitors Performance Counter metrics if the corresponding namespaces are enabled.  | 
|  `AWSEC2-ApplicationInsightsCloudwatchAgentInstallAndConfigure`  |  Installs and configures CloudWatch Agent based on the monitoring configuration of your application components.  |  This document runs every 30 minutes to ensure that the CloudWatch Agent configuration is always accurate and up-to-date. The document also runs immediately after a change is made to your application monitoring setup such as adding or removing metrics or updating log configurations.   | 

## Documents managed by AWS Systems Manager


The following documents are used by CloudWatch Application Insights and managed by Systems Manager.

**`AWS-ConfigureAWSPackage`**  
Application Insights uses this document to install and uninstall Prometheus exporter distributor packages, to collect workload specific metrics, and to enable comprehensive monitoring of workloads on customer Amazon EC2 instances. CloudWatch Application Insights installs the Prometheus exporter distributor packages only if the correlated target workload is running on your instance. 

The following table lists the Prometheus exporter distributor packages and the correlated target workloads.


| Prometheus exporter distributor package name | Target workload | 
| --- | --- | 
|  `AWSObservabilityExporter-HAClusterExporterInstallAndConfigure`  |  SAP HANA HA  | 
|  `AWSObservabilityExporter-JMXExporterInstallAndConfigure`  |  Java/JMX  | 
|  `AWSObservabilityExporter-SAP-HANADBExporterInstallAndConfigure`  |  SAP HANA  | 
|  `AWSObservabilityExporter-SAP-SAPHostExporterInstallAndConfigure`  |  NetWeaver  | 
|  `AWSObservabilityExporter-SQLExporterInstallAndConfigure`  |  SQL Server (Windows) and SAP ASE (Linux)  | 

**`AmazonCloudWatch-ManageAgent`**  
Application Insights uses this document to manage the status and configuration of CloudWatch Agent on your instances and to collect internal system level metrics and logs from Amazon EC2 instances across operating systems.

# Prerequisites, IAM policies, and permissions needed to access CloudWatch Application Insights
Prerequisites, IAM policies, and permissions

To get started with CloudWatch Application Insights, verify that you have met the following prerequisites, have created an IAM policy, and have attached permissions if needed.

**Topics**
+ [

# Prerequisites to configure an application for monitoring
](appinsights-prereqs.md)
+ [

# IAM policy for CloudWatch Application Insights
](appinsights-iam.md)
+ [

# IAM role permissions for account-based application onboarding
](appinsights-account-based-onboarding-permissions.md)

# Prerequisites to configure an application for monitoring
Prequisites

You must complete the following prerequisites to configure an application with CloudWatch Application Insights:
+ **AWS Systems Manager enablement** – Install Systems Manager Agent (SSM Agent) on your Amazon EC2 instances, and enable the instances for SSM. For information about how to install the SSM Agent, see [Setting up AWS Systems Manager](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-setting-up.html) in the *AWS Systems Manager User Guide*.
+ **EC2 instance role** – You must attach the following Amazon EC2 instance roles to enable Systems Manager
  + You must attach the `AmazonSSMManagedInstanceCore` role to enable Systems Manager. For more information, see [AWS Systems Manager identity-based policy examples](https://docs.aws.amazon.com/systems-manager/latest/userguide/auth-and-access-control-iam-identity-based-access-control.html).
  + You must attach the `CloudWatchAgentServerPolicy` policy to enable instance metrics and logs to be emitted through CloudWatch. For more information, see [Create IAM roles and users for use with CloudWatch agent](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/create-iam-roles-for-cloudwatch-agent.html).
+ **AWS resource groups** – To onboard your applications to CloudWatch Application Insights, create a resource group that includes all of the associated AWS resources used by your application stack. This includes application load balancers, Amazon EC2 instances running IIS and web front‐end, .NET worker tiers, and SQL Server databases. For more information about application components and technology stacks supported by Application Insights, see [Supported application components](appinsights-what-is.md#appinsights-components). CloudWatch Application Insights automatically includes Auto Scaling groups using the same tags or CloudFormation stacks as your resource group, because Auto Scaling groups are not supported by CloudFormation resource groups. For more information, see [Getting Started with AWS Resource Groups](https://docs.aws.amazon.com/ARG/latest/userguide/gettingstarted.html).
+ **IAM permissions** – For users who don't have administrative access, you must create an AWS Identity and Access Management (IAM) policy that allows Application Insights to create a service-linked role and attach it to the user's identity. For more information about how to create the IAM policy, see [IAM policy for CloudWatch Application Insights](appinsights-iam.md).
+ **Service-linked role** – Application Insights uses AWS Identity and Access Management (IAM) service-linked roles. A service-linked role is created for you when you create your first Application Insights application in the Application Insights console. For more information, see [Using service-linked roles for CloudWatch Application Insights](CHAP_using-service-linked-roles-appinsights.md).
+ **Performance Counter metrics support for EC2 Windows instances** – To monitor Performance Counter metrics on your Amazon EC2 Windows instances, Performance Counters must be installed on the instances. For Performance Counter metrics and corresponding Performance Counter set names, see [Performance Counter metrics](application-insights-performance-counter.md). For more information about Performance Counters, see [Performance Counters](https://docs.microsoft.com/en-us/windows/win32/perfctrs/performance-counters-portal).
+ **Amazon CloudWatch agent** – Application Insights installs and configures the CloudWatch agent. If you have CloudWatch agent installed, Application Insights retains your configuration. To avoid a merge conflict, remove the configuration of resources that you want to use in Application Insights from the existing CloudWatch agent configuration file. For more information, see [Manually create or edit the CloudWatch agent configuration file](CloudWatch-Agent-Configuration-File-Details.md).

# IAM policy for CloudWatch Application Insights
IAM policy

To use CloudWatch Application Insights, you must create an [AWS Identity and Access Management (IAM) policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html) and attach it to your user, group, or role. For more information about users, groups, and roles, see [IAM Identities (users, user groups, and roles)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id.html). The IAM policy defines the user permissions.

**To create an IAM policy using the console**  
To create an IAM policy using the IAM console, perform the following steps.

1. Go to the [IAM console](https://console.aws.amazon.com/iam/home). In the left navigation pane, select **Policies**.

1. At the top of the page, select **Create policy**.

1. Select the **JSON** tab.

1. Copy and paste the following JSON document under the **JSON** tab.

------
#### [ JSON ]

****  

   ```
   {
       "Version":"2012-10-17",		 	 	 
       "Statement": [
           {
               "Action": [
                   "applicationinsights:*",
                   "iam:CreateServiceLinkedRole",
                   "iam:ListRoles",
                   "resource-groups:ListGroups"
               ],
               "Effect": "Allow",
               "Resource": "*"
           }
       ]
   }
   ```

------

1. Select **Review Policy**.

1. Enter a **Name** for the policy, for example, “AppInsightsPolicy.” Optionally, enter a **Description**.

1. Select **Create Policy**.

1. In the left navigation pane, select **User groups**, **Users**, or **Roles**.

1. Select the name of the user group, user, or role to which you would like to attach the policy.

1. Select **Add permissions**.

1. Select **Attach existing policies directly**.

1. Search for the policy that you just created, and select the check box to the left of the policy name.

1. Select **Next: Review**.

1. Make sure that the correct policy is listed, and select **Add permissions**.

1. Make sure that you log in with the user associated with the policy that you just created when you use CloudWatch Application Insights.

**To create an IAM policy using the AWS CLI**  
To create an IAM policy using the AWS CLI, run the [create-policy](https://docs.aws.amazon.com/cli/latest/reference/iam/create-policy.html) operation from the command line using the JSON document above as a file in your current folder. 

**To create an IAM policy using AWS Tools for Windows PowerShell**  
To create an IAM policy using the AWS Tools for Windows PowerShell, run the [New-IAMPolicy](https://docs.aws.amazon.com/powershell/latest/reference/items/New-IAMPolicy.html) cmdlt using the JSON document above as a file in your current folder. 

# IAM role permissions for account-based application onboarding
Permissions

If you want to onboard all of the resources in your account, and you choose not to use the [Application Insights managed policy](security-iam-awsmanpol-appinsights.md) for full access to Application Insights functionality, you must attach the following permissions to your IAM role so that Application Insights can discover all of the resources in your account:

```
"ec2:DescribeInstances" 
"ec2:DescribeNatGateways"
"ec2:DescribeVolumes"
"ec2:DescribeVPCs"
"rds:DescribeDBInstances"
"rds:DescribeDBClusters"
"sqs:ListQueues"
"elasticloadbalancing:DescribeLoadBalancers"
"autoscaling:DescribeAutoScalingGroups"
"lambda:ListFunctions"
"dynamodb:ListTables"
"s3:ListAllMyBuckets"
"sns:ListTopics"
"states:ListStateMachines"
"apigateway:GET"
"ecs:ListClusters"
"ecs:DescribeTaskDefinition" 
"ecs:ListServices"
"ecs:ListTasks"
"eks:ListClusters"
"eks:ListNodegroups"
"fsx:DescribeFileSystems"
"route53:ListHealthChecks"
"route53:ListHostedZones"
"route53:ListQueryLoggingConfigs"
"route53resolver:ListFirewallRuleGroups"
"route53resolver:ListFirewallRuleGroupAssociations"
"route53resolver:ListResolverEndpoints"
"route53resolver:ListResolverQueryLogConfigs"
"route53resolver:ListResolverQueryLogConfigAssociations"
"logs:DescribeLogGroups"
"resource-explorer:ListResources"
```

# Set up application for monitoring using the AWS Management Console
Set up application for monitoring

This section provides steps to set up, configure, and manage your CloudWatch Application Insights application using the console, the AWS CLI, and AWS Tools for Windows PowerShell.

**Topics**
+ [Console steps](appinsights-setting-up-console.md)
+ [Command line steps](appinsights-setting-up-command.md)
+ [Events](appinsights-cloudwatch-events.md)
+ [Notifications](appinsights-problem-notifications.md)

# Set up, configure, and manage your application for monitoring from the CloudWatch console
Console steps

This section provides steps to set up, configure, and manage your application for monitoring from the CloudWatch console.

**Topics**
+ [

## Add and configure an application
](#appinsights-add-configure)
+ [

## Enable Application Insights for Amazon ECS and Amazon EKS resource monitoring
](#appinsights-container-insights)
+ [

## Disable monitoring for an application component
](#appinsights-disable-monitoring)
+ [

## Delete an application
](#appinsights-delete-app)

## Add and configure an application
Configure an application

**Add and configure an application from the CloudWatch console**  
To get started with CloudWatch Application Insights from the CloudWatch console, perform the following steps.

1. **Start.** Open the [CloudWatch console landing page](http://console.aws.amazon.com/cloudwatch). From the left navigation pane, under **Insights**, choose **Application Insights**. The page that opens shows the list of applications that are monitored with CloudWatch Application Insights, along with their monitoring status. 

1. **Add an application.** To set up monitoring for your application, choose **Add an application**. When you choose **Add an application**, you are prompted to **Choose Application Type**. 
   + **Resource group-based application**. When you select this option, you can choose which resource groups in this account to monitor. To use multiple applications on a component, you must use resource group-based monitoring. 
   + **Account-based application**. When you select this option, you can monitor all of the resources in this account. If you want to monitor all of the resources in an account, we recommend this option over the resource group-based option because the application onboarding process is faster.
**Note**  
You can't combine resource group-based monitoring with account-based monitoring using Application Insights. In order to change the application type, you must delete all of the applications that are being monitored, and **Choose Application Type**. 

   When you add your first application for monitoring, CloudWatch Application Insights creates a service-linked role in your account, which gives Application Insights permissions to call other AWS services on your behalf. For more information about the service-linked role created in your account by Application Insights, see [Using service-linked roles for CloudWatch Application Insights](CHAP_using-service-linked-roles-appinsights.md).

1. 

------
#### [ Resource-based application monitoring ]

   1. **Select an application or resource group. **On the **Specify application details** page, select the AWS resource group that contains your application resources from the dropdown list. These resources include front-end servers, load balancers, auto scaling groups, and database servers. 

      If you have not created a resource group for your application, you can create one by choosing **Create new resource group**. For more information about creating resource groups, see the [https://docs.aws.amazon.com/ARG/latest/userguide/welcome.html](https://docs.aws.amazon.com/ARG/latest/userguide/welcome.html). 

   1. **Notifications for problem insights.** To view and get notified when problems are detected for selected applications, choose Amazon SNS notifications or Systems Manager OpsCenter Opsitems.

      1. **Set up Amazon SNS notification (Recommended).** Choose **Select existing topic** or **Create new topic**. 

      1. **Integrate with AWS Systems Manager OpsCenter.** Under **Advanced Settings**, select the **Generate Systems Manager OpsCenter OpsItems for remedial actions** check box. To track the operations that are taken to resolve operational work items (OpsItems) that are related to your AWS resources, provide the Amazon SNS topic ARN.

   1. **Monitor CloudWatch Events**. Select the check box to integrate Application Insights monitoring with CloudWatch Events to get insights from Amazon EBS, Amazon EC2, AWS CodeDeploy, Amazon ECS, AWS Health APIs And Notifications, Amazon RDS, Amazon S3, and AWS Step Functions.

   1. **Tags — optional**. CloudWatch Application Insights supports both tag-based and CloudFormation-based resource groups (with the exception of Auto Scaling groups). For more information, see [Working with Tag Editor](https://docs.aws.amazon.com/ARG/latest/userguide/tag-editor.html).

   1. Choose **Next**.

      An [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) is generated for the application in the following format.

      ```
      arn:partition:applicationinsights:region:account-id:application/resource-group/resource-group-name
      ```

      Example

      ```
      arn:aws:applicationinsights:us-east-1:123456789012:application/resource-group/my-resource-group
      ```

   1. On the **Review detected components** page, under **Review components for monitoring**, the table lists the detected components and their associated detected workloads.
**Note**  
For components that support multiple customized workloads, you can monitor up to five workloads for each component. These workloads will be monitored separately from the component.  
![\[The detected components section of the CloudWatch Application Insights console: overview of detected components and associated workloads.\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/appinsights-multiapp-review-component.png)

      Under **Associated workloads**, there are several possible messages that appear if a workload is not listed.
      + **Couldn't detect workloads** – An issue occurred when trying to detect workloads. Make sure that you have completed the [Prerequisites to configure an application for monitoring](appinsights-prereqs.md). If you need to add workloads, choose **Edit component**.
      + **No workloads detected** – We didn't detect any workloads. You may need to add workloads. To do so, choose **Edit component**.
      + **Not applicable** – The component doesn't support customized workloads and will be monitored with default metrics, alarms, and logs. You can't add workloads to these components.

   1. To edit a component, select a component, and then choose **Edit component**. A side panel opens with workloads detected on the component. In this panel, you can edit the component details and add new workloads.  
![\[The review detected components section of the CloudWatch Application Insights console: associated workloads can be edited.\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/appinsights-multiapp-edit-component.png)
      + To edit the workload type or name, use the dropdown list.  
![\[The Edit component section of the CloudWatch Application Insights console: dropdown list of workload type.\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/appinsights-multiapp-edit-name-type.png)
      + To add a workload to the component, choose **Add new workload**.  
![\[The edit component section of the CloudWatch Application Insights console: lower left button to add a new workload.\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/appinsights-multiapp-add-workload.png)
        + If **Add new workload** doesn't appear, this component doesn't support multiple workloads.
        + If the **Associated workloads** heading doesn't appear, this component doesn't support customized workloads.
      + To remove a workload, choose **Remove** next to the workload that you want to remove from monitoring.  
![\[The edit component section of the CloudWatch Application Insights console: remove a workload.\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/appinsights-multiapp-remove-workload.png)
      + To disable monitoring for the entire component, clear the **Monitoring** check box.  
![\[The edit component section of the CloudWatch Application Insights check box to disable monitoring.\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/appinsights-multiapp-disable-monitoring.png)
      + When you are done editing the component, choose **Save changes** in the lower right corner. Any changes to workloads for a component are visible on the **Review components for monitoring** table under **Associated workloads**.

   1. On the **Review detected components** page, choose **Next**.

   1. The **Specify component details** page includes all components with customizable associated workloads from the previous step.
**Note**  
If a component header has an *optional* tag, additional details for the workloads in that component are optional.

      If a component doesn't appear on this page, the component doesn't have any additional details that can be specified in this step.

   1. Choose **Next**.

   1. On the **Review and submit** page, review all monitored component and workload details.

   1. Choose **Submit**.

------
#### [ Account-based application monitoring ]

   1. **Application name**. Enter a name for your account-based application.

   1. **Automated monitoring of new resources**. By default, Application Insights uses recommended settings to configure monitoring for resource components that are added to your account after you onboard the application. You can exclude monitoring for resources added after onboarding your application by clearing the check box.

   1. **Monitor CloudWatch Events**. Select the check box to integrate Application Insights monitoring with CloudWatch Events to get insights from Amazon EBS, Amazon EC2, AWS CodeDeploy, Amazon ECS, AWS Health APIs And Notifications, Amazon RDS, Amazon S3, and AWS Step Functions.

   1. **Integrate with AWS Systems Manager OpsCenter.** To view and get notified when problems are detected for selected applications, select the **Generate Systems Manager OpsCenter OpsItems for remedial actions** check box. To track the operations that are taken to resolve operational work items (OpsItems) that are related to your AWS resources, provide the SNS topic ARN. 

   1. **Tags — optional**. CloudWatch Application Insights supports both tag-based and CloudFormation-based resource groups (with the exception of Auto Scaling groups). For more information, see [Working with Tag Editor](https://docs.aws.amazon.com/ARG/latest/userguide/tag-editor.html).

   1. **Discovered resources**. All of the resources discovered in your account are added to this list. If Application Insights is unable to discover all of the resources in your account, an error message appears at the top of the page. This message includes a link to the [documentation for how to add the required permissions](appinsights-account-based-onboarding-permissions.md).

   1. Choose **Next**.

      An [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) is generated for the application in the following format.

      ```
      arn:partition:applicationinsights:region:account-id:application/TBD/application-name
      ```

      Example

      ```
      arn:aws:applicationinsights:us-east-1:123456789012:application/TBD/my-application
      ```

------

1. After you submit your application monitoring configuration, you will be taken to the details page for the application, where you can view the **Application summary**, the list of **Monitored components** and **Unmonitored components**, and, by selecting the tabs next to **Components**, the **Configuration history**, **Log patterns**, and any **Tags** that you have applied.

   To view insights for the application, choose **View Insights**.

   You can update your selections for CloudWatch Events monitoring and integration with AWS Systems Manager OpsCenter by choosing **Edit**.

   Under **Components**, you can select the **Actions** menu to Create, Modify, or Ungroup an instance group.

   You can manage monitoring for components, including application tier, log groups, event logs, metrics, and custom alarms, by selecting the bullet next to a component and choosing **Manage monitoring**.

## Enable Application Insights for Amazon ECS and Amazon EKS resource monitoring


You can enable Application Insights to monitor containerized applications and microservices from the Container Insights console. Application Insights supports monitoring for the following resources:
+ Amazon ECS clusters
+ Amazon ECS services
+ Amazon ECS tasks
+ Amazon EKS clusters

When Application Insights is enabled, it provides recommended metrics and logs, detects potential problems, generates CloudWatch Events, and creates automatic dashboards for your containerized applications and microservices.

You can enable Application Insights for containerized resources from the Container Insights or Application Insights consoles.

**Enable Application Insights from the Container Insights console**  
From the Container Insights console, on the Container Insights **Performance monitoring** dashboard, choose **Auto-configure Application Insights**. When Application Insights is enabled, it displays details about detected problems.

**Enable Application Insights from the Application Insights console**  
When ECS clusters appear in the component list, Application Insights automatically enables additional container monitoring with Container Insights. 

For EKS clusters, you can enable additional monitoring with Container Insights to provide diagnostics information, such as container restart failures, to help you isolate and resolve problems. Additional steps are required to set up Container Insights for EKS. For information, see [Setting up Container Insights on Amazon EKS and Kubernetes](deploy-container-insights-EKS.md) for steps to set up Container Insights on EKS. 

Additional monitoring for EKS with Container Insights is supported on Linux instances with EKS.

For more information about Container Insights support for ECS and EKS clusters, see [Container Insights](ContainerInsights.md).

## Disable monitoring for an application component


To disable monitoring for an application component, from the application details page, select the component for which you want to disable monitoring. Choose **Actions**, and then **Remove from monitoring**. 

## Delete an application


To delete an application, from the CloudWatch dashboard, on the left navigation pane, choose **Application Insights** under **Insights**. Select the application that you want to delete. Under **Actions**, choose **Delete application**. This deletes monitoring and deletes all of the saved monitors for application components. The application resources are not deleted. 

# Set up, configure, and manage your application for monitoring using the command line
Command line steps

This section provides steps for setting up, configuring, and managing your application for monitoring using the AWS CLI and AWS Tools for Windows PowerShell.

**Topics**
+ [

## Add and manage an application
](#appinsights-config-app-command)
+ [

## Manage and update monitoring
](#appinsights-monitoring)
+ [

## Configure monitoring for SQL Always On Availability Groups
](#configure-sql)
+ [

## Configure monitoring for MySQL RDS
](#configure-mysql-rds)
+ [

## Configure monitoring for MySQL EC2
](#configure-mysql-ec2)
+ [

## Configure monitoring for PostgreSQL RDS
](#configure-postgresql-rds)
+ [

## Configure monitoring for PostgreSQL EC2
](#configure-postgresql-ec2)
+ [

## Configure monitoring for Oracle RDS
](#configure-oracle-rds)
+ [

## Configure monitoring for Oracle EC2
](#configure-oracle-ec2)

## Add and manage an application
Add and manage applications with the Command Line

You can add, get information about, manage, and configure your Application Insights application using the command line. 

**Topics**
+ [

### Add an application
](#appinsights-add-app)
+ [

### Describe an application
](#appinsights-describe-app)
+ [

### List components in an application
](#appinsights-list-components)
+ [

### Describe a component
](#appinsights-describe-components)
+ [

### Group similar resources into a custom component
](#appinsights-group-resources-components)
+ [

### Ungroup a custom component
](#appinsights-ungroup-resources-components)
+ [

### Update an application
](#appinsights-update-app)
+ [

### Update a custom component
](#appinsights-update-component)

### Add an application


**Add an application using the AWS CLI**  
To use the AWS CLI to add an application for your resource group called `my-resource-group`, with OpsCenter enabled to deliver the created opsItem to the SNS topic ARN ` arn:aws:sns:us-east-1:123456789012:MyTopic`, use the following command.

```
aws application-insights create-application --resource-group-name my-resource-group --ops-center-enabled --ops-item-sns-topic-arn arn:aws:sns:us-east-1:123456789012:MyTopic
```

**Add an application using AWS Tools for Windows PowerShell**  
To use AWS Tools for Windows PowerShell to add an application for your resource group called `my-resource-group` with OpsCenter enabled to deliver the created opsItem to the SNS topic ARN `arn:aws:sns:us-east-1:123456789012:MyTopic`, use the following command.

```
New-CWAIApplication -ResourceGroupName my-resource-group -OpsCenterEnabled true -OpsItemSNSTopicArn arn:aws:sns:us-east-1:123456789012:MyTopic
```

### Describe an application


**Describe an application using the AWS CLI**  
To use the AWS CLI to describe an application created on a resource group called `my-resource-group`, use the following command.

```
aws application-insights describe-application --resource-group-name my-resource-group
```

**Describe an application using AWS Tools for Windows PowerShell**  
To use the AWS Tools for Windows PowerShell to describe an application created on a resource group called `my-resource-group`, use the following command.

```
Get-CWAIApplication -ResourceGroupName my-resource-group
```

### List components in an application


**List components in an application using the AWS CLI**  
To use the AWS CLI to list the components created on a resource group called `my-resource-group`, use the following command.

```
aws application-insights list-components --resource-group-name my-resource-group
```

**List components in an application using AWS Tools for Windows PowerShell**  
To use the AWS Tools for Windows PowerShell to list the components created on a resource group called `my-resource-group`, use the following command.

```
Get-CWAIComponentList -ResourceGroupName my-resource-group
```

### Describe a component


**Describe a component using the AWS CLI**  
You can use the following AWS CLI command to describe a component called `my-component` that belongs to an application created on a resource group called `my-resource-group`.

```
aws application-insights describe-component --resource-group-name my-resource-group --component-name my-component
```

**Describe a component using AWS Tools for Windows PowerShell**  
You can use the following AWS Tools for Windows PowerShell command to describe a component called `my-component` that belongs to an application created on a resource group called `my-resource-group`.

```
Get-CWAIComponent -ComponentName my-component -ResourceGroupName my-resource-group
```

### Group similar resources into a custom component


We recommend grouping similar resources, such as .NET web server instances, into custom components for easier on-boarding and better monitoring and insights. CloudWatch Application Insights supports custom groups for EC2 instances.

**To group resources into a custom component using the AWS CLI**  
To use the AWS CLI to group three instances (`arn:aws:ec2:us-east-1:123456789012:instance/i-11111`, `arn:aws:ec2:us-east-1:123456789012:instance/i-22222`, and `arn:aws:ec2:us-east-1:123456789012:instance/i-33333`) together into a custom component called `my-component` for an application created for the resource group called `my-resource-group`, use the following command. 

```
aws application-insights create-component --resource-group-name my-resource-group --component-name my-component --resource-list arn:aws:ec2:us-east-1:123456789012:instance/i-11111 arn:aws:ec2:us-east-1:123456789012:instance/i-22222 arn:aws:ec2:us-east-1:123456789012:instance/i-33333
```

**To group resources into a custom component using AWS Tools for Windows PowerShell**  
To use AWS Tools for Windows PowerShell to group three instances (`arn:aws:ec2:us-east-1:123456789012:instance/i-11111`, `arn:aws:ec2:us-east-1:123456789012:instance/i-22222`, and `arn:aws:ec2:us-east-1:123456789012:instance/i-33333`) together into a custom component called `my-component`, for an application created for the resource group called `my-resource-group`, use the following command.

```
New-CWAIComponent -ResourceGroupName my-resource-group -ComponentName my-component -ResourceList arn:aws:ec2:us-east-1:123456789012:instance/i-11111,arn:aws:ec2:us-east-1:123456789012:instance/i-22222,arn:aws:ec2:us-east-1:123456789012:instance/i-33333 
```

### Ungroup a custom component


**To ungroup a custom component using the AWS CLI**  
To use the AWS CLI to ungroup a custom component named `my-component` in an application created on the resource group, `my-resource-group`, use the following command. 

```
aws application-insights delete-component --resource-group-name my-resource-group --component-name my-new-component
```

**To ungroup a custom component using AWS Tools for Windows PowerShell**  
To use the AWS Tools for Windows PowerShell to ungroup a custom component named `my-component` in an application created on the resource group, `my-resource-group`, use the following command.

```
Remove-CWAIComponent -ComponentName my-component -ResourceGroupName my-resource-group
```

### Update an application


**Update an application using the AWS CLI**  
You can use the AWS CLI to update an application to generate AWS Systems Manager OpsCenter OpsItems for problems detected with the application, and to associate the created OpsItems to the SNS topic `arn:aws:sns:us-east-1:123456789012:MyTopic`, using the following command.

```
aws application-insights update-application --resource-group-name my-resource-group --ops-center-enabled --ops-item-sns-topic-arn arn:aws:sns:us-east-1:123456789012:MyTopic
```

**Update an application using AWS Tools for Windows PowerShell**  
You can use the AWS Tools for Windows PowerShell to update an application to generate AWS SSM OpsCenter OpsItems for problems detected with the application, and to associate the created OpsItems to the SNS topic `arn:aws:sns:us-east-1:123456789012:MyTopic` , using the following command.

```
Update-CWAIApplication -ResourceGroupName my-resource-group -OpsCenterEnabled true -OpsItemSNSTopicArn arn:aws:sns:us-east-1:123456789012:MyTopic
```

### Update a custom component


**Update a custom component using the AWS CLI**  
You can use the AWS CLI to update a custom component called `my-component` with a new component name, `my-new-component`, and an updated group of instances, by using the following command.

```
aws application-insights update-component --resource-group-name my-resource-group --component-name my-component --new-component-name my-new-component --resource-list arn:aws:ec2:us-east-1:123456789012:instance/i-44444 arn:aws:ec2:us-east-1:123456789012:instance/i-55555
```

**Update a custom component using AWS Tools for Windows PowerShell**  
You can use the AWS Tools for Windows PowerShell to update a custom component called `my-component` with a new component name, `my-new-component`, and an updated group of instances, by using the following command.

```
Update-CWAIComponent -ComponentName my-component -NewComponentName my-new-component -ResourceGroupName my-resource-group -ResourceList arn:aws:ec2:us-east-1:123456789012:instance/i-44444,arn:aws:ec2:us-east-1:123456789012:instance/i-55555
```

## Manage and update monitoring
Manage monitoring

You can manage and update monitoring for your Application Insights application using the command line.

**Topics**
+ [

### List problems with your application
](#appinsights-list-problems-monitoring)
+ [

### Describe an application problem
](#appinsights-describe-app-problem)
+ [

### Describe the anomalies or errors associated with a problem
](#appinsights-describe-anomalies)
+ [

### Describe an anomaly or error with the application
](#appinsights-describe-anomalies)
+ [

### Describe the monitoring configurations of a component
](#appinsights-describe-monitoring)
+ [

### Describe the recommended monitoring configuration of a component
](#appinsights-describe-rec-monitoring)
+ [

### Update the monitoring configurations for a component
](#update-monitoring)
+ [

### Remove a specified resource group from Application Insights monitoring
](#update-monitoring)

### List problems with your application


**List problems with your application using the AWS CLI**  
To use the AWS CLI to list problems with your application detected between 1,000 and 10,000 milliseconds since Unix Epoch for an application created on a resource group called `my-resource-group`, use the following command.

```
aws application-insights list-problems --resource-group-name my-resource-group --start-time 1000 --end-time 10000
```

**List problems with your application using AWS Tools for Windows PowerShell**  
To use the AWS Tools for Windows PowerShell to list problems with your application detected between 1,000 and 10,000 milliseconds since Unix Epoch for an application created on a resource group called `my-resource-group`, use the following command.

```
$startDate = "8/6/2019 3:33:00"
$endDate = "8/6/2019 3:34:00"
Get-CWAIProblemList -ResourceGroupName my-resource-group -StartTime $startDate -EndTime $endDate
```

### Describe an application problem


**Describe an application problem using the AWS CLI**  
To use the AWS CLI to describe a problem with problem id `p-1234567890`, use the following command.

```
aws application-insights describe-problem —problem-id p-1234567890
```

**Describe an application problem using AWS Tools for Windows PowerShell**  
To use the AWS Tools for Windows PowerShell to describe a problem with problem id `p-1234567890`, use the following command.

```
Get-CWAIProblem -ProblemId p-1234567890
```

### Describe the anomalies or errors associated with a problem


**Describe the anomalies or errors associated with a problem using the AWS CLI**  
To use the AWS CLI to describe the anomalies or errors associated with a problem with problem id `p-1234567890`, use the following command.

```
aws application-insights describe-problem-observations --problem-id -1234567890
```

**Describe the anomalies or errors associated with a problem using AWS Tools for Windows PowerShell**  
To use the AWS Tools for Windows PowerShell to describe the anomalies or errors associated with a problem with problem id `p-1234567890`, use the following command.

```
Get-CWAIProblemObservation -ProblemId p-1234567890
```

### Describe an anomaly or error with the application


**Describe an anomaly or error with the application using the AWS CLI**  
To use the AWS CLI to describe an anomaly or error with the application with the observation id `o-1234567890`, use the following command.

```
aws application-insights describe-observation —observation-id o-1234567890
```

**Describe an anomaly or error with the application using AWS Tools for Windows PowerShell**  
To use the AWS Tools for Windows PowerShell to describe an anomaly or error with the application with the observation id `o-1234567890`, use the following command.

```
Get-CWAIObservation -ObservationId o-1234567890
```

### Describe the monitoring configurations of a component


**Describe the monitoring configurations of a component using the AWS CLI**  
To use the AWS CLI to describe the monitoring configuration of a component called `my-component` in an application created on the resource group `my-resource-group`, use the following command.

```
aws application-insights describe-component-configuration —resource-group-name my-resource-group —component-name my-component
```

**Describe the monitoring configurations of a component using AWS Tools for Windows PowerShell**  
To use the AWS Tools for Windows PowerShell to describe the monitoring configuration of a component called `my-component`, in an application created on the resource group `my-resource-group`, use the following command.

```
Get-CWAIComponentConfiguration -ComponentName my-component -ResourceGroupName my-resource-group
```

For more information about component configuration and for example JSON files, see [Work with component configurations](component-config.md).

### Describe the recommended monitoring configuration of a component


**Describe the recommended monitoring configuration of a component using the AWS CLI**  
When the component is part of a .NET Worker application, you can use the AWS CLI to describe the recommended monitoring configuration of a component called `my-component` in an application created on the resource group `my-resource-group`, by using the following command.

```
aws application-insights describe-component-configuration-recommendation --resource-group-name my-resource-group --component-name my-component --tier DOT_NET_WORKER
```

**Describe the recommended monitoring configuration of a component using AWS Tools for Windows PowerShell**  
When the component is part of a .NET Worker application, you can use the AWS Tools for Windows PowerShell to describe the recommended monitoring configuration of a component called `my-component` in an application created on the resource group `my-resource-group`, by using the following command.

```
Get-CWAIComponentConfigurationRecommendation -ComponentName my-component -ResourceGroupName my-resource-group -Tier DOT_NET_WORKER
```

For more information about component configuration and for example JSON files, see [Work with component configurations](component-config.md).

### Update the monitoring configurations for a component


**Update the monitoring configurations for a component using the AWS CLI**  
To use the AWS CLI to update the component called `my-component` in an application created on the resource group called `my-resource-group`, use the following command. The command includes these actions:

1. Enable monitoring for the component.

1. Set the tier of the component to `.NET Worker`.

1. Update the JSON configuration of the component to read from the local file `configuration.txt`.

```
aws application-insights update-component-configuration --resource-group-name my-resource-group --component-name my-component --tier DOT_NET_WORKER --monitor --component-configuration "file://configuration.txt"
```

**Update the monitoring configurations for a component using the AWS Tools for Windows PowerShell**  
To use the AWS Tools for Windows PowerShell to update the component called `my-component` in an application created on the resource group called `my-resource-group`, use the following command. The command includes these actions:

1. Enable monitoring for the component.

1. Set the tier of the component to `.NET Worker`.

1. Update the JSON configuration of the component to read from the local file `configuration.txt`.

```
[string]$config = Get-Content -Path configuration.txt
Update-CWAIComponentConfiguration -ComponentName my-component -ResourceGroupName my-resource-group -Tier DOT_NET_WORKER -Monitor 1 -ComponentConfiguration $config
```

For more information about component configuration and for example JSON files, see [Work with component configurations](component-config.md).

### Remove a specified resource group from Application Insights monitoring


**Remove a specified resource group from Application Insights monitoring using the AWS CLI**  
To use the AWS CLI to remove an application created on the resource group called `my-resource-group` from monitoring, use the following command.

```
aws application-insights delete-application --resource-group-name my-resource-group
```

**Remove a specified resource group from Application Insights monitoring using the AWS Tools for Windows PowerShell**  
To use the AWS Tools for Windows PowerShell to remove an application created on the resource group called `my-resource-group` from monitoring, use the following command.

```
Remove-CWAIApplication -ResourceGroupName my-resource-group
```

## Configure monitoring for SQL Always On Availability Groups


1. Create an application for the resource group with the SQL HA EC2 instances.

   ```
   aws application-insights create-application ‐-region <REGION> ‐-resource-group-name  <RESOURCE_GROUP_NAME>
   ```

1. Define the EC2 instances that represent the SQL HA cluster by creating a new application component.

   ```
   aws application-insights create-component ‐-resource-group-name  "<RESOURCE_GROUP_NAME>" ‐-component-name SQL_HA_CLUSTER ‐-resource-list  "arn:aws:ec2:<REGION>:<ACCOUNT_ID>:instance/<CLUSTER_INSTANCE_1_ID>" "arn:aws:ec2:<REGION>:<ACCOUNT_ID>:instance/<CLUSTER_INSTANCE_2_ID>
   ```

1. Configure the SQL HA component.

   ```
   aws application-insights  update-component-configuration ‐-resource-group-name "<RESOURCE_GROUP_NAME>" ‐-region <REGION> ‐-component-name "SQL_HA_CLUSTER" ‐-monitor ‐-tier SQL_SERVER_ALWAYSON_AVAILABILITY_GROUP ‐-monitor  ‐-component-configuration '{
     "subComponents" : [ {
       "subComponentType" : "AWS::EC2::Instance",
       "alarmMetrics" : [ {
         "alarmMetricName" : "CPUUtilization",
         "monitor" : true
       }, {
         "alarmMetricName" : "StatusCheckFailed",
         "monitor" : true
       }, {
         "alarmMetricName" : "Processor % Processor Time",
         "monitor" : true
       }, {
         "alarmMetricName" : "Memory % Committed Bytes In Use",
         "monitor" : true
       }, {
         "alarmMetricName" : "Memory Available Mbytes",
         "monitor" : true
       }, {
         "alarmMetricName" : "Paging File % Usage",
         "monitor" : true
       }, {
         "alarmMetricName" : "System Processor Queue Length",
         "monitor" : true
       }, {
         "alarmMetricName" : "Network Interface Bytes Total/sec",
         "monitor" : true
       }, {
         "alarmMetricName" : "PhysicalDisk % Disk Time",
         "monitor" : true
       }, {
         "alarmMetricName" : "SQLServer:Buffer Manager Buffer cache hit ratio",
         "monitor" : true
       }, {
         "alarmMetricName" : "SQLServer:Buffer Manager Page life expectancy",
         "monitor" : true
       }, {
         "alarmMetricName" : "SQLServer:General Statistics Processes blocked",
         "monitor" : true
       }, {
         "alarmMetricName" : "SQLServer:General Statistics User Connections",
         "monitor" : true
       }, {
         "alarmMetricName" : "SQLServer:Locks Number of Deadlocks/sec",
         "monitor" : true
       }, {
         "alarmMetricName" : "SQLServer:SQL Statistics Batch Requests/sec",
         "monitor" : true
       }, {
         "alarmMetricName" : "SQLServer:Database Replica File Bytes Received/sec",
         "monitor" : true
       }, {
         "alarmMetricName" : "SQLServer:Database Replica Log Bytes Received/sec",
         "monitor" : true
       }, {
         "alarmMetricName" : "SQLServer:Database Replica Log remaining for undo",
         "monitor" : true
       }, {
         "alarmMetricName" : "SQLServer:Database Replica Log Send Queue",
         "monitor" : true
       }, {
         "alarmMetricName" : "SQLServer:Database Replica Mirrored Write Transaction/sec",
         "monitor" : true
       }, {
         "alarmMetricName" : "SQLServer:Database Replica Recovery Queue",
         "monitor" : true
       }, {
         "alarmMetricName" : "SQLServer:Database Replica Redo Bytes Remaining",
         "monitor" : true
       }, {
         "alarmMetricName" : "SQLServer:Database Replica Redone Bytes/sec",
         "monitor" : true
       }, {
         "alarmMetricName" : "SQLServer:Database Replica Total Log requiring undo",
         "monitor" : true
       }, {
         "alarmMetricName" : "SQLServer:Database Replica Transaction Delay",
         "monitor" : true
       } ],
       "windowsEvents" : [ {
         "logGroupName" : "WINDOWS_EVENTS-Application-<RESOURCE_GROUP_NAME>",
         "eventName" : "Application",
         "eventLevels" : [ "WARNING", "ERROR", "CRITICAL", "INFORMATION" ],
         "monitor" : true
       }, {
         "logGroupName" : "WINDOWS_EVENTS-System-<RESOURCE_GROUP_NAME>",
         "eventName" : "System",
         "eventLevels" : [ "WARNING", "ERROR", "CRITICAL" ],
         "monitor" : true
       }, {
         "logGroupName" : "WINDOWS_EVENTS-Security-<RESOURCE_GROUP_NAME>",
         "eventName" : "Security",
         "eventLevels" : [ "WARNING", "ERROR", "CRITICAL" ],
         "monitor" : true
       } ],
       "logs" : [ {
         "logGroupName" : "SQL_SERVER_ALWAYSON_AVAILABILITY_GROUP-<RESOURCE_GROUP_NAME>",
         "logPath" : "C:\\Program Files\\Microsoft SQL Server\\MSSQL**.MSSQLSERVER\\MSSQL\\Log\\ERRORLOG",
         "logType" : "SQL_SERVER",
         "monitor" : true,
         "encoding" : "utf-8"
       } ]
     }, {
       "subComponentType" : "AWS::EC2::Volume",
       "alarmMetrics" : [ {
         "alarmMetricName" : "VolumeReadBytes",
         "monitor" : true
       }, {
       "alarmMetricName" : "VolumeWriteBytes",
         "monitor" : true
       }, {
       "alarmMetricName" : "VolumeReadOps",
         "monitor" : true
       }, {
       "alarmMetricName" : "VolumeWriteOps",
         "monitor" : true
       }, {
       "alarmMetricName" : "VolumeQueueLength",
         "monitor" : true
       }, {
       "alarmMetricName" : "VolumeThroughputPercentage",
         "monitor" : true
       }, {
       "alarmMetricName" : "BurstBalance",
         "monitor" : true
       } ]
     } ]
   }'
   ```

**Note**  
Application Insights must ingest Application Event logs (information level) to detect cluster activities such as failover.

## Configure monitoring for MySQL RDS


1. Create an application for the resource group with the RDS MySQL database instance.

   ```
   aws application-insights create-application ‐-region <REGION> ‐-resource-group-name  <RESOURCE_GROUP_NAME>
   ```

1. The error log is enabled by default. The slow query log can be enabled using data parameter groups. For more information, see [Accessing the MySQL Slow Query and General Logs](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_LogAccess.Concepts.MySQL.html#USER_LogAccess.MySQL.Generallog).
   + `set slow_query_log = 1`
   + `set log_output = FILE`

1. Export the logs to be monitored to CloudWatch logs. For more information, see [Publishing MySQL Logs to CloudWatch Logs](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_LogAccess.Concepts.MySQL.html#USER_LogAccess.MySQLDB.PublishtoCloudWatchLogs).

1. Configure the MySQL RDS component.

   ```
   aws application-insights  update-component-configuration ‐-resource-group-name "<RESOURCE_GROUP_NAME>" ‐-region <REGION> ‐-component-name "<DB_COMPONENT_NAME>" ‐-monitor ‐-tier DEFAULT ‐-monitor  ‐-component-configuration "{\"alarmMetrics\":[{\"alarmMetricName\":\"CPUUtilization\",\"monitor\":true}],\"logs\":[{\"logType\":\"MYSQL\",\"monitor\":true},{\"logType\": \"MYSQL_SLOW_QUERY\",\"monitor\":false}]}"
   ```

## Configure monitoring for MySQL EC2


1. Create an application for the resource group with the SQL HA EC2 instances.

   ```
   aws application-insights create-application ‐-region <REGION> ‐-resource-group-name  <RESOURCE_GROUP_NAME>
   ```

1. The error log is enabled by default. The slow query log can be enabled using data parameter groups. For more information, see [Accessing the MySQL Slow Query and General Logs](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_LogAccess.Concepts.MySQL.html#USER_LogAccess.MySQL.Generallog).
   + `set slow_query_log = 1`
   + `set log_output = FILE`

1. Configure the MySQL EC2 component.

   ```
   aws application-insights  update-component-configuration ‐-resource-group-name "<RESOURCE_GROUP_NAME>" ‐-region <REGION> ‐-component-name "<DB_COMPONENT_NAME>" ‐-monitor ‐-tier MYSQL ‐-monitor  ‐-component-configuration "{\"alarmMetrics\":[{\"alarmMetricName\":\"CPUUtilization\",\"monitor\":true}],\"logs\":[{\"logGroupName\":\"<UNIQUE_LOG_GROUP_NAME>\",\"logPath\":\"C:\\\\ProgramData\\\\MySQL\\\\MySQL Server **\\\\Data\\\\<FILE_NAME>.err\",\"logType\":\"MYSQL\",\"monitor\":true,\"encoding\":\"utf-8\"}]}"
   ```

## Configure monitoring for PostgreSQL RDS


1. Create an application for the resource group with the PostgreSQL RDS database instance.

   ```
   aws application-insights create-application ‐-region <REGION> ‐-resource-group-name  <RESOURCE_GROUP_NAME>
   ```

1. Publishing PostgreSQL logs to CloudWatch is not enabled by default. To enable monitoring, open the RDS console and select the database to monitor. Choose **Modify** in the upper right corner, and select the check box labeled **PostgreSQL** log. Choose **Continue** to save this setting.

1. Your PostgreSQL logs are exported to CloudWatch.

1. Configure the PostgreSQL RDS component.

   ```
   aws application-insights update-component-configuration --region <REGION> --resource-group-name <RESOURCE_GROUP_NAME> --component-name <DB_COMPONENT_NAME> --monitor --tier DEFAULT --component-configuration 
   "{
      \"alarmMetrics\":[
         {
            \"alarmMetricName\": \"CPUUtilization\",
            \"monitor\": true
         }
      ],
      \"logs\":[
         {
            \"logType\": \"POSTGRESQL\",
            \"monitor\": true
         }
      ]
   }"
   ```

## Configure monitoring for PostgreSQL EC2


1. Create an application for the resource group with the PostgreSQL EC2 instance.

   ```
   aws application-insights create-application ‐-region <REGION> ‐-resource-group-name  <RESOURCE_GROUP_NAME>
   ```

1. Configure the PostgreSQL EC2 component.

   ```
   aws application-insights update-component-configuration ‐-region <REGION> ‐-resource-group-name <RESOURCE_GROUP_NAME> ‐-component-name <DB_COMPONENT_NAME> ‐-monitor ‐-tier POSTGRESQL ‐-component-configuration 
   "{
      \"alarmMetrics\":[
         {
            \"alarmMetricName\":\"CPUUtilization\",
            \"monitor\":true
         }
      ],
      \"logs\":[
         {
            \"logGroupName\":\"<UNIQUE_LOG_GROUP_NAME>\",
            \"logPath\":\"/var/lib/pgsql/data/log/\",
            \"logType\":\"POSTGRESQL\",
            \"monitor\":true,
            \"encoding\":\"utf-8\"
         }
      ]
   }"
   ```

## Configure monitoring for Oracle RDS


1. Create an application for the resource group with the Oracle RDS database instance.

   ```
   aws application-insights create-application ‐-region <REGION> ‐-resource-group-name  <RESOURCE_GROUP_NAME>
   ```

1. Publishing Oracle logs to CloudWatch is not enabled by default. To enable monitoring, open the RDS console and select the database to monitor. Choose **Modify** in the upper right corner, and select the check boxes labeled **Alert** log and **Listener** log. Choose **Continue** to save this setting.

1. Your Oracle logs are exported to CloudWatch.

1. Configure the Oracle RDS component.

   ```
   aws application-insights update-component-configuration --region <REGION> --resource-group-name <RESOURCE_GROUP_NAME> --component-name <DB_COMPONENT_NAME> --monitor --tier DEFAULT --component-configuration 
   "{
      \"alarmMetrics\":[
         {
            \"alarmMetricName\": \"CPUUtilization\",
            \"monitor\": true
         }
      ],
      \"logs\":[
         {
            \"logType\": \"ORACLE_ALERT\",
            \"monitor\": true
         },
         {
            \"logType\": \"ORACLE_LISTENER\",
            \"monitor\": true
         }
      ]
   }"
   ```

## Configure monitoring for Oracle EC2


1. Create an application for the resource group with the Oracle EC2 instance.

   ```
   aws application-insights create-application ‐-region <REGION> ‐-resource-group-name  <RESOURCE_GROUP_NAME>
   ```

1. Configure the Oracle EC2 component.

   ```
   aws application-insights update-component-configuration ‐-region <REGION> ‐-resource-group-name <RESOURCE_GROUP_NAME> ‐-component-name <DB_COMPONENT_NAME> ‐-monitor ‐-tier ORACLE ‐-component-configuration 
   "{
      \"alarmMetrics\":[
         {
            \"alarmMetricName\":\"CPUUtilization\",
            \"monitor\":true
         }
      ],
      \"logs\":[
         {
            \"logGroupName\":\"<UNIQUE_LOG_GROUP_NAME>\",
            \"logPath\":\"/opt/oracle/diag/rdbms/*/*/trace\",
            \"logType\":\"ORACLE_ALERT\",
            \"monitor\":true,
         },
         {
            \"logGroupName\":\"<UNIQUE_LOG_GROUP_NAME>\",
            \"logPath\":\"/opt/oracle/diag/tnslsnr/$HOSTNAME/listener/trace/\",
            \"logType\":\"ORACLE_ALERT\",
            \"monitor\":true,
         }
      ]
   }"
   ```

# Application Insights CloudWatch Events for detected problems
Events

For each application that is added to CloudWatch Application Insights, a CloudWatch event is published for the following events on a best effort basis:
+ **Problem creation.** Emitted when CloudWatch Application Insights detects a new problem.
  + Detail Type: ** "Application Insights Problem Detected"**
  + Detail:
    + `problemId`: The detected problem ID.
    + `region`: The AWS Region where the problem was created.
    + `resourceGroupName`: The Resource Group for the registered application for which the problem was detected.
    + `status`: The status of the problem. Possible status and definitions are as follows:
      + `In progress`: A new problem has been identified. The problem is still receiving observations.
      + `Recovering`: The problem is stabilizing. You can manually resolve the problem when it is in this state. 
      + `Resolved`: The problem is resolved. There are no new observations about this problem.
      + `Recurring`: The problem was resolved within the past 24 hours. It has reopened as a result of additional observations.
    + `severity`: The severity of the problem.
    + `problemUrl`: The console URL for the problem.
+ **Problem update.** Emitted when the problem is updated with a new observation or when an existing observation is updated and the problem is subsequently updated; updates include a resolution or closure of the problem.
  + Detail Type: ** "Application Insights Problem Updated"**
  + Detail:
    + `problemId`: The created problem ID.
    + `region`: The AWS Region where the problem was created.
    + `resourceGroupName`: The Resource Group for the registered application for which the problem was detected.
    + `status`: The status of the problem.
    + `severity`: The severity of the problem.
    + `problemUrl`: The console URL for the problem.

# Receive notifications for detected problems
Notifications

You can use Amazon SNS notifications, Systems Manager OpsCenter, or CloudWatch Events to receive notifications about problems that are detected in your applications. 

**CloudWatch Application Insights Amazon SNS notifications for detected problems**  
You can configure Amazon SNS notifications using the AWS Management Console or the AWS CLI. To set up notifications using the AWS Management Console, you must have the necessary Amazon SNS permissions as shown in the following example. 

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
      {
        "Effect": "Allow",
        "Action": [
          "sns:ListTopics",
          "sns:Subscribe",
          "sns:CreateTopic"
        ],    
        "Resource": [
          "*" 
        ]
      }
    ]    
}
```

------

After you set up Amazon SNS notifications, you receive email notifications when a problem is created or resolved. You also receive notifications when a new observation is added to an existing problem.

The following example shows the content of an email notification.

```
    You are receiving this email because Problem "p-1234567" has been CREATED by Amazon CloudWatch Application Insights
    
    Problem Details: 
    Problem URL: https:////console.aws.amazon.com/cloudwatch/home?region=us-east-1#settings:AppInsightsSettings/problemDetails?problemId=p-1234567
    Problem Summary: Title of the problem
    Severity: HIGH
    Insights: Something specific is broken
    Status : RESOLVED
    AffectedResource: arn:aws:ec2:us-east-1:555555555555:host/testResource
    Region: us-east-1
    RecurringCount: 0
    StartTime: 2019-03-23T10:42:57.777Z
    LastUpdatedTime: 2019-03-23T21:49:37.777Z
    LastRecurrenceTime: 
    StopTime: 2019-03-23T21:49:37.777Z
    
    Recent Issues
    - TelemetryArn:alarm1
      StartTime: 2024-08-15T22:12:46.007Z
      StopTime:
    - TelemetryArn:log-group1
      StartTime: 2024-08-15T22:12:46.007Z
      StopTime: 2024-08-15T22:12:46.007Z
```

**How to receive problem notifications using Systems Manager**  
**Actions through AWS Systems Manager.** CloudWatch Application Insights provides built-in integration with Systems Manager OpsCenter. If you choose to use this integration for your application, an OpsItem is created on the OpsCenter console for every problem detected with the application. From the OpsCenter console, you can view summarized information about the problem detected by CloudWatch Application Insights and pick a Systems Manager Automation runbook to take remedial actions or further identify Windows processes that are causing resource issues in your application. 

**How to receive problem notifications using CloudWatch Events**  
From the CloudWatch console, select **Rules** under **Events** in the left navigation pane. From the **Rules **page, select **Create rule**. Choose **Amazon CloudWatch Application Insights** from the **Service Name** dropdown list and choose the **Event Type**. Then, choose **Add target** and select the target and parameters, for example, an **SNS topic** or **Lambda function**. 

# Application Insights cross-account observability


With CloudWatch Application Insights cross-account observability, you can monitor and troubleshoot your applications that span multiple AWS accounts within a single Region.

You can use Amazon CloudWatch Observability Access Manager to set up one or more of your AWS accounts as a monitoring account. You’ll provide the monitoring account with the ability to view data in your source account by creating a sink in your monitoring account. You use the sink to create a link from your source account to your monitoring account. For more information, see [CloudWatch cross-account observability](CloudWatch-Unified-Cross-Account.md).

**Required resources**  
For proper functionality of CloudWatch Application Insights cross-account observability, ensure that the following telemetry types are shared through the CloudWatch Observability Access Manager.
+ Applications in CloudWatch Application Insights
+ Metrics in Amazon CloudWatch
+ Log groups in Amazon CloudWatch Logs
+ Traces in [AWS X-Ray](https://docs.aws.amazon.com/xray/latest/devguide/aws-xray.html)

# Work with component configurations
Work with component configurations

A component configuration is a text file in JSON format that describes the configuration settings of the component. This section provides an example template fragment, descriptions of component configuration sections, and example component configurations.

**Topics**
+ [Template fragment](component-config-json.md)
+ [Sections](component-config-sections.md)
+ [Example configurations for relevant services](component-configuration-examples.md)

# Component configuration template fragment
Template fragment

The following example shows a template fragment in JSON format.

```
{
  "alarmMetrics" : [
    list of alarm metrics
  ],
  "logs" : [
    list of logs
  ],
  "processes" : [
   list of processes
  ],
  "windowsEvents" : [
    list of windows events channels configurations
  ],
  "alarms" : [
    list of CloudWatch alarms
  ],
  "jmxPrometheusExporter": {
    JMX Prometheus Exporter configuration
  },
  "hanaPrometheusExporter": {
      SAP HANA Prometheus Exporter configuration
  },
  "haClusterPrometheusExporter": {
      HA Cluster Prometheus Exporter configuration
  },
  "netWeaverPrometheusExporter": {
      SAP NetWeaver Prometheus Exporter configuration
  },
  "subComponents" : [
    {
      "subComponentType" : "AWS::EC2::Instance" ...
      component nested instances configuration
    },
    {
      "subComponentType" : "AWS::EC2::Volume" ...
      component nested volumes configuration
    }
  ]
}
```

# Component configuration sections
Sections

A component configuration includes several major sections. Sections in a component configuration can be listed in any order.
+ **alarmMetrics (optional)**

  A list of [metrics](#component-config-metric) to monitor for the component. All component types can have an alarmMetrics section. 
+ **logs (optional)**

  A list of [logs](#component-configuration-log) to monitor for the component. Only EC2 instances can have a logs section. 
+ **processes (optional)**

  A list of [processes](#component-configuration-process) to monitor for the component. Only EC2 instances can have a processes section. 
+ **subComponents (optional)**

  Nested instance and volume subComponent configuration for the component. The following types of components can have nested instances and a subComponents section: ELB, ASG, custom-grouped EC2 instances , and EC2 instances.
+ **alarms (optional)**

  A list of [alarms](#component-configuration-alarms) to monitor for the component. All component types can have an alarm section.
+ **windowsEvents (optional)**

  A list of [windows events](#windows-events) to monitor for the component. Only Windows on EC2 instances have a `windowsEvents` section.
+ **JMXPrometheusExporter (optional)**

  JMXPrometheus Exporter configuration.
+ **hanaPrometheusExporter (optional)**

  SAP HANA Prometheus Exporter configuration.
+ **haClusterPrometheusExporter (optional)**

  HA Cluster Prometheus Exporter configuration.
+ **netWeaverPrometheusExporter (optional) **

  SAP NetWeaver Prometheus Exporter configuration.
+ **sapAsePrometheusExporter (optional)**

  SAP ASE Prometheus Exporter configuration.

The following example shows the syntax for the **subComponents section fragment** in JSON format.

```
[
  {
    "subComponentType" : "AWS::EC2::Instance",
    "alarmMetrics" : [
      list of alarm metrics
    ],
    "logs" : [
      list of logs
    ],
    "processes": [
      list of processes
    ],
    "windowsEvents" : [
      list of windows events channels configurations
    ]
  },
  {
    "subComponentType" : "AWS::EC2::Volume",
    "alarmMetrics" : [
      list of alarm metrics
    ]
  }
]
```

## Component configuration section properties


This section describes the properties of each component configuration section.

**Topics**
+ [

### Metric
](#component-config-metric)
+ [

### Log
](#component-configuration-log)
+ [

### Process
](#component-configuration-process)
+ [

### JMX Prometheus Exporter
](#component-configuration-prometheus)
+ [

### HANA Prometheus Exporter
](#component-configuration-hana-prometheus)
+ [

### HA Cluster Prometheus Exporter
](#component-configuration-ha-cluster-prometheus)
+ [

### NetWeaver Prometheus Exporter
](#component-configuration-netweaver-prometheus)
+ [

### SAP ASE Prometheus Exporter
](#component-configuration-sap-ase-prometheus)
+ [

### Windows Events
](#windows-events)
+ [

### Alarm
](#component-configuration-alarms)

### Metric


Defines a metric to be monitored for the component.

**JSON** 

```
{
  "alarmMetricName" : "monitoredMetricName",
  "monitor" : true/false
}
```

**Properties**
+ **alarmMetricName (required)**

  The name of the metric to be monitored for the component. For metrics supported by Application Insights, see [Logs and metrics supported by Amazon CloudWatch Application Insights](appinsights-logs-and-metrics.md). 
+ **monitor (optional)**

  Boolean to indicate whether to monitor the metric. The default value is `true`.

### Log


Defines a log to be monitored for the component.

**JSON** 

```
{
  "logGroupName" : "logGroupName",
  "logPath" : "logPath",
  "logType" : "logType",
  "encoding" : "encodingType",
  "monitor" : true/false
}
```

**Properties**
+ **logGroupName (required)**

  The CloudWatch log group name to be associated to the monitored log. For the log group name constraints, see [CreateLogGroup](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogGroup.html).
+ **logPath (required for EC2 instance components; not required for components that do not use CloudWatch Agent, such as AWS Lambda)**

  The path of the logs to be monitored. The log path must be an absolute Windows system file path. For more information, see [CloudWatch Agent Configuration File: Logs Section](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Agent-Configuration-File-Details.html#CloudWatch-Agent-Configuration-File-Logssection). 
+ **logType (required)**

  The log type decides the log patterns against which Application Insights analyzes the log. The log type is selected from the following:
  + `SQL_SERVER`
  + `MYSQL`
  + `MYSQL_SLOW_QUERY`
  + `POSTGRESQL`
  + `ORACLE_ALERT`
  + `ORACLE_LISTENER`
  + `IIS`
  + `APPLICATION`
  + `WINDOWS_EVENTS`
  + `WINDOWS_EVENTS_ACTIVE_DIRECTORY`
  + `WINDOWS_EVENTS_DNS`
  + `WINDOWS_EVENTS_IIS`
  + `WINDOWS_EVENTS_SHAREPOINT`
  + `SQL_SERVER_ALWAYSON_AVAILABILITY_GROUP`
  + `SQL_SERVER_FAILOVER_CLUSTER_INSTANCE`
  + `DEFAULT`
  + `CUSTOM`
  + `STEP_FUNCTION`
  + `API_GATEWAY_ACCESS`
  + `API_GATEWAY_EXECUTION`
  + `SAP_HANA_LOGS`
  + `SAP_HANA_TRACE`
  + `SAP_HANA_HIGH_AVAILABILITY`
  + `SAP_NETWEAVER_DEV_TRACE_LOGS`
  + `PACEMAKER_HIGH_AVAILABILITY`
+ **encoding (optional)**

  The type of encoding of the logs to be monitored. The specified encoding should be included in the list of [CloudWatch agent supported encodings](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AgentReference.html). If not provided, CloudWatch Application Insights uses the default encoding of type utf-8, except for: 
  +  `SQL_SERVER`: utf-16 encoding
  +  `IIS`: ascii encoding
+ **monitor (optional)**

  Boolean that indicates whether to monitor the logs. The default value is `true`.

### Process


Defines a process to be monitored for the component.

**JSON** 

```
{
  "processName" : "monitoredProcessName",
  "alarmMetrics" : [
      list of alarm metrics
  ] 
}
```

**Properties**
+ **processName (required)**

  The name of the process to be monitored for the component. The process name must not contain a process stem, such as `sqlservr` or `sqlservr.exe`.
+ **alarmMetrics (required)**

  A list of [metrics](#component-config-metric) to monitor for this process. To view process metrics supported by CloudWatch Application Insights, see [Amazon Elastic Compute Cloud (EC2)](appinsights-metrics-ec2.md).

### JMX Prometheus Exporter


Defines the JMX Prometheus Exporter settings.

**JSON** 

```
"JMXPrometheusExporter": {
  "jmxURL" : "JMX URL",
  "hostPort" : "The host and port",
  "prometheusPort" : "Target port to emit Prometheus metrics"
}
```

**Properties**
+ **jmxURL (optional)**

  A complete JMX URL to connect to.
+ **hostPort (optional)**

  The host and port to connect to through remote JMX. Only one of `jmxURL` and `hostPort` can be specified.
+ **prometheusPort (optional)**

  The target port to send Prometheus metrics to. If not specified, the default port 9404 is used.

### HANA Prometheus Exporter


Defines the HANA Prometheus Exporter settings.

**JSON** 

```
"hanaPrometheusExporter": {
    "hanaSid": "SAP HANA  SID",
    "hanaPort": "HANA database port",
    "hanaSecretName": "HANA secret name",
    "prometheusPort": "Target port to emit Prometheus metrics"
}
```

**Properties**
+ **hanaSid**

  The three-character SAP system ID (SID) of the SAP HANA system.
+ **hanaPort**

  The HANA database port by which the exporter will query HANA metrics.
+ **hanaSecretName**

  The AWS Secrets Manager secret that stores HANA monitoring user credentials. The HANA Prometheus exporter uses these credentials to connect to the database and query HANA metrics.
+ **prometheusPort (optional)**

  The target port to which Prometheus sends metrics. If not specified, the default port 9668 is used.

### HA Cluster Prometheus Exporter


Defines the HA Cluster Prometheus Exporter settings.

**JSON** 

```
"haClusterPrometheusExporter": {
    "prometheusPort": "Target port to emit Prometheus metrics"
}
```

**Properties**
+ **prometheusPort (optional)**

  The target port to which Prometheus sends metrics. If not specified, the default port 9664 is used.

### NetWeaver Prometheus Exporter


Defines the NetWeaver Prometheus Exporter settings.

**JSON** 

```
"netWeaverPrometheusExporter": {
    "sapSid": "SAP NetWeaver  SID",
    "instanceNumbers": [ "Array of instance Numbers of SAP NetWeaver system "],
"prometheusPort": "Target port to emit Prometheus metrics"
}
```

**Properties**
+ **sapSid**

  The 3 character SAP system ID (SID) of the SAP NetWeaver system.
+ **instanceNumbers**

  Array of the instance Numbers of SAP NetWeaver system.

  **Example: **`"instanceNumbers": [ "00", "01"]`
+ **prometheusPort (optional)**

  The target port to which to send Prometheus metrics. If not specified, the default port `9680` is used.

### SAP ASE Prometheus Exporter


Defines the SAP ASE Prometheus Exporter settings.

**JSON** 

```
"sapASEPrometheusExporter": {
    "sapAseSid": "SAP ASE SID",
    "sapAsePort": "SAP ASE database port",
    "sapAseSecretName": "SAP ASE secret name",
    "prometheusPort": "Target port to emit Prometheus metrics",
    "agreeToEnableASEMonitoring": true
}
```

**Properties**
+ **sapAseSid**

  The three-character SAP system ID (SID) of the SAP ASE system.
+ **sapAsePort**

  The SAP ASE database port by which the exporter will query ASE metrics.
+ **sapAseSecretName**

  The AWS Secrets Manager secret that stores ASE monitoring user credentials. The SAP ASE Prometheus exporter uses these credentials to connect to the database and query ASE metrics.
+ **prometheusPort (optional)**

  The target port to which Prometheus sends metrics. If not specified, the default port 9399 is used. If there is another ASE DB that is using the default port, then we use 9499.

### Windows Events


Defines Windows Events to log.

**JSON** 

```
{
  "logGroupName" : "logGroupName",
  "eventName" : "eventName",
  "eventLevels" : ["ERROR","WARNING","CRITICAL","INFORMATION","VERBOSE"],
  "monitor" : true/false
}
```

**Properties**
+ **logGroupName (required)**

  The CloudWatch log group name to be associated to the monitored log. For the log group name constraints, see [CreateLogGroup](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogGroup.html).
+ **eventName (required)**

  The type of Windows Events to log. It is equivalent to the Windows Event log channel name. For example, System, Security, CustomEventName, etc. This field is required for each type of Windows event to log. 
+ **eventLevels (required)**

  The levels of event to log. You must specify each level to log. Possible values include `INFORMATION`, `WARNING`, `ERROR`, `CRITICAL`, and `VERBOSE`. This field is required for each type of Windows Event to log.
+ **monitor (optional)**

  Boolean that indicates whether to monitor the logs. The default value is `true`.

### Alarm


Defines a CloudWatch alarm to be monitored for the component.

**JSON** 

```
{
  "alarmName" : "monitoredAlarmName",
  "severity" : HIGH/MEDIUM/LOW
}
```

**Properties**
+ **alarmName (required)**

  The name of the CloudWatch alarm to be monitored for the component.
+ **severity (optional)**

  Indicates the degree of outage when the alarm goes off. 

# Component configuration examples
Example configurations for relevant services

The following examples show component configurations in JSON format for relevant services.

**Topics**
+ [

# Amazon DynamoDB table
](component-configuration-examples-dynamo.md)
+ [

# Amazon EC2 Auto Scaling (ASG)
](component-configuration-examples-asg.md)
+ [

# Amazon EKS cluster
](component-configuration-examples-eks-cluster.md)
+ [

# Amazon Elastic Compute Cloud (EC2) instance
](component-configuration-examples-ec2.md)
+ [

# Amazon Elastic Container Service (Amazon ECS)
](component-configuration-examples-ecs.md)
+ [

# Amazon ECS services
](component-configuration-examples-ecs-service.md)
+ [

# Amazon ECS tasks
](component-configuration-examples-ecs-task.md)
+ [

# Amazon Elastic File System (Amazon EFS)
](component-configuration-examples-efs.md)
+ [

# Amazon FSx
](component-configuration-examples-fsx.md)
+ [

# Amazon Relational Database Service (RDS) Aurora MySQL
](component-configuration-examples-rds-aurora.md)
+ [

# Amazon Relational Database Service (RDS) instance
](component-configuration-examples-rds.md)
+ [

# Amazon Route 53 health check
](component-configuration-examples-health-check.md)
+ [

# Amazon Route 53 hosted zone
](component-configuration-examples-hosted-zone.md)
+ [

# Amazon Route 53 Resolver endpoint
](component-configuration-examples-resolver-endpoint.md)
+ [

# Amazon Route 53 Resolver query logging configuration
](component-configuration-examples-resolver-query-logging.md)
+ [

# Amazon S3 bucket
](component-configuration-examples-s3.md)
+ [

# Amazon Simple Queue Service (SQS)
](component-configuration-examples-sqs.md)
+ [

# Amazon SNS topic
](component-configuration-examples-sns.md)
+ [

# Amazon Virtual Private Cloud (Amazon VPC)
](component-configuration-examples-vpc.md)
+ [

# Amazon VPC Network Address Translation (NAT) gateways
](component-configuration-examples-nat-gateway.md)
+ [

# API Gateway REST API stages
](component-configuration-examples-api-gateway.md)
+ [

# Application Elastic Load Balancing
](component-configuration-examples-application-elb.md)
+ [

# AWS Lambda Function
](component-configuration-examples-lambda.md)
+ [

# AWS Network Firewall rule group
](component-configuration-examples-firewall-rule-group.md)
+ [

# AWS Network Firewall rule group association
](component-configuration-examples-firewall-rule-group-assoc.md)
+ [

# AWS Step Functions
](component-configuration-examples-step-functions.md)
+ [

# Customer-grouped Amazon EC2 instances
](component-configuration-examples-grouped-ec2.md)
+ [

# Elastic Load Balancing
](component-configuration-examples-elb.md)
+ [

# Java
](component-configuration-examples-java.md)
+ [

# Kubernetes on Amazon EC2
](component-configuration-examples-kubernetes-ec2.md)
+ [

# RDS MariaDB and RDS MySQL
](component-configuration-examples-mysql.md)
+ [

# RDS Oracle
](component-configuration-examples-oracle.md)
+ [

# RDS PostgreSQL
](component-configuration-examples-rds-postgre-sql.md)
+ [

# SAP ASE on Amazon EC2
](component-configuration-examples-sap-ase.md)
+ [

# SAP ASE High Availability on Amazon EC2
](component-configuration-examples-sap-ase-ha.md)
+ [

# SAP HANA on Amazon EC2
](component-configuration-examples-hana.md)
+ [

# SAP HANA High Availability on Amazon EC2
](component-configuration-examples-hana-ha.md)
+ [

# SAP NetWeaver on Amazon EC2
](component-configuration-examples-netweaver.md)
+ [

# SAP NetWeaver High Availability on Amazon EC2
](component-configuration-examples-netweaver-ha.md)
+ [

# SQL Always On Availability Group
](component-configuration-examples-sql.md)
+ [

# SQL failover cluster instance
](component-configuration-examples-sql-failover-cluster.md)

# Amazon DynamoDB table


The following example shows a component configuration in JSON format for Amazon DynamoDB table.

```
{
  "alarmMetrics": [
    {
      "alarmMetricName": "SystemErrors",
      "monitor": false
    },
    {
      "alarmMetricName": "UserErrors",
      "monitor": false
    },
    {
      "alarmMetricName": "ConsumedReadCapacityUnits",
      "monitor": false
    },
    {
      "alarmMetricName": "ConsumedWriteCapacityUnits",
      "monitor": false
    },
    {
      "alarmMetricName": "ReadThrottleEvents",
      "monitor": false
    },
    {
      "alarmMetricName": "WriteThrottleEvents",
      "monitor": false
    },
    {
      "alarmMetricName": "ConditionalCheckFailedRequests",
      "monitor": false
    },
    {
      "alarmMetricName": "TransactionConflict",
      "monitor": false
    }
  ],
  "logs": []
}
```

# Amazon EC2 Auto Scaling (ASG)


The following example shows a component configuration in JSON format for Amazon EC2 Auto Scaling (ASG).

```
{
    "alarmMetrics" : [
      {
        "alarmMetricName" : "CPUCreditBalance"
      }, {
        "alarmMetricName" : "EBSIOBalance%"
      }
    ],
    "subComponents" : [
      {
        "subComponentType" : "AWS::EC2::Instance",
        "alarmMetrics" : [
          {
            "alarmMetricName" : "CPUUtilization"
          }, {
            "alarmMetricName" : "StatusCheckFailed"
          }
        ],
        "logs" : [
          {
            "logGroupName" : "my_log_group",
            "logPath" : "C:\\LogFolder\\*",
            "logType" : "APPLICATION"
          }
        ],
        "processes" : [
          {
            "processName" : "my_process",
            "alarmMetrics" : [
              {
                  "alarmMetricName" : "procstat cpu_usage",
                  "monitor" : true
              }, {
                  "alarmMetricName" : "procstat memory_rss",
                  "monitor" : true
              }
          ]
      }
  ],
        "windowsEvents" : [
          {
            "logGroupName" : "my_log_group_2",
            "eventName" : "Application",
            "eventLevels" : [ "ERROR", "WARNING", "CRITICAL" ]
          }
        ]
      }, {
        "subComponentType" : "AWS::EC2::Volume",
        "alarmMetrics" : [
          {
            "alarmMetricName" : "VolumeQueueLength"
          }, {
            "alarmMetricName" : "BurstBalance"
          }
        ]
      }
    ],
    "alarms" : [
      {
        "alarmName" : "my_asg_alarm",
        "severity" : "LOW"
      }
    ]
  }
```

# Amazon EKS cluster


The following example shows a component configuration in JSON format for Amazon EKS cluster.

```
{
    "alarmMetrics":[
       {
          "alarmMetricName": "cluster_failed_node_count",
          "monitor":true
       },
       {
          "alarmMetricName": "node_cpu_reserved_capacity",
          "monitor":true
       },
       {
          "alarmMetricName": "node_cpu_utilization",
          "monitor":true
       },
       {
          "alarmMetricName": "node_filesystem_utilization",
          "monitor":true
       },
       {
          "alarmMetricName": "node_memory_reserved_capacity",
          "monitor":true
       },
       {
          "alarmMetricName": "node_memory_utilization",
          "monitor":true
       },
       {
          "alarmMetricName": "node_network_total_bytes",
          "monitor":true
       },
       {
          "alarmMetricName": "pod_cpu_reserved_capacity",
          "monitor":true
       },
       {
          "alarmMetricName": "pod_cpu_utilization",
          "monitor":true
       },
       {
          "alarmMetricName": "pod_cpu_utilization_over_pod_limit",
          "monitor":true
       },
       {
          "alarmMetricName": "pod_memory_reserved_capacity",
          "monitor":true
       },
       {
          "alarmMetricName": "pod_memory_utilization",
          "monitor":true
       },
       {
          "alarmMetricName": "pod_memory_utilization_over_pod_limit",
          "monitor":true
       },
       {
          "alarmMetricName": "pod_network_rx_bytes",
          "monitor":true
       },
       {
          "alarmMetricName": "pod_network_tx_bytes",
          "monitor":true
       }
    ],
    "logs":[
       {
          "logGroupName": "/aws/containerinsights/kubernetes/application",
          "logType":"APPLICATION",
          "monitor":true,
          "encoding":"utf-8"
       }
    ],
    "subComponents":[
       {
          "subComponentType":"AWS::EC2::Instance",
          "alarmMetrics":[
             {
                "alarmMetricName":"CPUUtilization",
                "monitor":true
             },
             {
                "alarmMetricName":"StatusCheckFailed",
                "monitor":true
             },
             {
                "alarmMetricName":"disk_used_percent",
                "monitor":true
             },
             {
                "alarmMetricName":"mem_used_percent",
                "monitor":true
             }
          ],
          "logs":[
             {
                "logGroupName":"APPLICATION-KubernetesClusterOnEC2-IAD",
                "logPath":"",
                "logType":"APPLICATION",
                "monitor":true,
                "encoding":"utf-8"
             }
          ],
          "processes" : [
            {
                "processName" : "my_process",
                "alarmMetrics" : [
                    {
                        "alarmMetricName" : "procstat cpu_usage",
                        "monitor" : true
                    }, {
                        "alarmMetricName" : "procstat memory_rss",
                        "monitor" : true
                    }
                ]
            }
        ],
          "windowsEvents":[
             {
                "logGroupName":"my_log_group_2",
                "eventName":"Application",
                "eventLevels":[
                   "ERROR",
                   "WARNING",
                   "CRITICAL"
                ],
                "monitor":true
             }
          ]
       },
       {
          "subComponentType":"AWS::AutoScaling::AutoScalingGroup",
          "alarmMetrics":[
             {
                "alarmMetricName":"CPUCreditBalance",
                "monitor":true
             },
             {
                "alarmMetricName":"EBSIOBalance%",
                "monitor":true
             }
          ]
       },
       {
          "subComponentType":"AWS::EC2::Volume",
          "alarmMetrics":[
             {
                "alarmMetricName":"VolumeReadBytes",
                "monitor":true
             },
             {
                "alarmMetricName":"VolumeWriteBytes",
                "monitor":true
             },
             {
                "alarmMetricName":"VolumeReadOps",
                "monitor":true
             },
             {
                "alarmMetricName":"VolumeWriteOps",
                "monitor":true
             },
             {
                "alarmMetricName":"VolumeQueueLength",
                "monitor":true
             },
             {
                "alarmMetricName":"BurstBalance",
                "monitor":true
             }
          ]
       }
    ]
 }
```

**Note**  
The `subComponents` section of `AWS::EC2::Instance`, `AWS::EC2::Volume`, and `AWS::AutoScaling::AutoScalingGroup` applies only to Amazon EKS cluster running on the EC2 launch type.
The `windowsEvents` section of `AWS::EC2::Instance` in `subComponents` applies only to Windows running on Amazon EC2 instances.

# Amazon Elastic Compute Cloud (EC2) instance


The following example shows a component configuration in JSON format for an Amazon EC2 instance.

**Important**  
When an Amazon EC2 instance enters a `stopped` state, it is removed from monitoring. When it returns to a `running` state, it is added to the list of **Unmonitored components** on the **Application details** page of the CloudWatch Application Insights console. If automatic monitoring of new resources is enabled for the application, the instance is added to the list of **Monitored components**. However, the logs and metrics are set to the default for the workload. The previous log and metrics configuration is not saved. 

```
{
    "alarmMetrics" : [
      {
        "alarmMetricName" : "CPUUtilization",
        "monitor" : true
      }, {
        "alarmMetricName" : "StatusCheckFailed"
      }
    ],
    "logs" : [
      {
        "logGroupName" : "my_log_group",
        "logPath" : "C:\\LogFolder\\*",
        "logType" : "APPLICATION",
        "monitor" : true
      },
      {
        "logGroupName" : "my_log_group_2",
        "logPath" : "C:\\LogFolder2\\*",
        "logType" : "IIS",
        "encoding" : "utf-8"
      }
    ],
    "processes" : [
        {
            "processName" : "my_process",
            "alarmMetrics" : [
                {
                    "alarmMetricName" : "procstat cpu_usage",
                    "monitor" : true
                }, {
                    "alarmMetricName" : "procstat memory_rss",
                    "monitor" : true
                }
            ]
        }
    ],
    "windowsEvents" : [
      {
        "logGroupName" : "my_log_group_3",
        "eventName" : "Application",
        "eventLevels" : [ "ERROR", "WARNING", "CRITICAL" ],
        "monitor" : true
      }, {
        "logGroupName" : "my_log_group_4",
        "eventName" : "System",
        "eventLevels" : [ "ERROR", "WARNING", "CRITICAL" ],
        "monitor" : true
    }],
     "alarms" : [
      {
        "alarmName" : "my_instance_alarm_1",
        "severity" : "HIGH"
      },
      {
        "alarmName" : "my_instance_alarm_2",
        "severity" : "LOW"
      }
    ],
     "subComponents" : [
     {
       "subComponentType" : "AWS::EC2::Volume",
       "alarmMetrics" : [
       {
         "alarmMetricName" : "VolumeQueueLength",
         "monitor" : "true"
       },
       {
         "alarmMetricName" : "VolumeThroughputPercentage",
         "monitor" : "true"
       },
       {
         "alarmMetricName" : "BurstBalance",
         "monitor" : "true"
       }]
    }]
  }
```

# Amazon Elastic Container Service (Amazon ECS)


The following example shows a component configuration in JSON format for Amazon Elastic Container Service (Amazon ECS).

```
{
    "alarmMetrics":[
       {
          "alarmMetricName":"CpuUtilized",
          "monitor":true
       },
       {
          "alarmMetricName":"MemoryUtilized",
          "monitor":true
       },
       {
          "alarmMetricName":"NetworkRxBytes",
          "monitor":true
       },
       {
          "alarmMetricName":"NetworkTxBytes",
          "monitor":true
       },
       {
          "alarmMetricName":"RunningTaskCount",
          "monitor":true
       },
       {
          "alarmMetricName":"PendingTaskCount",
          "monitor":true
       },
       {
          "alarmMetricName":"StorageReadBytes",
          "monitor":true
       },
       {
          "alarmMetricName":"StorageWriteBytes",
          "monitor":true
       }
    ],
    "logs":[
       {
          "logGroupName":"/ecs/my-task-definition",
          "logType":"APPLICATION",
          "monitor":true
       }
    ],
    "subComponents":[
       {
          "subComponentType":"AWS::ElasticLoadBalancing::LoadBalancer",
          "alarmMetrics":[
             {
                "alarmMetricName":"HTTPCode_Backend_4XX",
                "monitor":true
             },
             {
                "alarmMetricName":"HTTPCode_Backend_5XX",
                "monitor":true
             },
             {
                "alarmMetricName":"Latency",
                "monitor":true
             },
             {
                "alarmMetricName":"SurgeQueueLength",
                "monitor":true
             },
             {
                "alarmMetricName":"UnHealthyHostCount",
                "monitor":true
             }
          ]
       },
       {
          "subComponentType":"AWS::ElasticLoadBalancingV2::LoadBalancer",
          "alarmMetrics":[
             {
                "alarmMetricName":"HTTPCode_Target_4XX_Count",
                "monitor":true
             },
             {
                "alarmMetricName":"HTTPCode_Target_5XX_Count",
                "monitor":true
             },
             {
                "alarmMetricName":"TargetResponseTime",
                "monitor":true
             },
             {
                "alarmMetricName":"UnHealthyHostCount",
                "monitor":true
             }
          ]
       },
       {
          "subComponentType":"AWS::EC2::Instance",
          "alarmMetrics":[
             {
                "alarmMetricName":"CPUUtilization",
                "monitor":true
             },
             {
                "alarmMetricName":"StatusCheckFailed",
                "monitor":true
             },
             {
                "alarmMetricName":"disk_used_percent",
                "monitor":true
             },
             {
                "alarmMetricName":"mem_used_percent",
                "monitor":true
             }
          ],
          "logs":[
             {
                "logGroupName":"my_log_group",
                "logPath":"/mylog/path",
                "logType":"APPLICATION",
                "monitor":true
             }
          ],
          "processes" : [
             {
                "processName" : "my_process",
                "alarmMetrics" : [
                    {
                        "alarmMetricName" : "procstat cpu_usage",
                        "monitor" : true
                    }, {
                        "alarmMetricName" : "procstat memory_rss",
                        "monitor" : true
                    }
                 ]
             }
          ],
          "windowsEvents":[
             {
                "logGroupName":"my_log_group_2",
                "eventName":"Application",
                "eventLevels":[
                   "ERROR",
                   "WARNING",
                   "CRITICAL"
                ],
                "monitor":true
             }
          ]
       },
       {
          "subComponentType":"AWS::EC2::Volume",
          "alarmMetrics":[
             {
                "alarmMetricName":"VolumeQueueLength",
                "monitor":"true"
             },
             {
                "alarmMetricName":"VolumeThroughputPercentage",
                "monitor":"true"
             },
             {
                "alarmMetricName":"BurstBalance",
                "monitor":"true"
             }
          ]
       }
    ]
 }
```

**Note**  
The `subComponents` section of `AWS::EC2::Instance` and `AWS::EC2::Volume` applies only to Amazon ECS clusters with ECS service or ECS task running on the EC2 launch type.
The `windowsEvents` section of `AWS::EC2::Instance` in `subComponents` applies only to Windows running on Amazon EC2 instances.

# Amazon ECS services


The following example shows a component configuration in JSON format for an Amazon ECS service.

```
{
    "alarmMetrics":[
       {
          "alarmMetricName":"CPUUtilization",
          "monitor":true
       },
       {
          "alarmMetricName":"MemoryUtilization",
          "monitor":true
       },
       {
          "alarmMetricName":"CpuUtilized",
          "monitor":true
       },
       {
          "alarmMetricName":"MemoryUtilized",
          "monitor":true
       },
       {
          "alarmMetricName":"NetworkRxBytes",
          "monitor":true
       },
       {
          "alarmMetricName":"NetworkTxBytes",
          "monitor":true
       },
       {
          "alarmMetricName":"RunningTaskCount",
          "monitor":true
       },
       {
          "alarmMetricName":"PendingTaskCount",
          "monitor":true
       },
       {
          "alarmMetricName":"StorageReadBytes",
          "monitor":true
       },
       {
          "alarmMetricName":"StorageWriteBytes",
          "monitor":true
       }
    ],
    "logs":[
       {
          "logGroupName":"/ecs/my-task-definition",
          "logType":"APPLICATION",
          "monitor":true
       }
    ],
    "subComponents":[
       {
          "subComponentType":"AWS::ElasticLoadBalancing::LoadBalancer",
          "alarmMetrics":[
             {
                "alarmMetricName":"HTTPCode_Backend_4XX",
                "monitor":true
             },
             {
                "alarmMetricName":"HTTPCode_Backend_5XX",
                "monitor":true
             },
             {
                "alarmMetricName":"Latency",
                "monitor":true
             },
             {
                "alarmMetricName":"SurgeQueueLength",
                "monitor":true
             },
             {
                "alarmMetricName":"UnHealthyHostCount",
                "monitor":true
             }
          ]
       },
       {
          "subComponentType":"AWS::ElasticLoadBalancingV2::LoadBalancer",
          "alarmMetrics":[
             {
                "alarmMetricName":"HTTPCode_Target_4XX_Count",
                "monitor":true
             },
             {
                "alarmMetricName":"HTTPCode_Target_5XX_Count",
                "monitor":true
             },
             {
                "alarmMetricName":"TargetResponseTime",
                "monitor":true
             },
             {
                "alarmMetricName":"UnHealthyHostCount",
                "monitor":true
             }
          ]
       },
       {
          "subComponentType":"AWS::EC2::Instance",
          "alarmMetrics":[
             {
                "alarmMetricName":"CPUUtilization",
                "monitor":true
             },
             {
                "alarmMetricName":"StatusCheckFailed",
                "monitor":true
             },
             {
                "alarmMetricName":"disk_used_percent",
                "monitor":true
             },
             {
                "alarmMetricName":"mem_used_percent",
                "monitor":true
             }
          ],
          "logs":[
             {
                "logGroupName":"my_log_group",
                "logPath":"/mylog/path",
                "logType":"APPLICATION",
                "monitor":true
             }
          ],
          "processes" : [
             {
                "processName" : "my_process",
                "alarmMetrics" : [
                {
                    "alarmMetricName" : "procstat cpu_usage",
                    "monitor" : true
                }, {
                    "alarmMetricName" : "procstat memory_rss",
                    "monitor" : true
                }
            ]
        }
    ],
          "windowsEvents":[
             {
                "logGroupName":"my_log_group_2",
                "eventName":"Application",
                "eventLevels":[
                   "ERROR",
                   "WARNING",
                   "CRITICAL"
                ],
                "monitor":true
             }
          ]
       },
       {
          "subComponentType":"AWS::EC2::Volume",
          "alarmMetrics":[
             {
                "alarmMetricName":"VolumeQueueLength",
                "monitor":"true"
             },
             {
                "alarmMetricName":"VolumeThroughputPercentage",
                "monitor":"true"
             },
             {
                "alarmMetricName":"BurstBalance",
                "monitor":"true"
             }
          ]
       }
    ]
 }
```

**Note**  
The `subComponents` section of `AWS::EC2::Instance` and `AWS::EC2::Volume` applies only to Amazon ECS running on the EC2 launch type.
The `windowsEvents` section of `AWS::EC2::Instance` in `subComponents` applies only to Windows running on Amazon EC2 instances.

# Amazon ECS tasks


The following example shows a component configuration in JSON format for an Amazon ECS task.

```
{
    "logs":[
       {
          "logGroupName":"/ecs/my-task-definition",
          "logType":"APPLICATION",
          "monitor":true
       }
    ],
    "processes" : [
        {
            "processName" : "my_process",
            "alarmMetrics" : [
                {
                    "alarmMetricName" : "procstat cpu_usage",
                    "monitor" : true
                }, {
                    "alarmMetricName" : "procstat memory_rss",
                    "monitor" : true
                }
            ]
        }
    ]
 }
```

# Amazon Elastic File System (Amazon EFS)


The following example shows a component configuration in JSON format for Amazon EFS.

```
{
   "alarmMetrics": [
     {
       "alarmMetricName": "BurstCreditBalance",
       "monitor": true
     },
     {
       "alarmMetricName": "PercentIOLimit",
       "monitor": true
     },
     {
       "alarmMetricName": "PermittedThroughput",
       "monitor": true
     },
     {
       "alarmMetricName": "MeteredIOBytes",
       "monitor": true
     },
     {
       "alarmMetricName": "TotalIOBytes",
       "monitor": true
     },
     {
       "alarmMetricName": "DataWriteIOBytes",
       "monitor": true
     },
     {
       "alarmMetricName": "DataReadIOBytes",
       "monitor": true
     },
     {
       "alarmMetricName": "MetadataIOBytes",
       "monitor": true
     },
     {
       "alarmMetricName": "ClientConnections",
       "monitor": true
     },
     {
       "alarmMetricName": "TimeSinceLastSync",
       "monitor": true
     },
     {
       "alarmMetricName": "Throughput",
       "monitor": true
     },
     {
       "alarmMetricName": "PercentageOfPermittedThroughputUtilization",
       "monitor": true
     },
     {
       "alarmMetricName": "ThroughputIOPS",
       "monitor": true
     },
     {
       "alarmMetricName": "PercentThroughputDataReadIOBytes",
       "monitor": true
     },
     {
       "alarmMetricName": "PercentThroughputDataWriteIOBytes",
       "monitor": true
     },
     {
       "alarmMetricName": "PercentageOfIOPSDataReadIOBytes",
       "monitor": true
     },
     {
       "alarmMetricName": "PercentageOfIOPSDataWriteIOBytes",
       "monitor": true
     },
     {
       "alarmMetricName": "AverageDataReadIOBytesSize",
       "monitor": true
     },
     {
       "alarmMetricName": "AverageDataWriteIOBytesSize",
       "monitor": true
     }
   ],
   "logs": [
    {
    "logGroupName": "/aws/efs/utils",
    "logType": "EFS_MOUNT_STATUS",
    "monitor": true,
    }
   ]
 }
```

# Amazon FSx


The following example shows a component configuration in JSON format for Amazon FSx.

```
{
  "alarmMetrics": [
    {
      "alarmMetricName": "DataReadBytes",
      "monitor": true
    },
    {
      "alarmMetricName": "DataWriteBytes",
      "monitor": true
    },
    {
      "alarmMetricName": "DataReadOperations",
      "monitor": true
    },
    {
      "alarmMetricName": "DataWriteOperations",
      "monitor": true
    },
    {
      "alarmMetricName": "MetadataOperations",
      "monitor": true
    },
    {
      "alarmMetricName": "FreeStorageCapacity",
      "monitor": true
    }
  ]
}
```

# Amazon Relational Database Service (RDS) Aurora MySQL


The following example shows a component configuration in JSON format for Amazon RDS Aurora MySQL.

```
{
  "alarmMetrics": [
    {
      "alarmMetricName": "CPUUtilization",
      "monitor": true
    },
    {
      "alarmMetricName": "CommitLatency",
      "monitor": true
    }
  ],
  "logs": [
    {
      "logType": "MYSQL",
      "monitor": true,
    },
    {
      "logType": "MYSQL_SLOW_QUERY",
      "monitor": false
    }
  ]
}
```

# Amazon Relational Database Service (RDS) instance


The following example shows a component configuration in JSON format for an Amazon RDS instance.

```
{
  "alarmMetrics" : [
    {
      "alarmMetricName" : "BurstBalance",
      "monitor" : true
    }, {
      "alarmMetricName" : "WriteThroughput",
      "monitor" : false
    }
  ],

  "alarms" : [
    {
      "alarmName" : "my_rds_instance_alarm",
      "severity" : "MEDIUM"
    }
  ]
}
```

# Amazon Route 53 health check


The following example shows a component configuration in JSON format for Amazon Route 53 health check.

```
{
  "alarmMetrics": [
    {
      "alarmMetricName": "ChildHealthCheckHealthyCount",
      "monitor": true
    },
    {
      "alarmMetricName": "ConnectionTime",
      "monitor": true
    },
    {
      "alarmMetricName": "HealthCheckPercentageHealthy",
      "monitor": true
    },
    {
      "alarmMetricName": "HealthCheckStatus",
      "monitor": true
    },
    {
      "alarmMetricName": "SSLHandshakeTime",
      "monitor": true
    },
    {
      "alarmMetricName": "TimeToFirstByte",
      "monitor": true
    }
  ]  
}
```

# Amazon Route 53 hosted zone


The following example shows a component configuration in JSON format for Amazon Route 53 hosted zone.

```
{
  "alarmMetrics": [
    {
      "alarmMetricName": "DNSQueries",
      "monitor": true
    },
    {
      "alarmMetricName": "DNSSECInternalFailure",
      "monitor": true
    },
    {
      "alarmMetricName": "DNSSECKeySigningKeysNeedingAction",
      "monitor": true
    },
    {
      "alarmMetricName": "DNSSECKeySigningKeyMaxNeedingActionAge",
      "monitor": true
    },
    {
      "alarmMetricName": "DNSSECKeySigningKeyAge",
      "monitor": true
    }
  ],
  "logs": [
    {
      "logGroupName":"/hosted-zone/logs",
      "logType": "ROUTE53_DNS_PUBLIC_QUERY_LOGS",
      "monitor": true
    }
  ]
}
```

# Amazon Route 53 Resolver endpoint


The following example shows a component configuration in JSON format for Amazon Route 53 Resolver endpoint.

```
{
  "alarmMetrics": [
    {
      "alarmMetricName": "EndpointHealthyENICount",
      "monitor": true
    },
    {
      "alarmMetricName": "EndpointUnHealthyENICount",
      "monitor": true
    },
    {
      "alarmMetricName": "InboundQueryVolume",
      "monitor": true
    },
    {
      "alarmMetricName": "OutboundQueryVolume",
      "monitor": true
    },
    {
      "alarmMetricName": "OutboundQueryAggregateVolume",
      "monitor": true
    }
  ]  
}
```

# Amazon Route 53 Resolver query logging configuration


The following example shows a component configuration in JSON format for Amazon Route 53 Resolver query logging configuration.

```
{
  "logs": [
    {
      "logGroupName": "/resolver-query-log-config/logs",
      "logType": "ROUTE53_RESOLVER_QUERY_LOGS",
      "monitor": true
    }
  ]  
}
```

# Amazon S3 bucket


The following example shows a component configurations in JSON format for Amazon S3 bucket.

```
{
    "alarmMetrics" : [
        {
            "alarmMetricName" : "ReplicationLatency",
            "monitor" : true
        }, {
            "alarmMetricName" : "5xxErrors",
            "monitor" : true
        }, {
            "alarmMetricName" : "BytesDownloaded"
            "monitor" : true
        }
    ]
}
```

# Amazon Simple Queue Service (SQS)


The following example shows a component configuration in JSON format for Amazon Simple Queue Service.

```
{
  "alarmMetrics" : [
    {
      "alarmMetricName" : "ApproximateAgeOfOldestMessage"
    }, {
      "alarmMetricName" : "NumberOfEmptyReceives"
    }
  ],
  "alarms" : [
    {
      "alarmName" : "my_sqs_alarm",
      "severity" : "MEDIUM"
    }
  ]
}
```

# Amazon SNS topic


The following example shows a component configuration in JSON format for Amazon SNS topic.

```
{
  "alarmMetrics": [
    {
      "alarmMetricName": "NumberOfNotificationsFailed",
      "monitor": true
    },
    {
      "alarmMetricName": "NumberOfNotificationsFilteredOut-InvalidAttributes",
      "monitor": true
    },
    {
      "alarmMetricName": "NumberOfNotificationsFilteredOut-NoMessageAttributes",
      "monitor": true
    },
    {
      "alarmMetricName": "NumberOfNotificationsFailedToRedriveToDlq",
      "monitor": true
    }
  ]
}
```

# Amazon Virtual Private Cloud (Amazon VPC)


The following example shows a component configuration in JSON format for Amazon VPC.

```
{
  "alarmMetrics": [
    {
      "alarmMetricName": "NetworkAddressUsage",
      "monitor": true
    },
    {
      "alarmMetricName": "NetworkAddressUsagePeered",
      "monitor": true
    },
    {
      "alarmMetricName": "VPCFirewallQueryVolume",
      "monitor": true
    }
  ]
}
```

# Amazon VPC Network Address Translation (NAT) gateways


The following example shows a component configuration in JSON format for NAT gateways.

```
{
  "alarmMetrics": [
    {
      "alarmMetricName": "ErrorPortAllocation",
      "monitor": true
    },
    {
      "alarmMetricName": "IdleTimeoutCount",
      "monitor": true
    }
  ]
}
```

# API Gateway REST API stages


The following example shows a component configuration in JSON format for API Gateway REST API stages.

```
{ 
     "alarmMetrics" : [ 
         {
             "alarmMetricName" : "4XXError",   
             "monitor" : true
         }, 
         {
             "alarmMetricName" : "5XXError",   
             "monitor" : true
         } 
     ],
    "logs" : [
        { 
            "logType" : "API_GATEWAY_EXECUTION",   
            "monitor" : true  
        },
        { 
            "logType" : "API_GATEWAY_ACCESS",   
            "monitor" : true  
        }
    ]
}
```

# Application Elastic Load Balancing


The following example shows a component configuration in JSON format for Application Elastic Load Balancing.

```
{
  "alarmMetrics": [
    {
      "alarmMetricName": "ActiveConnectionCount",
    }, {
      "alarmMetricName": "TargetResponseTime"
    }
  ],  
  "subComponents": [
    {
      "subComponentType": "AWS::EC2::Instance",
      "alarmMetrics": [
        {
          "alarmMetricName": "CPUUtilization",
        }, {
          "alarmMetricName": "StatusCheckFailed"
        }
      ],
      "logs": [
        {
          "logGroupName": "my_log_group",
          "logPath": "C:\\LogFolder\\*",
          "logType": "APPLICATION",
        }
      ],
      "windowsEvents": [
        {
          "logGroupName": "my_log_group_2",
          "eventName": "Application",
          "eventLevels": [ "ERROR", "WARNING", "CRITICAL" ]
        }
      ]
    }, {
      "subComponentType": "AWS::EC2::Volume",
      "alarmMetrics": [
        {
          "alarmMetricName": "VolumeQueueLength",
        }, {
          "alarmMetricName": "BurstBalance"
        }
      ]
    }
  ],

  "alarms": [
    {
      "alarmName": "my_alb_alarm",
      "severity": "LOW"
    }
  ]
}
```

# AWS Lambda Function


The following example shows a component configuration in JSON format for AWS Lambda Function.

```
{
  "alarmMetrics": [
    {
      "alarmMetricName": "Errors",
      "monitor": true
    },
    {
      "alarmMetricName": "Throttles",
      "monitor": true
    },
    {
      "alarmMetricName": "IteratorAge",
      "monitor": true
    },
    {
      "alarmMetricName": "Duration",
      "monitor": true
    }
  ],
  "logs": [
    {
      "logType": "DEFAULT",
      "monitor": true
    }
  ]
}
```

# AWS Network Firewall rule group


The following example shows a component configuration in JSON format for AWS Network Firewall rule group.

```
{
  "alarmMetrics": [
    {
      "alarmMetricName": "FirewallRuleGroupQueryVolume",
      "monitor": true
    }
  ]
}
```

# AWS Network Firewall rule group association


The following example shows a component configuration in JSON format for AWS Network Firewall rule group association.

```
{
  "alarmMetrics": [
    {
      "alarmMetricName": "FirewallRuleGroupQueryVolume",
      "monitor": true
    }
  ]
}
```

# AWS Step Functions


The following example shows a component configurations in JSON format for AWS Step Functions.

```
{
  "alarmMetrics": [
    {
      "alarmMetricName": "ExecutionsFailed",
      "monitor": true
    },
    {
      "alarmMetricName": "LambdaFunctionsFailed",
      "monitor": true
    },
    {
      "alarmMetricName": "ProvisionedRefillRate",
      "monitor": true
    }
  ],
  "logs": [
    {
     "logGroupName": "/aws/states/HelloWorld-Logs",
      "logType": "STEP_FUNCTION",
      "monitor": true,
    }
  ]
}
```

# Customer-grouped Amazon EC2 instances


The following example shows a component configuration in JSON format for customer-grouped Amazon EC2 instances.

```
{
    "subComponents": [
      {
        "subComponentType": "AWS::EC2::Instance",
        "alarmMetrics": [
          {
            "alarmMetricName": "CPUUtilization",
          }, 
          {
            "alarmMetricName": "StatusCheckFailed"
          }
        ],
        "logs": [
          {
            "logGroupName": "my_log_group",
            "logPath": "C:\\LogFolder\\*",
            "logType": "APPLICATION",
          }
        ],
        "processes": [
            {
                "processName": "my_process",
                "alarmMetrics": [
                    {
                        "alarmMetricName": "procstat cpu_usage",
                        "monitor": true
                    }, {
                        "alarmMetricName": "procstat memory_rss",
                        "monitor": true
                    }
                ]
            }
        ],
        "windowsEvents": [
          {
            "logGroupName": "my_log_group_2",
            "eventName": "Application",
            "eventLevels": [ "ERROR", "WARNING", "CRITICAL" ]
          }
        ]
      }, {
        "subComponentType": "AWS::EC2::Volume",
        "alarmMetrics": [
          {
            "alarmMetricName": "VolumeQueueLength",
          }, {
            "alarmMetricName": "BurstBalance"
          }
        ]
      }
    ],
    "alarms": [
      {
        "alarmName": "my_alarm",
        "severity": "MEDIUM"
      }
    ]
  }
```

# Elastic Load Balancing


The following example shows a component configuration in JSON format for Elastic Load Balancing.

```
{
    "alarmMetrics": [
      {
        "alarmMetricName": "EstimatedALBActiveConnectionCount"
      }, {
        "alarmMetricName": "HTTPCode_Backend_5XX"
      }
    ],
    "subComponents": [
      {
        "subComponentType": "AWS::EC2::Instance",
        "alarmMetrics": [
          {
            "alarmMetricName": "CPUUtilization"
          }, {
            "alarmMetricName": "StatusCheckFailed"
          }
        ],
        "logs": [
          {
            "logGroupName": "my_log_group",
            "logPath": "C:\\LogFolder\\*",
            "logType": "APPLICATION"
          }
        ],
        "processes": [
          {
            "processName": "my_process",
            "alarmMetrics": [
                {
                  "alarmMetricName": "procstat cpu_usage",
                  "monitor": true
                }, {
                  "alarmMetricName": "procstat memory_rss",
                  "monitor": true
                }
              ]
          }
        ],
        "windowsEvents": [
          {
            "logGroupName": "my_log_group_2",
            "eventName": "Application",
            "eventLevels": [ "ERROR", "WARNING", "CRITICAL" ],
            "monitor": true
          }
        ]
      }, {
        "subComponentType": "AWS::EC2::Volume",
        "alarmMetrics": [
          {
            "alarmMetricName": "VolumeQueueLength"
          }, {
            "alarmMetricName": "BurstBalance"
          }
        ]
      }
    ],
  
    "alarms": [
      {
        "alarmName": "my_elb_alarm",
        "severity": "HIGH"
      }
    ]
  }
```

# Java


The following example shows a component configuration in JSON format for Java.

```
{
  "alarmMetrics": [ {
    "alarmMetricName": "java_lang_threading_threadcount",
    "monitor": true
  },
  {
    "alarmMetricName": "java_lang_memory_heapmemoryusage_used",
    "monitor": true
  },
  {
    "alarmMetricName": "java_lang_memory_heapmemoryusage_committed",
    "monitor": true
  }],
  "logs": [ ],
  "JMXPrometheusExporter": {
      "hostPort": "8686",
      "prometheusPort": "9404"
  }
}
```

**Note**  
Application Insights does not support configuring authentication for Prometheus JMX exporter. For information about how to set up authentication, see the [Prometheus JMX exporter example configuration](https://github.com/prometheus/jmx_exporter#configuration).

# Kubernetes on Amazon EC2


The following example shows a component configuration in JSON format for Kubernetes on Amazon EC2.

```
{
    "alarmMetrics":[
       {
          "alarmMetricName":"cluster_failed_node_count",
          "monitor":true
       },
       {
          "alarmMetricName":"node_cpu_reserved_capacity",
          "monitor":true
       },
       {
          "alarmMetricName":"node_cpu_utilization",
          "monitor":true
       },
       {
          "alarmMetricName":"node_filesystem_utilization",
          "monitor":true
       },
       {
          "alarmMetricName":"node_memory_reserved_capacity",
          "monitor":true
       },
       {
          "alarmMetricName":"node_memory_utilization",
          "monitor":true
       },
       {
          "alarmMetricName":"node_network_total_bytes",
          "monitor":true
       },
       {
          "alarmMetricName":"pod_cpu_reserved_capacity",
          "monitor":true
       },
       {
          "alarmMetricName":"pod_cpu_utilization",
          "monitor":true
       },
       {
          "alarmMetricName":"pod_cpu_utilization_over_pod_limit",
          "monitor":true
       },
       {
          "alarmMetricName":"pod_memory_reserved_capacity",
          "monitor":true
       },
       {
          "alarmMetricName":"pod_memory_utilization",
          "monitor":true
       },
       {
          "alarmMetricName":"pod_memory_utilization_over_pod_limit",
          "monitor":true
       },
       {
          "alarmMetricName":"pod_network_rx_bytes",
          "monitor":true
       },
       {
          "alarmMetricName":"pod_network_tx_bytes",
          "monitor":true
       }
    ],
    "logs":[
       {
          "logGroupName":"/aws/containerinsights/kubernetes/application",
          "logType":"APPLICATION",
          "monitor":true,
          "encoding":"utf-8"
       }
    ],
    "subComponents":[
       {
          "subComponentType":"AWS::EC2::Instance",
          "alarmMetrics":[
             {
                "alarmMetricName":"CPUUtilization",
                "monitor":true
             },
             {
                "alarmMetricName":"StatusCheckFailed",
                "monitor":true
             },
             {
                "alarmMetricName":"disk_used_percent",
                "monitor":true
             },
             {
                "alarmMetricName":"mem_used_percent",
                "monitor":true
             }
          ],
          "logs":[
             {
                "logGroupName":"APPLICATION-KubernetesClusterOnEC2-IAD",
                "logPath":"",
                "logType":"APPLICATION",
                "monitor":true,
                "encoding":"utf-8"
             }
          ],
          "processes" : [
            {
                "processName" : "my_process",
                "alarmMetrics" : [
                    {
                        "alarmMetricName" : "procstat cpu_usage",
                        "monitor" : true
                    }, {
                        "alarmMetricName" : "procstat memory_rss",
                        "monitor" : true
                    }
                ]
            }
        ]
       },
       {
          "subComponentType":"AWS::EC2::Volume",
          "alarmMetrics":[
             {
                "alarmMetricName":"VolumeReadBytes",
                "monitor":true
             },
             {
                "alarmMetricName":"VolumeWriteBytes",
                "monitor":true
             },
             {
                "alarmMetricName":"VolumeReadOps",
                "monitor":true
             },
             {
                "alarmMetricName":"VolumeWriteOps",
                "monitor":true
             },
             {
                "alarmMetricName":"VolumeQueueLength",
                "monitor":true
             },
             {
                "alarmMetricName":"BurstBalance",
                "monitor":true
             }
          ]
       }
    ]
 }
```

# RDS MariaDB and RDS MySQL


The following example shows a component configuration in JSON format for RDS MariaDB and RDS MySQL.

```
{
  "alarmMetrics": [
    {
      "alarmMetricName": "CPUUtilization",
      "monitor": true
    }
  ],
  "logs": [
    {
      "logType": "MYSQL",
      "monitor": true,
    },
    {
      "logType": "MYSQL_SLOW_QUERY",
      "monitor": false
    }
  ]
}
```

# RDS Oracle


The following example shows a component configuration in JSON format for RDS Oracle.

```
{
  "alarmMetrics": [
    {
      "alarmMetricName": "CPUUtilization",
      "monitor": true
    }
  ],
  "logs": [
    {
      "logType": "ORACLE_ALERT",
      "monitor": true,
    },
    {
      "logType": "ORACLE_LISTENER",
      "monitor": false
    }
  ]
}
```

# RDS PostgreSQL


The following example shows a component configurations in JSON format for RDS PostgreSQL.

```
{
  "alarmMetrics": [
    {
      "alarmMetricName": "CPUUtilization",
      "monitor": true
    }
  ],
  "logs": [
    {
      "logType": "POSTGRESQL",
      "monitor": true
    }
  ]
}
```

# SAP ASE on Amazon EC2


The following example shows a component configuration in JSON format for SAP ASE on Amazon EC2.

```
{
  "subComponents": [
    {
      "subComponentType": "AWS::EC2::Instance",
      "alarmMetrics": [
        {
          "alarmMetricName": "asedb_database_availability",
          "monitor": true
        },
        {
          "alarmMetricName": "asedb_trunc_log_on_chkpt_enabled",
          "monitor": true
        },
        {
          "alarmMetricName": "asedb_last_db_backup_age_in_days",
          "monitor": true
        },
        {
          "alarmMetricName": "asedb_last_transaction_log_backup_age_in_hours",
          "monitor": true
        },
        {
          "alarmMetricName": "asedb_suspected_database",
          "monitor": true
        },
        {
          "alarmMetricName": "asedb_db_space_usage_percent",
          "monitor": true
        },
        {
          "alarmMetricName": "asedb_db_log_space_usage_percent",
          "monitor": true
        },
        {
          "alarmMetricName": "asedb_locked_login",
          "monitor": true
        },
        {
          "alarmMetricName": "asedb_data_cache_hit_ratio",
          "monitor": true
        }
      ],
      "logs": [
        {
          "logGroupName": "SAP_ASE_SERVER_LOGS-my-resource-group",
          "logPath": "/sybase/SY2/ASE-*/install/SY2.log",
          "logType": "SAP_ASE_SERVER_LOGS",
          "monitor": true,
          "encoding": "utf-8"
        },
        {
          "logGroupName": "SAP_ASE_BACKUP_SERVER_LOGS-my-resource-group",
          "logPath": "/sybase/SY2/ASE-*/install/SY2_BS.log",
          "logType": "SAP_ASE_BACKUP_SERVER_LOGS",
          "monitor": true,
          "encoding": "utf-8"
        }
  ],
  "sapAsePrometheusExporter": {
    "sapAseSid": "ASE",
    "sapAsePort": "4901",
    "sapAseSecretName": "ASE_DB_CREDS",
    "prometheusPort": "9399",
    "agreeToEnableASEMonitoring": true
}
```

# SAP ASE High Availability on Amazon EC2


The following example shows a component configuration in JSON format for SAP ASE High Availability on Amazon EC2.

```
{
  "subComponents": [
    {
      "subComponentType": "AWS::EC2::Instance",
      "alarmMetrics": [
        {
          "alarmMetricName": "asedb_database_availability",
          "monitor": true
        },
        {
          "alarmMetricName": "asedb_trunc_log_on_chkpt_enabled",
          "monitor": true
        },
        {
          "alarmMetricName": "asedb_last_db_backup_age_in_days",
          "monitor": true
        },
        {
          "alarmMetricName": "asedb_last_transaction_log_backup_age_in_hours",
          "monitor": true
        },
        {
          "alarmMetricName": "asedb_suspected_database",
          "monitor": true
        },
        {
          "alarmMetricName": "asedb_db_space_usage_percent",
          "monitor": true
        },
        {
          "alarmMetricName": "asedb_ha_replication_state",
          "monitor": true
        },
        {
          "alarmMetricName": "asedb_ha_replication_mode",
          "monitor": true
        },
        {
          "alarmMetricName": "asedb_ha_replication_latency_in_minutes",
          "monitor": true
        }
      ],
      "logs": [
        {
          "logGroupName": "SAP_ASE_SERVER_LOGS-my-resource-group",
          "logPath": "/sybase/SY2/ASE-*/install/SY2.log",
          "logType": "SAP_ASE_SERVER_LOGS",
          "monitor": true,
          "encoding": "utf-8"
        },
        {
          "logGroupName": "SAP_ASE_BACKUP_SERVER_LOGS-my-resource-group",
          "logPath": "/sybase/SY2/ASE-*/install/SY2_BS.log",
          "logType": "SAP_ASE_BACKUP_SERVER_LOGS",
          "monitor": true,
          "encoding": "utf-8"
        },
        {
          "logGroupName": "SAP_ASE_REP_SERVER_LOGS-my-resource-group",
          "logPath": "/sybase/SY2/DM/repservername/repservername.log",
          "logType": "SAP_ASE_REP_SERVER_LOGS",
          "monitor": true,
          "encoding": "utf-8"
        },
        {
          "logGroupName": "SAP_ASE_RMA_AGENT_LOGS-my-resource-group",
          "logPath": "/sybase/SY2/DM/RMA-*/instances/AgentContainer/logs/",
          "logType": "SAP_ASE_RMA_AGENT_LOGS",
          "monitor": true,
          "encoding": "utf-8"
        },
        {
          "logGroupName": "SAP_ASE_FAULT_MANAGER_LOGS-my-resource-group",
          "logPath": "/opt/sap/FaultManager/dev_sybdbfm",
          "logType": "SAP_ASE_FAULT_MANAGER_LOGS",
          "monitor": true,
          "encoding": "utf-8"
        }
  ],
  "sapAsePrometheusExporter": {
    "sapAseSid": "ASE",
    "sapAsePort": "4901",
    "sapAseSecretName": "ASE_DB_CREDS",
    "prometheusPort": "9399",
    "agreeToEnableASEMonitoring": true
}
```

# SAP HANA on Amazon EC2


The following example shows a component configuration in JSON format for SAP HANA on Amazon EC2.

```
{
  "subComponents": [
    {
      "subComponentType": "AWS::EC2::Instance",
      "alarmMetrics": [
        {
          "alarmMetricName": "hanadb_server_startup_time_variations_seconds",
          "monitor": true
        },
        {
          "alarmMetricName": "hanadb_level_5_alerts_count",
          "monitor": true
        },
        {
          "alarmMetricName": "hanadb_level_4_alerts_count",
          "monitor": true
        },
        {
          "alarmMetricName": "hanadb_out_of_memory_events_count",
          "monitor": true
        },
        {
          "alarmMetricName": "hanadb_max_trigger_read_ratio_percent",
          "monitor": true
        },
        {
          "alarmMetricName": "hanadb_table_allocation_limit_used_percent",
          "monitor": true
        },
        {
          "alarmMetricName": "hanadb_cpu_usage_percent",
          "monitor": true
        },
        {
          "alarmMetricName": "hanadb_plan_cache_hit_ratio_percent",
          "monitor": true
        },
        {
          "alarmMetricName": "hanadb_last_data_backup_age_days",
          "monitor": true
        }
      ],
      "logs": [
        {
          "logGroupName": "SAP_HANA_TRACE-my-resourge-group",
          "logPath": "/usr/sap/HDB/HDB00/*/trace/*.trc",
          "logType": "SAP_HANA_TRACE",
          "monitor": true,
          "encoding": "utf-8"
        },
        {
          "logGroupName": "SAP_HANA_LOGS-my-resource-group",
          "logPath": "/usr/sap/HDB/HDB00/*/trace/*.log",
          "logType": "SAP_HANA_LOGS",
          "monitor": true,
          "encoding": "utf-8"
        }
      ]
    }
  ],
  "hanaPrometheusExporter": {
    "hanaSid": "HDB",
    "hanaPort": "30013",
    "hanaSecretName": "HANA_DB_CREDS",
    "prometheusPort": "9668"
  }
}
```

# SAP HANA High Availability on Amazon EC2


The following example shows a component configuration in JSON format for SAP HANA High Availability on Amazon EC2.

```
{
  "subComponents": [
    {
      "subComponentType": "AWS::EC2::Instance",
      "alarmMetrics": [
        {
          "alarmMetricName": "hanadb_server_startup_time_variations_seconds",
          "monitor": true
        },
        {
          "alarmMetricName": "hanadb_level_5_alerts_count",
          "monitor": true
        },
        {
          "alarmMetricName": "hanadb_level_4_alerts_count",
          "monitor": true
        },
        {
          "alarmMetricName": "hanadb_out_of_memory_events_count",
          "monitor": true
        },
        {
          "alarmMetricName": "ha_cluster_pacemaker_stonith_enabled",
          "monitor": true
        }
      ],
      "logs": [
        {
          "logGroupName": "SAP_HANA_TRACE-my-resourge-group",
          "logPath": "/usr/sap/HDB/HDB00/*/trace/*.trc",
          "logType": "SAP_HANA_TRACE",
          "monitor": true,
          "encoding": "utf-8"
        },
        {
          "logGroupName": "SAP_HANA_HIGH_AVAILABILITY-my-resource-group",
          "logPath": "/var/log/pacemaker/pacemaker.log",
          "logType": "SAP_HANA_HIGH_AVAILABILITY",
          "monitor": true,
          "encoding": "utf-8"
        }
      ]
    }
  ],
  "hanaPrometheusExporter": {
    "hanaSid": "HDB",
    "hanaPort": "30013",
    "hanaSecretName": "HANA_DB_CREDS",
    "prometheusPort": "9668"
  },
  "haClusterPrometheusExporter": {
    "prometheusPort": "9664"
  }
}
```

# SAP NetWeaver on Amazon EC2


The following example shows a component configuration in JSON format for SAP NetWeaver on Amazon EC2.

```
{
  "subComponents": [
    {
      "subComponentType": "AWS::EC2::Instance",
      "alarmMetrics": [
        {
          "alarmMetricName": "CPUUtilization",
          "monitor": true
        },
        {
          "alarmMetricName": "StatusCheckFailed",
          "monitor": true
        },
        {
          "alarmMetricName": "disk_used_percent",
          "monitor": true
        },
        {
          "alarmMetricName": "mem_used_percent",
          "monitor": true
        },
        {
          "alarmMetricName": "sap_alerts_ResponseTime",
          "monitor": true
        },
        {
          "alarmMetricName": "sap_alerts_ResponseTimeDialog",
          "monitor": true
        },
        {
          "alarmMetricName": "sap_alerts_ResponseTimeDialogRFC",
          "monitor": true
        },
        {
          "alarmMetricName": "sap_alerts_DBRequestTime",
          "monitor": true
        },
        {
          "alarmMetricName": "sap_alerts_LongRunners",
          "monitor": true
        },
        {
          "alarmMetricName": "sap_alerts_AbortedJobs",
          "monitor": true
        },
        {
          "alarmMetricName": "sap_alerts_BasisSystem",
          "monitor": true
        },
        {
          "alarmMetricName": "sap_alerts_Database",
          "monitor": true
        },
        {
          "alarmMetricName": "sap_alerts_Security",
          "monitor": true
        },
        {
          "alarmMetricName": "sap_alerts_System",
          "monitor": true
        },
        {
          "alarmMetricName": "sap_alerts_QueueTime",
          "monitor": true
        },
        {
          "alarmMetricName": "sap_alerts_Availability",
          "monitor": true
        },
        {
          "alarmMetricName": "sap_start_service_processes",
          "monitor": true
        },
        {
          "alarmMetricName": "sap_dispatcher_queue_now",
          "monitor": true
        },
        {
          "alarmMetricName": "sap_dispatcher_queue_max",
          "monitor": true
        },
        {
          "alarmMetricName": "sap_enqueue_server_locks_max",
          "monitor": true
        },
        {
          "alarmMetricName": "sap_enqueue_server_locks_now",
          "monitor": true
        },
        {
          "alarmMetricName": "sap_enqueue_server_locks_state",
          "monitor": true
        },
        {
          "alarmMetricName": "sap_enqueue_server_replication_state",
          "monitor": true
        }
      ],
      "logs": [
        {
          "logGroupName": "SAP_NETWEAVER_DEV_TRACE_LOGS-NetWeaver-ML4",
          "logPath": "/usr/sap/ML4/*/work/dev_w*",
          "logType": "SAP_NETWEAVER_DEV_TRACE_LOGS",
          "monitor": true,
          "encoding": "utf-8"
        }
      ]
    }
  ],
  "netWeaverPrometheusExporter": {
    "sapSid": "ML4",
    "instanceNumbers": [
      "00",
      "11"
    ],
    "prometheusPort": "9680"
  }
}
```

# SAP NetWeaver High Availability on Amazon EC2


The following example shows a component configuration in JSON format for SAP NetWeaver High Availability on Amazon EC2.

```
{
  "subComponents": [
    {
      "subComponentType": "AWS::EC2::Instance",
      "alarmMetrics": [
        {
          "alarmMetricName": "ha_cluster_corosync_ring_errors",
          "monitor": true
        },
        {
          "alarmMetricName": "ha_cluster_pacemaker_fail_count",
          "monitor": true
        },
        {
          "alarmMetricName": "sap_HA_check_failover_config_state",
          "monitor": true
        },
        {
          "alarmMetricName": "sap_HA_get_failover_config_HAActive",
          "monitor": true
        },
        {
          "alarmMetricName": "sap_alerts_AbortedJobs",
          "monitor": true
        },
        {
          "alarmMetricName": "sap_alerts_Availability",
          "monitor": true
        },
        {
          "alarmMetricName": "sap_alerts_BasisSystem",
          "monitor": true
        },
        {
          "alarmMetricName": "sap_alerts_DBRequestTime",
          "monitor": true
        },
        {
          "alarmMetricName": "sap_alerts_Database",
          "monitor": true
        },
        {
          "alarmMetricName": "sap_alerts_FrontendResponseTime",
          "monitor": true
        },
        {
          "alarmMetricName": "sap_alerts_LongRunners",
          "monitor": true
        },
        {
          "alarmMetricName": "sap_alerts_QueueTime",
          "monitor": true
        },
        {
          "alarmMetricName": "sap_alerts_ResponseTime",
          "monitor": true
        },
        {
          "alarmMetricName": "sap_alerts_ResponseTimeDialog",
          "monitor": true
        },
        {
          "alarmMetricName": "sap_alerts_ResponseTimeDialogRFC",
          "monitor": true
        },
        {
          "alarmMetricName": "sap_alerts_Security",
          "monitor": true
        },
        {
          "alarmMetricName": "sap_alerts_Shortdumps",
          "monitor": true
        },
        {
          "alarmMetricName": "sap_alerts_SqlError",
          "monitor": true
        },
        {
          "alarmMetricName": "sap_alerts_System",
          "monitor": true
        },
        {
          "alarmMetricName": "sap_enqueue_server_replication_state",
          "monitor": true
        },
        {
          "alarmMetricName": "sap_start_service_processes",
          "monitor": true
        }
      ],
      "logs": [
        {
          "logGroupName": "SAP_NETWEAVER_DEV_TRACE_LOGS-NetWeaver-PR1",
          "logPath": "/usr/sap/<SID>/D*/work/dev_w*",
          "logType": "SAP_NETWEAVER_DEV_TRACE_LOGS",
          "monitor": true,
          "encoding": "utf-8"
        }
      ]
    }
  ],
  "haClusterPrometheusExporter": {
    "prometheusPort": "9664"
  },
  "netWeaverPrometheusExporter": {
    "sapSid": "PR1",
    "instanceNumbers": [
      "11",
      "12"
    ],
    "prometheusPort": "9680"
  }
}
```

# SQL Always On Availability Group


The following example shows a component configuration in JSON format for SQL Always On Availability Group.

```
{
  "subComponents" : [ {
    "subComponentType" : "AWS::EC2::Instance",
    "alarmMetrics" : [ {
      "alarmMetricName" : "CPUUtilization",
      "monitor" : true
    }, {
      "alarmMetricName" : "StatusCheckFailed",
      "monitor" : true
    }, {
      "alarmMetricName" : "Processor % Processor Time",
      "monitor" : true
    }, {
      "alarmMetricName" : "Memory % Committed Bytes In Use",
      "monitor" : true
    }, {
      "alarmMetricName" : "Memory Available Mbytes",
      "monitor" : true
    }, {
      "alarmMetricName" : "Paging File % Usage",
      "monitor" : true
    }, {
      "alarmMetricName" : "System Processor Queue Length",
      "monitor" : true
    }, {
      "alarmMetricName" : "Network Interface Bytes Total/sec",
      "monitor" : true
    }, {
      "alarmMetricName" : "PhysicalDisk % Disk Time",
      "monitor" : true
    }, {
      "alarmMetricName" : "SQLServer:Buffer Manager Buffer cache hit ratio",
      "monitor" : true
    }, {
      "alarmMetricName" : "SQLServer:Buffer Manager Page life expectancy",
      "monitor" : true
    }, {
      "alarmMetricName" : "SQLServer:General Statistics Processes blocked",
      "monitor" : true
    }, {
      "alarmMetricName" : "SQLServer:General Statistics User Connections",
      "monitor" : true
    }, {
      "alarmMetricName" : "SQLServer:Locks Number of Deadlocks/sec",
      "monitor" : true
    }, {
      "alarmMetricName" : "SQLServer:SQL Statistics Batch Requests/sec",
      "monitor" : true
    }, {
      "alarmMetricName" : "SQLServer:Database Replica File Bytes Received/sec",
      "monitor" : true
    }, {
      "alarmMetricName" : "SQLServer:Database Replica Log Bytes Received/sec",
      "monitor" : true
    }, {
      "alarmMetricName" : "SQLServer:Database Replica Log remaining for undo",
      "monitor" : true
    }, {
      "alarmMetricName" : "SQLServer:Database Replica Log Send Queue",
      "monitor" : true
    }, {
      "alarmMetricName" : "SQLServer:Database Replica Mirrored Write Transaction/sec",
      "monitor" : true
    }, {
      "alarmMetricName" : "SQLServer:Database Replica Recovery Queue",
      "monitor" : true
    }, {
      "alarmMetricName" : "SQLServer:Database Replica Redo Bytes Remaining",
      "monitor" : true
    }, {
      "alarmMetricName" : "SQLServer:Database Replica Redone Bytes/sec",
      "monitor" : true
    }, {
      "alarmMetricName" : "SQLServer:Database Replica Total Log requiring undo",
      "monitor" : true
    }, {
      "alarmMetricName" : "SQLServer:Database Replica Transaction Delay",
      "monitor" : true
    } ],
    "windowsEvents" : [ {
      "logGroupName" : "WINDOWS_EVENTS-Application-<RESOURCE_GROUP_NAME>",
      "eventName" : "Application",
      "eventLevels" : [ "WARNING", "ERROR", "CRITICAL", "INFORMATION" ],
      "monitor" : true
    }, {
      "logGroupName" : "WINDOWS_EVENTS-System-<RESOURCE_GROUP_NAME>",
      "eventName" : "System",
      "eventLevels" : [ "WARNING", "ERROR", "CRITICAL" ],
      "monitor" : true
    }, {
      "logGroupName" : "WINDOWS_EVENTS-Security-<RESOURCE_GROUP_NAME>",
      "eventName" : "Security",
      "eventLevels" : [ "WARNING", "ERROR", "CRITICAL" ],
      "monitor" : true
    } ],
    "logs" : [ {
      "logGroupName" : "SQL_SERVER_ALWAYSON_AVAILABILITY_GROUP-<RESOURCE_GROUP_NAME>",
      "logPath" : "C:\\Program Files\\Microsoft SQL Server\\MSSQL**.MSSQLSERVER\\MSSQL\\Log\\ERRORLOG",
      "logType" : "SQL_SERVER",
      "monitor" : true,
      "encoding" : "utf-8"
    } ]
  }, {
    "subComponentType" : "AWS::EC2::Volume",
    "alarmMetrics" : [ {
      "alarmMetricName" : "VolumeReadBytes",
      "monitor" : true
    }, {
    "alarmMetricName" : "VolumeWriteBytes",
      "monitor" : true
    }, {
    "alarmMetricName" : "VolumeReadOps",
      "monitor" : true
    }, {
    "alarmMetricName" : "VolumeWriteOps",
      "monitor" : true
    }, {
    "alarmMetricName" : "VolumeQueueLength",
      "monitor" : true
    }, {
    "alarmMetricName" : "VolumeThroughputPercentage",
      "monitor" : true
    }, {
    "alarmMetricName" : "BurstBalance",
      "monitor" : true
    } ]
  } ]
}
```

# SQL failover cluster instance


The following example shows a component configuration in JSON format for SQL failover cluster instance.

```
{
  "subComponents" : [ {
    "subComponentType" : "AWS::EC2::Instance",
    "alarmMetrics" : [ {
      "alarmMetricName" : "CPUUtilization",
      "monitor" : true
    }, {
      "alarmMetricName" : "StatusCheckFailed",
      "monitor" : true
    }, {
      "alarmMetricName" : "Processor % Processor Time",
      "monitor" : true
    }, {
      "alarmMetricName" : "Memory % Committed Bytes In Use",
      "monitor" : true
    }, {
      "alarmMetricName" : "Memory Available Mbytes",
      "monitor" : true
    }, {
      "alarmMetricName" : "Paging File % Usage",
      "monitor" : true
    }, {
      "alarmMetricName" : "System Processor Queue Length",
      "monitor" : true
    }, {
      "alarmMetricName" : "Network Interface Bytes Total/sec",
      "monitor" : true
    }, {
      "alarmMetricName" : "PhysicalDisk % Disk Time",
      "monitor" : true
    }, {
      "alarmMetricName" : "Bytes Received/sec",
      "monitor" : true
    }, {
      "alarmMetricName" : "Normal Messages Queue Length/sec",
      "monitor" : true
    }, {
      "alarmMetricName" : "Urgent Message Queue Length/se",
      "monitor" : true
    }, {
      "alarmMetricName" : "Reconnect Count",
      "monitor" : true
    }, {
      "alarmMetricName" : "Unacknowledged Message Queue Length/sec",
      "monitor" : true
    }, {
      "alarmMetricName" : "Messages Outstanding",
      "monitor" : true
    }, {
      "alarmMetricName" : "Messages Sent/sec",
      "monitor" : true
    }, {
      "alarmMetricName" : "Database Update Messages/sec",
      "monitor" : true
    }, {
      "alarmMetricName" : "Update Messages/sec",
      "monitor" : true
    }, {
      "alarmMetricName" : "Flushes/sec",
      "monitor" : true
    }, {
      "alarmMetricName" : "Crypto Checkpoints Saved/sec",
      "monitor" : true
    }, {
      "alarmMetricName" : "Crypto Checkpoints Restored/sec",
      "monitor" : true
    }, {
      "alarmMetricName" : "Registry Checkpoints Restored/sec",
      "monitor" : true
    }, {
      "alarmMetricName" : "Registry Checkpoints Saved/sec",
      "monitor" : true
    }, {
      "alarmMetricName" : "Cluster API Calls/sec",
      "monitor" : true
    }, {
      "alarmMetricName" : "Resource API Calls/sec",
      "monitor" : true
    }, {
      "alarmMetricName" : "Cluster Handles/sec",
      "monitor" : true
    }, {
      "alarmMetricName" : "Resource Handles/sec",
      "monitor" : true
    } ],
    "windowsEvents" : [ {
      "logGroupName" : "WINDOWS_EVENTS-Application-<RESOURCE_GROUP_NAME>",
      "eventName" : "Application",
      "eventLevels" : [ "WARNING", "ERROR", "CRITICAL"],
      "monitor" : true
    }, {
      "logGroupName" : "WINDOWS_EVENTS-System-<RESOURCE_GROUP_NAME>",
      "eventName" : "System",
      "eventLevels" : [ "WARNING", "ERROR", "CRITICAL", "INFORMATION" ],
      "monitor" : true
    }, {
      "logGroupName" : "WINDOWS_EVENTS-Security-<RESOURCE_GROUP_NAME>",
      "eventName" : "Security",
      "eventLevels" : [ "WARNING", "ERROR", "CRITICAL" ],
      "monitor" : true
    } ],
    "logs" : [ {
      "logGroupName" : "SQL_SERVER_FAILOVER_CLUSTER_INSTANCE-<RESOURCE_GROUP_NAME>",
      "logPath" : "\\\\amznfsxjmzbykwn.mydomain.aws\\SQLDB\\MSSQL**.MSSQLSERVER\\MSSQL\\Log\\ERRORLOG",
      "logType" : "SQL_SERVER",
      "monitor" : true,
      "encoding" : "utf-8"
    } ]
  }, {
    "subComponentType" : "AWS::EC2::Volume",
    "alarmMetrics" : [ {
      "alarmMetricName" : "VolumeReadBytes",
      "monitor" : true
    }, {
    "alarmMetricName" : "VolumeWriteBytes",
      "monitor" : true
    }, {
    "alarmMetricName" : "VolumeReadOps",
      "monitor" : true
    }, {
    "alarmMetricName" : "VolumeWriteOps",
      "monitor" : true
    }, {
    "alarmMetricName" : "VolumeQueueLength",
      "monitor" : true
    }, {
    "alarmMetricName" : "VolumeThroughputPercentage",
      "monitor" : true
    }, {
    "alarmMetricName" : "BurstBalance",
      "monitor" : true
    } ]
  } ]
}
```

# Create and configure CloudWatch Application Insights monitoring using CloudFormation templates
Use CloudFormation templates

You can add Application Insights monitoring, including key metrics and telemetry, to your application, database, and web server, directly from AWS CloudFormation templates.

This section provides sample CloudFormation templates in both JSON and YAML formats to help you create and configure Application Insights monitoring.

To view the Application Insights resource and property reference in the *CloudFormation User Guide*, see [ApplicationInsights resource type reference](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/AWS_ApplicationInsights.html). 

**Topics**
+ [

## Create an Application Insights application for the entire CloudFormation stack
](#appinsights-cloudformation-apply-to-stack)
+ [

## Create an Application Insights application with detailed settings
](#appinsights-cloudformation-apply-detailed)
+ [

## Create an Application Insights application with `CUSTOM` mode component configuration
](#appinsights-cloudformation-custom)
+ [

## Create an Application Insights application with `DEFAULT` mode component configuration
](#appinsights-cloudformation-default)
+ [

## Create an Application Insights application with `DEFAULT_WITH_OVERWRITE` mode component configuration
](#appinsights-cloudformation-default-with-overwrite)

## Create an Application Insights application for the entire CloudFormation stack


To apply the following template, you must create AWS resources and one or more resource groups from which to create Application Insights applications to monitor those resources. For more information, see [Getting started with AWS Resource Groups](https://docs.aws.amazon.com/ARG/latest/userguide/gettingstarted.html).

The first two parts of the following template specify a resource and a resource group. The last part of the template creates an Application Insights application for the resource group, but does not configure the application or apply monitoring. For more information, see the [CreateApplication](https://docs.aws.amazon.com/cloudwatch/latest/APIReference/API_CreateApplication.html) command details in the *Amazon CloudWatch Application Insights API Reference*.

**Template in JSON format**

```
{
    "AWSTemplateFormatVersion": "2010-09-09",
    "Description": "Test Resource Group stack",
    "Resources": {
        "EC2Instance": {
            "Type": "AWS::EC2::Instance",
            "Properties": {
                "ImageId" : "ami-abcd1234efgh5678i",
                "SecurityGroupIds" : ["sg-abcd1234"]
            }
        },
        ...
        "ResourceGroup": {
            "Type": "AWS::ResourceGroups::Group",
            "Properties": {
                "Name": "my_resource_group"
            }
        },
        "AppInsightsApp": {
            "Type": "AWS::ApplicationInsights::Application",
            "Properties": {
                "ResourceGroupName": "my_resource_group"
            },
            "DependsOn" : "ResourceGroup"
        }
    }
}
```

**Template in YAML format**

```
---
AWSTemplateFormatVersion: '2010-09-09'
Description: Test Resource Group stack
Resources:
  EC2Instance:
    Type: AWS::EC2::Instance
    Properties:
      ImageId: ami-abcd1234efgh5678i
      SecurityGroupIds:
      - sg-abcd1234
  ...
  ResourceGroup:
    Type: AWS::ResourceGroups::Group
    Properties:
      Name: my_resource_group
  AppInsightsApp:
    Type: AWS::ApplicationInsights::Application
    Properties:
      ResourceGroupName: my_resource_group
    DependsOn: ResourceGroup
```

The following template section applies the default monitoring configuration to the Application Insights application. For more information, see the [CreateApplication](https://docs.aws.amazon.com/cloudwatch/latest/APIReference/API_CreateApplication.html) command details in the *Amazon CloudWatch Application Insights API Reference*.

When `AutoConfigurationEnabled` is set to `true`, all components of the application are configured with the recommended monitoring settings for the `DEFAULT` application tier. For more information about these settings and tiers, see [DescribeComponentConfigurationRecommendation](https://docs.aws.amazon.com/cloudwatch/latest/APIReference/API_DescribeComponentConfigurationRecommendation.html) and [UpdateComponentConfiguration](https://docs.aws.amazon.com/cloudwatch/latest/APIReference/API_UpdateComponentConfiguration.html) in the *Amazon CloudWatch Application Insights API Reference*. 

**Template in JSON format**

```
{
    "AWSTemplateFormatVersion": "2010-09-09",
    "Description": "Test Application Insights Application stack",
    "Resources": {
        "AppInsightsApp": {
            "Type": "AWS::ApplicationInsights::Application",
            "Properties": {
                "ResourceGroupName": "my_resource_group",
                "AutoConfigurationEnabled": true
            }
        }
    }
}
```

**Template in YAML format**

```
---
AWSTemplateFormatVersion: '2010-09-09'
Description: Test Application Insights Application stack
Resources:
  AppInsightsApp:
    Type: AWS::ApplicationInsights::Application
    Properties:
      ResourceGroupName: my_resource_group
      AutoConfigurationEnabled: true
```

## Create an Application Insights application with detailed settings


The following template performs these actions:
+ Creates an Application Insights application with CloudWatch Events notification and OpsCenter enabled. For more information, see the [CreateApplication](https://docs.aws.amazon.com/cloudwatch/latest/APIReference/API_CreateApplication.html) command details in the *Amazon CloudWatch Application Insights API Reference*. 
+ Tags the application with two tags, one of which has no tag values. For more information, see [TagResource](https://docs.aws.amazon.com/cloudwatch/latest/APIReference/API_TagResource.html) in the *Amazon CloudWatch Application Insights API Reference*.
+ Creates two custom instance group components. For more information, see [CreateComponent](https://docs.aws.amazon.com/cloudwatch/latest/APIReference/API_CreateComponent.html) in the *Amazon CloudWatch Application Insights API Reference*.
+ Creates two log pattern sets. For more information, see [CreateLogPattern](https://docs.aws.amazon.com/cloudwatch/latest/APIReference/API_CreateLogPattern.html) in the *Amazon CloudWatch Application Insights API Reference*.
+ Sets `AutoConfigurationEnabled` to `true`, which configures all components of the application with the recommended monitoring settings for the `DEFAULT` tier. For more information, see [DescribeComponentConfigurationRecommendation](https://docs.aws.amazon.com/cloudwatch/latest/APIReference/API_DescribeComponentConfigurationRecommendation.html) in the *Amazon CloudWatch Application Insights API Reference*.

**Template in JSON format **

```
{
    "Type": "AWS::ApplicationInsights::Application",
    "Properties": {
        "ResourceGroupName": "my_resource_group",
        "CWEMonitorEnabled": true,
        "OpsCenterEnabled": true,
        "OpsItemSNSTopicArn": "arn:aws:sns:us-east-1:123456789012:my_topic",
        "AutoConfigurationEnabled": true,
        "Tags": [
            {
                "Key": "key1",
                "Value": "value1"
            },
            {
                "Key": "key2",
                "Value": ""
            }
        ],
        "CustomComponents": [
            {
                "ComponentName": "test_component_1",
                "ResourceList": [
                    "arn:aws:ec2:us-east-1:123456789012:instance/i-abcd1234efgh5678i"
                ]
            },
            {
                "ComponentName": "test_component_2",
                "ResourceList": [
                    "arn:aws:ec2:us-east-1:123456789012:instance/i-abcd1234efgh5678i",
                    "arn:aws:ec2:us-east-1:123456789012:instance/i-abcd1234efgh5678i"
                ]
            }
        ],
        "LogPatternSets": [
            {
                "PatternSetName": "pattern_set_1",
                "LogPatterns": [
                    {
                        "PatternName": "deadlock_pattern",
                        "Pattern": ".*\\sDeadlocked\\sSchedulers(([^\\w].*)|($))",
                        "Rank": 1
                    }
                ]    
            },
            {
                "PatternSetName": "pattern_set_2",
                "LogPatterns": [
                    {
                        "PatternName": "error_pattern",
                        "Pattern": ".*[\\s\\[]ERROR[\\s\\]].*",
                        "Rank": 1
                    },
                    {
                        "PatternName": "warning_pattern",
                        "Pattern": ".*[\\s\\[]WARN(ING)?[\\s\\]].*",
                        "Rank": 10
                    }
                ]
            }
        ]
    }
}
```

**Template in YAML format**

```
---
Type: AWS::ApplicationInsights::Application
Properties:
  ResourceGroupName: my_resource_group
  CWEMonitorEnabled: true
  OpsCenterEnabled: true
  OpsItemSNSTopicArn: arn:aws:sns:us-east-1:123456789012:my_topic
  AutoConfigurationEnabled: true
  Tags:
  - Key: key1
    Value: value1
  - Key: key2
    Value: ''
  CustomComponents:
  - ComponentName: test_component_1
    ResourceList:
    - arn:aws:ec2:us-east-1:123456789012:instance/i-abcd1234efgh5678i
  - ComponentName: test_component_2
    ResourceList:
    - arn:aws:ec2:us-east-1:123456789012:instance/i-abcd1234efgh5678i
    - arn:aws:ec2:us-east-1:123456789012:instance/i-abcd1234efgh5678i
  LogPatternSets:
  - PatternSetName: pattern_set_1
    LogPatterns:
    - PatternName: deadlock_pattern
      Pattern: ".*\\sDeadlocked\\sSchedulers(([^\\w].*)|($))"
      Rank: 1
  - PatternSetName: pattern_set_2
    LogPatterns:
    - PatternName: error_pattern
      Pattern: ".*[\\s\\[]ERROR[\\s\\]].*"
      Rank: 1
    - PatternName: warning_pattern
      Pattern: ".*[\\s\\[]WARN(ING)?[\\s\\]].*"
      Rank: 10
```

## Create an Application Insights application with `CUSTOM` mode component configuration


The following template performs these actions:
+ Creates an Application Insights application. For more information, see [CreateApplication](https://docs.aws.amazon.com/cloudwatch/latest/APIReference/API_CreateApplication.html) in the *Amazon CloudWatch Application Insights API Reference*.
+ Component `my_component` sets `ComponentConfigurationMode` to `CUSTOM`, which causes this component to be configured with the configuration specified in `CustomComponentConfiguration`. For more information, see [UpdateComponentConfiguration](https://docs.aws.amazon.com/cloudwatch/latest/APIReference/API_UpdateComponentConfiguration.html) in the *Amazon CloudWatch Application Insights API Reference*.

**Template in JSON format**

```
{
    "Type": "AWS::ApplicationInsights::Application",
    "Properties": {
        "ResourceGroupName": "my_resource_group,
        "ComponentMonitoringSettings": [
            {
                "ComponentARN": "my_component",
                "Tier": "SQL_SERVER",
                "ComponentConfigurationMode": "CUSTOM",
                "CustomComponentConfiguration": {
                    "ConfigurationDetails": {
                        "AlarmMetrics": [
                            {
                                "AlarmMetricName": "StatusCheckFailed"
                            },
                            ...
                        ],
                        "Logs": [
                            {       
                                "LogGroupName": "my_log_group_1",
                                "LogPath": "C:\\LogFolder_1\\*",
                                "LogType": "DOT_NET_CORE",
                                "Encoding": "utf-8",
                                "PatternSet": "my_pattern_set_1"
                            },      
                            ...     
                        ],      
                        "WindowsEvents": [
                            {       
                                "LogGroupName": "my_windows_event_log_group_1",
                                "EventName": "Application",
                                "EventLevels": [
                                    "ERROR",
                                    "WARNING",
                                    ...     
                                ],       
                                "Encoding": "utf-8",
                                "PatternSet": "my_pattern_set_2"
                            },      
                            ...     
                        ],
                        "Alarms": [
                            {
                                "AlarmName": "my_alarm_name",
                                "Severity": "HIGH"
                            },
                            ...
                        ]
                    },
                    "SubComponentTypeConfigurations": [
                        {
                            "SubComponentType": "EC2_INSTANCE",
                            "SubComponentConfigurationDetails": {
                                "AlarmMetrics": [
                                    {
                                        "AlarmMetricName": "DiskReadOps"
                                    },
                                    ...
                                ],
                                "Logs": [
                                    {
                                        "LogGroupName": "my_log_group_2",
                                        "LogPath": "C:\\LogFolder_2\\*",
                                        "LogType": "IIS",
                                        "Encoding": "utf-8",
                                        "PatternSet": "my_pattern_set_3"
                                    },
                                    ...
                                ],
                                "processes" : [
                                    {
                                        "processName" : "my_process",
                                        "alarmMetrics" : [
                                    {
                                        "alarmMetricName" : "procstat cpu_usage",
                                        "monitor" : true
                                    }, {
                                        "alarmMetricName" : "procstat memory_rss",
                                        "monitor" : true
                                    }
                                ]
                            }
                        ],
                                "WindowsEvents": [
                                    {
                                        "LogGroupName": "my_windows_event_log_group_2",
                                        "EventName": "Application",
                                        "EventLevels": [
                                            "ERROR",
                                            "WARNING",
                                            ...
                                        ],
                                        "Encoding": "utf-8",
                                        "PatternSet": "my_pattern_set_4"
                                    },
                                    ...
                                ]
                            }
                        }   
                    ]
                }
            }
        ]
    }
}
```

**Template in YAML format**

```
---
Type: AWS::ApplicationInsights::Application
Properties:
  ResourceGroupName: my_resource_group
  ComponentMonitoringSettings:
  - ComponentARN: my_component
    Tier: SQL_SERVER
    ComponentConfigurationMode: CUSTOM
    CustomComponentConfiguration:
      ConfigurationDetails:
        AlarmMetrics:
        - AlarmMetricName: StatusCheckFailed
        ...
        Logs:
        - LogGroupName: my_log_group_1
          LogPath: C:\LogFolder_1\*
          LogType: DOT_NET_CORE
          Encoding: utf-8
          PatternSet: my_pattern_set_1
        ...
        WindowsEvents:
        - LogGroupName: my_windows_event_log_group_1
          EventName: Application
          EventLevels:
          - ERROR
          - WARNING
          ...
          Encoding: utf-8
          PatternSet: my_pattern_set_2
        ...
        Alarms:
        - AlarmName: my_alarm_name
          Severity: HIGH
        ...
      SubComponentTypeConfigurations:
      - SubComponentType: EC2_INSTANCE
        SubComponentConfigurationDetails:
          AlarmMetrics:
          - AlarmMetricName: DiskReadOps
          ...
          Logs:
          - LogGroupName: my_log_group_2
            LogPath: C:\LogFolder_2\*
            LogType: IIS
            Encoding: utf-8
            PatternSet: my_pattern_set_3
          ...
          Processes:
          - ProcessName: my_process
            AlarmMetrics:
            - AlarmMetricName: procstat cpu_usage
              ...
            ...
          WindowsEvents:
          - LogGroupName: my_windows_event_log_group_2
            EventName: Application
            EventLevels:
            - ERROR
            - WARNING
            ...
            Encoding: utf-8
            PatternSet: my_pattern_set_4
          ...
```

## Create an Application Insights application with `DEFAULT` mode component configuration


The following template performs these actions:
+ Creates an Application Insights application. For more information, see [CreateApplication](https://docs.aws.amazon.com/cloudwatch/latest/APIReference/API_CreateApplication.html) in the *Amazon CloudWatch Application Insights API Reference*.
+ Component `my_component` sets `ComponentConfigurationMode` to `DEFAULT` and `Tier` to `SQL_SERVER`, which causes this component to be configured with the configuration settings that Application Insights recommends for the `SQL_Server` tier. For more information, see [DescribeComponentConfiguration](https://docs.aws.amazon.com/cloudwatch/latest/APIReference/API_DescribeComponentConfiguration.html) and [UpdateComponentConfiguration](https://docs.aws.amazon.com/cloudwatch/latest/APIReference/API_UpdateComponentConfiguration.html) in the *Amazon CloudWatch Application Insights API Reference*.

**Template in JSON format**

```
{
    "Type": "AWS::ApplicationInsights::Application",
    "Properties": {
        "ResourceGroupName": "my_resource_group",
        "ComponentMonitoringSettings": [
            {
                "ComponentARN": "my_component",
                "Tier": "SQL_SERVER",
                "ComponentConfigurationMode": "DEFAULT"
            }
        ]
    }
}
```

**Template in YAML format**

```
---
Type: AWS::ApplicationInsights::Application
Properties:
  ResourceGroupName: my_resource_group
  ComponentMonitoringSettings:
  - ComponentARN: my_component
    Tier: SQL_SERVER
    ComponentConfigurationMode: DEFAULT
```

## Create an Application Insights application with `DEFAULT_WITH_OVERWRITE` mode component configuration


The following template performs these actions:
+ Creates an Application Insights application. For more information, see [CreateApplication](https://docs.aws.amazon.com/cloudwatch/latest/APIReference/API_CreateApplication.html) in the *Amazon CloudWatch Application Insights API Reference*.
+ Component `my_component` sets `ComponentConfigurationMode` to `DEFAULT_WITH_OVERWRITE` and `tier` to `DOT_NET_CORE`, which causes this component to be configured with the configuration settings that Application Insights recommends for the `DOT_NET_CORE` tier. Overwritten configuration settings are specified in the `DefaultOverwriteComponentConfiguration`: 
  + At the component level `AlarmMetrics` settings are overwritten.
  + At the sub-component level, for the `EC2_Instance` type sub-components, `Logs` settings are overwritten.

  For more information, see [UpdateComponentConfiguration](https://docs.aws.amazon.com/cloudwatch/latest/APIReference/API_UpdateComponentConfiguration.html) in the *Amazon CloudWatch Application Insights API Reference*.

**Template in JSON format**

```
{
    "Type": "AWS::ApplicationInsights::Application",
    "Properties": {
        "ResourceGroupName": "my_resource_group",
        "ComponentMonitoringSettings": [
            {
                "ComponentName": "my_component",
                "Tier": "DOT_NET_CORE",
                "ComponentConfigurationMode": "DEFAULT_WITH_OVERWRITE",
                "DefaultOverwriteComponentConfiguration": {
                    "ConfigurationDetails": {
                        "AlarmMetrics": [
                            {
                                "AlarmMetricName": "StatusCheckFailed"
                            }
                        ]
                    },
                    "SubComponentTypeConfigurations": [
                        {
                            "SubComponentType": "EC2_INSTANCE",
                            "SubComponentConfigurationDetails": {
                                "Logs": [
                                    {
                                        "LogGroupName": "my_log_group",
                                        "LogPath": "C:\\LogFolder\\*",
                                        "LogType": "IIS",
                                        "Encoding": "utf-8",
                                        "PatternSet": "my_pattern_set"
                                    }
                                ]
                            }
                        }   
                    ] 
                } 
            }
        ]
    }
}
```

**Template in YAML format**

```
---
Type: AWS::ApplicationInsights::Application
Properties:
  ResourceGroupName: my_resource_group
  ComponentMonitoringSettings:
  - ComponentName: my_component
    Tier: DOT_NET_CORE
    ComponentConfigurationMode: DEFAULT_WITH_OVERWRITE
    DefaultOverwriteComponentConfiguration:
      ConfigurationDetails:
        AlarmMetrics:
        - AlarmMetricName: StatusCheckFailed
      SubComponentTypeConfigurations:
      - SubComponentType: EC2_INSTANCE
        SubComponentConfigurationDetails:
          Logs:
          - LogGroupName: my_log_group
            LogPath: C:\LogFolder\*
            LogType: IIS
            Encoding: utf-8
            PatternSet: my_pattern_set
```

# Tutorial: Set up monitoring for SAP ASE


This tutorial demonstrates how to configure CloudWatch Application Insights to set up monitoring for your SAP ASE databases. You can use CloudWatch Application Insights automatic dashboards to visualize problem details, accelerate troubleshooting, and facilitate mean time to resolution (MTTR) for your SAP ASE databases.

**Topics**
+ [

## Supported environments
](#appinsights-tutorial-sap-ase-supported-environments)
+ [

## Supported operating systems
](#appinsights-tutorial-sap-ase-supported-os)
+ [

## Features
](#appinsights-tutorial-sap-ase-features)
+ [

## Prerequisites
](#appinsights-tutorial-sap-ase-prerequisites)
+ [Set up monitoring](#appinsights-tutorial-sap-ase-set-up)
+ [Manage monitoring](#appinsights-tutorial-sap-ase-manage)
+ [

## Configure the alarm threshold
](#appinsights-tutorial-sap-hana-configure-alarm-threshold)
+ [

## View and troubleshoot SAP ASE problems detected by Application Insights
](#appinsights-tutorial-sap-ase-troubleshooting-problems)
+ [Troubleshooting Application Insights](#appinsights-tutorial-sap-ase-troubleshooting-health-dashboard)

## Supported environments


CloudWatch Application Insights supports the deployment of AWS resources for the following systems and patterns. You provide and install SAP ASE database software and supported SAP application software.
+ **One or more SAP ASE databases on a single Amazon EC2 instance** – SAP ASE in a single-node, scale-up architecture.
+ **Cross-AZ SAP ASE database high availability setup** – SAP ASE with high availability configured across two Availability Zones using SUSE/RHEL clustering.

**Note**  
CloudWatch Application Insights supports only single SAP system ID (SID) ASE HA environments. If multiple ASE HA SIDs are attached, monitoring will be set up for only the first detected SID.

## Supported operating systems


CloudWatch Application Insights for SAP ASE supports x86-64 architecture on the following operating systems:
+ SuSE Linux 12 SP4
+ SuSE Linux 12 SP5
+ SuSE Linux 15
+ SuSE Linux 15 SP1
+ SuSE Linux 15 SP2
+ SuSE Linux 15 SP3
+ SuSE Linux 15 SP4
+ SuSE Linux 15 SP1 For SAP
+ SuSE Linux 15 SP2 For SAP
+ SuSE Linux 15 SP3 For SAP
+ SuSE Linux 15 SP4 For SAP
+ SuSE Linux 12 SP4 For SAP
+ SuSE Linux 12 SP5 For SAP
+ RedHat Linux 7.6
+ RedHat Linux 7.7
+ RedHat Linux 7.9
+ RedHat Linux 8.1
+ RedHat Linux 8.4
+ RedHat Linux 8.6

## Features


CloudWatch Application Insights for SAP ASE provides the following features:
+ Automatic SAP ASE workload detection 
+ Automatic SAP ASE alarm creation based on static threshold
+ Automatic SAP ASE alarm creation based on anomaly detection 
+ Automatic SAP ASE log pattern recognition 
+ Health dashboard for SAP ASE
+ Problem dashboard for SAP ASE

## Prerequisites


You must perform the following prerequisites to configure an SAP ASE database with CloudWatch Application Insights:
+ **SAP ASE configuration parameters** – The following configuration parameters must be enabled on your ASE DB: `"enable monitoring"`, `"sql text pipe max messages"`, `"sql text pipe active"`. This allows CloudWatch Application Insights to provide full monitoring capabilities for your DB. If these settings aren't enabled on your ASE database, Application Insights will automatically enable them to collect the necessary metrics to allow monitoring.
+ **SAP ASE database user** – The database user provided during Application Insights onboarding must have permission to access the following:
  + System tables in the master database and user (tenant) databases
  + Monitoring tables
+ **SAPHostCtrl** – Install and set up SAPHostCtrl on your Amazon EC2 instance.
+ **Amazon CloudWatch agent** – Make sure that you are not running a preexisting CloudWatch agent on your Amazon EC2 instance. If you have CloudWatch agent installed, make sure to remove the configuration of the resources you are using in CloudWatch Application Insights from the existing CloudWatch agent configuration file to avoid a merge conflict. For more information, see [Manually create or edit the CloudWatch agent configuration file](CloudWatch-Agent-Configuration-File-Details.md).
+ **AWS Systems Manager enablement** – Install SSM Agent on your instances, and enable the instances enabled for SSM. For information about how to install the SSM agent, see [Working with SSM Agent](https://docs.aws.amazon.com/systems-manager/latest/userguide/ssm-agent.html) in the *AWS Systems Manager User Guide*.
+ **Amazon EC2 instance roles** – You must attach the following Amazon EC2 instance roles to configure your database.
  + You must attach the `AmazonSSMManagedInstanceCore` role to enable Systems Manager. For more information, see [AWS Systems Manager identity-based policy examples](https://docs.aws.amazon.com/systems-manager/latest/userguide/auth-and-access-control-iam-identity-based-access-control.html).
  + You must attach the `CloudWatchAgentServerPolicy` to enable instance metrics and logs to be emitted through CloudWatch. For more information, see [Create IAM roles and users for use with Amazon CloudWatch agent](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/create-iam-roles-for-cloudwatch-agent.html).
  + You must attach the following IAM inline policy to the Amazon EC2 instance role to read the password stored in AWS Secrets Manager. For more information about inline policies, see [Inline policies ](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-vs-inline.html) in the *AWS Identity and Access Management User Guide*.

------
#### [ JSON ]

****  

    ```
    {
        "Version":"2012-10-17",		 	 	 
        "Statement": [
            {
                "Sid": "VisualEditor0",
                "Effect": "Allow",
                "Action": [
                    "secretsmanager:GetSecretValue"
                ],
                "Resource": "arn:aws:secretsmanager:*:*:secret:ApplicationInsights-*"
            }
        ]
    }
    ```

------
+ **AWS Resource Groups** – You must create a resource group that includes all of the associated AWS resources used by your application stack to onboard your applications to CloudWatch Application Insights. This includes Amazon EC2 instances and Amazon EBS volumes running your SAP ASE database. If there are multiple databases per account, we recommend that you create one resource group that includes the AWS resources for each SAP ASE database system. 
+ **IAM permissions** – For non-admin users:
  +  You must create an AWS Identity and Access Management (IAM) policy that allows Application Insights to create a service-linked role, and attach it to your user identity. For steps to attach the policy, see [IAM policy for CloudWatch Application Insights](appinsights-iam.md).
  + The user must have permission to create a secret in AWS Secrets Manager to store the database user credentials. For more information, see [Example: Permission to create secrets](https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html#auth-and-access_examples_create).

------
#### [ JSON ]

****  

    ```
    {
      "Version":"2012-10-17",		 	 	 
      "Statement": [
        {
          "Effect": "Allow",
          "Action": [
            "secretsmanager:CreateSecret"
          ],
          "Resource": "arn:aws:secretsmanager:*:*:secret:ApplicationInsights-*"
        }
      ]
    }
    ```

------
+ **Service-linked role** – Application Insights uses AWS Identity and Access Management (IAM) service-linked roles. A service-linked role is created for you when you create your first Application Insights application in the Application Insights console. For more information, see [Using service-linked roles for CloudWatch Application Insights](CHAP_using-service-linked-roles-appinsights.md).

## Set up monitoring on your SAP ASE database
Set up monitoring

Use the following steps to set up monitoring for your SAP ASE database

1. Open the [CloudWatch console](https://console.aws.amazon.com/cloudwatch).

1. From the left navigation pane, under **Insights**, choose **Application Insights**.

1. The **Application Insights** page displays the list of applications that are monitored with Application Insights, and the monitoring status for each application. In the upper right-hand corner, choose **Add an application**.

1. On the **Specify application details** page, from the dropdown list under **Resource group**, select the AWS resource group that contains your SAP ASE database resources. If you haven't created a resource group for your application, you can create one by choosing **Create new resource group** under the **Resource group** dropdown. For more information about creating resource groups, see the [https://docs.aws.amazon.com/ARG/latest/userguide/resource-groups.html](https://docs.aws.amazon.com/ARG/latest/userguide/resource-groups.html)

1. Under **Monitor CloudWatch Events**, select the check box to integrate Application Insights monitoring with CloudWatch Events to get insights from Amazon EBS, Amazon EC2, AWS CodeDeploy, Amazon ECS, AWS Health APIs and notifications, Amazon RDS, Amazon S3, and AWS Step Functions.

1. Under **Integrate with AWS Systems Manager OpsCenter**, select the check box next to **Generate AWS Systems Manager OpsCenter OpsItems for remedial actions** to view and get notifications when problems are detected for the selected applications. To track the operations that are performed to resolve operational work items, called OpsItems, that are related to your AWS resources, provide an SNS topic ARN. 

1. You can optionally enter tags to help you identify and organize your resources. CloudWatch Application Insights supports both tag-based and CloudFormation stack-based resource groups, with the exception of Application Auto Scaling groups. For more information, see [Tag Editor](https://docs.aws.amazon.com/ARG/latest/userguide/tag-editor.html) in the *AWS Resource Groups and Tags User Guide*. 

1. Choose **Next** to continue to set up monitoring.

1. On the **Review detected components** page, the monitored components and their workloads automatically detected by CloudWatch Application Insights are listed.
**Note**  
Components that contain a detected SAP ASE High Availability workload support only one workload on a component. Components that contain a detected SAP ASE single node workload support multiple workloads, but you can't add or remove workloads. All automatically detected workloads will be monitored.

1. Choose **Next**.

1. On the **Specify component details** page, enter the username and password of your SAP ASE databases.

1. Review your application monitoring configuration, and choose **Submit**.

1. The application details page opens, where you can view the **Application summary**, the list of **Monitored components and workloads**, and **Unmonitored components and workloads**. If you select the radio button next to a component or workload, you can also view the **Configuration history**, **Log patterns**, and any **Tags** that you have created. When you submit your configuration, your account deploys all of the metrics and alarms for your SAP ASE system, which can take up to 2 hours. 

## Manage monitoring of your SAP ASE database
Manage monitoring

You can manage user credentials, metrics, and log paths for your SAP ASE database by performing the following steps:

1. Open the [CloudWatch console](https://console.aws.amazon.com/cloudwatch).

1. From the left navigation pane, under **Insights**, choose **Application Insights**.

1. The **Application Insights** page displays the list of applications that are monitored with Application Insights, and the monitoring status for each application. 

1. Under **Monitored components**, select the radio button next to the component name. Then, choose **Manage monitoring**.

1. Under **EC2 instance group logs**, you can update the existing log path, log pattern set, and log group name. In addition, you can add up to three additional **Application logs**.

1. Under **Metrics**, you can choose the SAP ASE metrics according to your requirements. SAP ASE metric names are prefixed with `asedb`. You can add up to 60 metrics per component.

1. Under **ASE configuration**, enter the username and password for the SAP ASE database. This is the username and password that Amazon CloudWatch agent uses to connect to the SAP ASE database.

1. Under **Custom alarms**, you can add additional alarms to be monitored by CloudWatch Application Insights.

1. Review your application monitoring configuration and choose **Submit**. When you submit your configuration, your account updates all of the metrics and alarms for your SAP HANA system, which can take up to 2 hours.

## Configure the alarm threshold


CloudWatch Application Insights automatically creates a Amazon CloudWatch metric for the alarm to watch, along with the threshold for that metric. The alarm changes to the `ALARM ` state when the metric surpasses the threshold for a specified number of evaluation periods. Note that these settings are not retained by Application Insights.

To edit an alarm for a single metric, perform the following steps:

1. Open the [CloudWatch console](https://console.aws.amazon.com/cloudwatch).

1. In the left navigation pane, choose **Alarms**>**All alarms**.

1. Select the radio button next to the alarm that was automatically created by CloudWatch Application Insights. Then choose **Actions**, and select **Edit** from the dropdown menu.

1. Edit the following parameters under **Metric**.

   1. Under **Statistic**, choose one of the statistics or predefined percentiles, or specify a custom percentile. For example, `p95.45`.

   1. Under **Period**, choose the evaluations period for the alarm. When you evaluate the alarm, each period is aggregated into one data point.

1. Edit the following parameters under **Conditions**.

   1. Choose whether the metric must be greater than, less than, or equal to the threshold. 

   1. Specify the threshold value.

1. Under **Additional configuration** edit the following parameters.

   1. Under **Datapoints to alarm**, specify the number of data points, or evaluation periods, that must be in the `ALARM` state to initiate the alarm. When the two values match, an alarm is created that enters `ALARM` state if the designated number of consecutive periods are exceeded. To create an `m` out of `n` alarm, specify a lower value for the first data point than for the second. For more information about evaluating alarms, see [Evaluating an alarm](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Alarms.html#alarm-evaluation).

   1. Under **Missing data treatment**, choose the behavior of the alarm when some data points are missing. For more information about missing data treatment, see [Configuring how CloudWatch alarms treat missing data](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Alarms.html#alarms-and-missing-data).

   1. If the alarm uses a percentile as the monitored statistic, a **Percentiles with low samples** box appears. Choose whether to evaluate or ignore cases with low sample rates. If you choose **ignore (maintain alarm state)**, the current alarm state is always maintained when the sample size is too low. For more information about percentiles with low samples, see [Percentile-based alarms and low data samples](percentiles-with-low-samples.md).

1. Choose **Next**.

1. Under **Notification**, select an SNS topic to notify when the alarm is in `ALARM` state, `OK` state, or `INSUFFICIENT_DATA` state.

1. Choose **Update alarm**.

## View and troubleshoot SAP ASE problems detected by Application Insights


This section helps you resolve common troubleshooting problems that occur when you configure monitoring for SAP ASE on Application Insights.

**SAP ASE Backup Server errors**  
You can identify the error message by checking the dynamically created dashboard. The dashboard shows the error message reported in the SAP ASE Backup Server. For more details about SAP ASE Backup Server logs, see [SAP Documentation Backup Server Error Logging](https://help.sap.com/docs/SAP_ASE/aa939a27edb34f019f71cc47b9c0fd9a/a7aeb8b1bc2b10149ccf99b95687a64c.html).

**SAP ASE long running transactions**  
Identify the long running transaction and confirm whether it can be stopped or if the running time is intentional. For more details, see [2180410 — How to display transaction log records for long running transactions? — SAP ASE](https://userapps.support.sap.com/sap/support/knowledge/en/2180410).

**SAP ASE User connections**  
Review whether your SAP ASE database is sized accordingly for the workload you intend to run on the database. For more details, see [Configuring User Connections](https://help.sap.com/docs/help/061ec8a5739842df9e505d8944fae8e2/9ea258fceaaa496eb80e17d3d5694ff6.html) in the SAP documentation.

**SAP ASE disk space**  
You can identify the database layer that is causing the problem by checking the dynamically created dashboard. The dashboard shows the related metrics and log file snippets. It is important to understand the cause of the disk growth and when applicable, increase the physical disk size, the allocated disk space, or both. For more details, see [SAP Documentation disk resize](https://help.sap.com/docs/SAP_ASE/e0d4539d39c34f52ae9ef822c2060077/ab22db00bc2b1014ad3ce047bbf117d7.html) in the SAP documentation.

## Troubleshooting Application Insights for SAP ASE
Troubleshooting Application Insights

This section provides steps to help you resolve common errors returned by the Application Insights dashboard. 


| Error | Error returned | Root cause | Resolution | 
| --- | --- | --- | --- | 
|  Unable to add more than 60 monitor metrics.  |  `Component cannot have more than 60 monitored metric`  |  The current metric limit is 60 monitored metrics per component.  |  Remove unnecessary metrics to adhere to the limit.  | 
|  No SAP metrics or alarms appear after the onboarding process  |  The `run` command on the `AWS-ConfigureAWSPackage` failed in AWS Systems Manager. The output shows the error: `CT-LIBRARY error:``ct_connect(): protocol specific layer: external error: The attempt to connect to the server failed`  |  The username and password might be incorrect.  |  Verify that the username and password are valid, then rerun the onboarding process.  | 

# Tutorial: Set up monitoring for SAP HANA
Tutorial: Set up monitoring for SAP HANA

This tutorial demonstrates how to configure CloudWatch Application Insights to set up monitoring for your SAP HANA databases. You can use CloudWatch Application Insights automatic dashboards to visualize problem details, accelerate troubleshooting, and facilitate mean time to resolution (MTTR) for your SAP HANA databases.

**Topics**
+ [

## Supported environments
](#appinsights-tutorial-sap-hana-supported-environments)
+ [

## Supported operating systems
](#appinsights-tutorial-sap-hana-supported-os)
+ [

## Features
](#appinsights-tutorial-sap-hana-features)
+ [

## Prerequisites
](#appinsights-tutorial-sap-hana-prerequisites)
+ [Set up monitoring](#appinsights-tutorial-sap-hana-set-up)
+ [Manage monitoring](#appinsights-tutorial-sap-hana-manage)
+ [Troubleshooting problems detected](#appinsights-tutorial-sap-hana-troubleshooting)
+ [Anomaly detection](#appinsights-tutorial-sap-hana-troubleshooting-anomaly-detection)
+ [Troubleshooting Application Insights](#appinsights-tutorial-sap-hana-troubleshooting-health-dashboard)

## Supported environments


CloudWatch Application Insights supports the deployment of AWS resources for the following systems and patterns. You provide and install SAP HANA database software and supported SAP application software.
+ **SAP HANA database on a single Amazon EC2 instance** — SAP HANA in a single-node, scale-up architecture, with up to 24TB of memory.
+ **SAP HANA database on multiple Amazon EC2 instances** — SAP HANA in a multi-node, scale-out architecture.
+ **Cross-AZ SAP HANA database high availability setup** — SAP HANA with high availability configured across two Availability Zones using SUSE/RHEL clustering.

**Note**  
CloudWatch Application Insights supports only single SID HANA environments. If multiple HANA SIDs are attached, monitoring will be set up for only the first detected SID.

## Supported operating systems


CloudWatch Application Insights for SAP HANA supports x86-64 architecture on the following operating systems:
+ SuSE Linux 12 SP4 For SAP
+ SuSE Linux 12 SP5 For SAP
+ SuSE Linux 15
+ SuSE Linux 15 SP1
+ SuSE Linux 15 SP2
+ SuSE Linux 15 For SAP
+ SuSE Linux 15 SP1 For SAP
+ SuSE Linux 15 SP2 For SAP
+ SuSE Linux 15 SP3 For SAP
+ SuSE Linux 15 SP4 For SAP
+ SuSE Linux 15 SP5 For SAP
+ RedHat Linux 8.6 For SAP With High Availability and Update Services
+ RedHat Linux 8.5 For SAP With High Availability and Update Services
+ RedHat Linux 8.4 For SAP With High Availability and Update Services
+ RedHat Linux 8.3 For SAP With High Availability and Update Services
+ RedHat Linux 8.2 For SAP With High Availability and Update Services
+ RedHat Linux 8.1 For SAP With High Availability and Update Services
+ RedHat Linux 7.9 For SAP With High Availability and Update Services

## Features


CloudWatch Application Insights for SAP HANA provides the following features:
+ Automatic SAP HANA workload detection 
+ Automatic SAP HANA alarm creation based on static threshold
+ Automatic SAP HANA alarm creation based on anomaly detection
+ Automatic SAP HANA log pattern recognition 
+ Health dashboard for SAP HANA
+ Problem dashboard for SAP HANA

## Prerequisites


You must perform the following prerequisites to configure an SAP HANA database with CloudWatch Application Insights:
+ **SAP HANA** – Install a running and reachable SAP HANA database 2.0 SPS05 on an Amazon EC2 instance.
+ **SAP HANA database user** – A database user with monitoring roles must be created in the SYSTEM database and all tenants. 

**Example**  
The following SQL commands create a user with monitoring roles.

  ```
  su - <sid>adm
  hdbsql -u SYSTEM -p <SYSTEMDB password> -d SYSTEMDB
  CREATE USER CW_HANADB_EXPORTER_USER PASSWORD <Monitoring user password> NO FORCE_FIRST_PASSWORD_CHANGE;
  CREATE ROLE CW_HANADB_EXPORTER_ROLE;
  GRANT MONITORING TO CW_HANADB_EXPORTER_ROLE;
  GRANT CW_HANADB_EXPORTER_ROLE TO CW_HANADB_EXPORTER_USER;
  ```
+ **Python 3.8** – Install Python 3.8 or later versions on your operating system. Use the latest release of Python. If Python3 is not detected on your operating system, Python 3.6 will be installed. 

  For more information, see the [installation example](#install). 
**Note**  
Manual installation of Python 3.8 or higher is required for SuSE Linux 15 SP4, RedHat Linux 8.6, and later operating systems.
+ **Pip3** – Install the installer program, pip3, on your operating system. If pip3 is not detected on your operating system, it will be installed.
+ **hdbclient** – CloudWatch Application Insights uses the python driver to connect to the SAP HANA database. If the client is not installed under python3, ensure that you have hdbclient tar file version `2.10 or later` under `/hana/shared/SID/hdbclient/`.
+ **Amazon CloudWatch agent** – Make sure that you are not running a preexisting CloudWatch agent on your Amazon EC2 instance. If you have CloudWatch agent installed, make sure to remove the configuration of the resources you are using in CloudWatch Application Insights from the existing CloudWatch agent configuration file to avoid a merge conflict. For more information, see [Manually create or edit the CloudWatch agent configuration file](CloudWatch-Agent-Configuration-File-Details.md).
+ **AWS Systems Manager enablement** – Install SSM Agent on your instances, and the instances must be enabled for SSM. For information about how to install the SSM Agent, see [Working with SSM Agent](https://docs.aws.amazon.com/systems-manager/latest/userguide/ssm-agent.html) in the *AWS Systems Manager User Guide*.
+ **Amazon EC2 instance roles** – You must attach the following Amazon EC2 instance roles to configure your database.
  + You must attach the `AmazonSSMManagedInstanceCore` role to enable Systems Manager. For more information, see [AWS Systems Manager identity-based policy examples](https://docs.aws.amazon.com/systems-manager/latest/userguide/auth-and-access-control-iam-identity-based-access-control.html).
  + You must attach the `CloudWatchAgentServerPolicy` to enable instance metrics and logs to be emitted through CloudWatch. For more information, see [Create IAM roles and users for use with CloudWatch agent](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/create-iam-roles-for-cloudwatch-agent.html).
  + You must attach the following IAM inline policy to the Amazon EC2 instance role to read the password stored in AWS Secrets Manager. For more information about inline policies, see [Inline policies ](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-vs-inline.html) in the *AWS Identity and Access Management User Guide*.

------
#### [ JSON ]

****  

    ```
    {
        "Version":"2012-10-17",		 	 	 
        "Statement": [
            {
                "Sid": "VisualEditor0",
                "Effect": "Allow",
                "Action": [
                    "secretsmanager:GetSecretValue"
                ],
                "Resource": "arn:aws:secretsmanager:*:*:secret:ApplicationInsights-*"
            }
        ]
    }
    ```

------
+ **AWS resource groups** – You must create a resource group that includes all of the associated AWS resources used by your application stack to onboard your applications to CloudWatch Application Insights. This includes Amazon EC2 instances and Amazon EBS volumes running your SAP HANA database. If there are multiple databases per account, we recommend that you create one resource group that includes the AWS resources for each SAP HANA database system. 
+ **IAM permissions** – For non-admin users:
  +  You must create an AWS Identity and Access Management (IAM) policy that allows Application Insights to create a service-linked role, and attach it to your user identity. For steps to attach the policy, see [IAM policy for CloudWatch Application Insights](appinsights-iam.md).
  + The user must have permission to create a secret in AWS Secrets Manager to store the database user credentials. For more information, see [Example: Permission to create secrets](https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html#auth-and-access_examples_create).

------
#### [ JSON ]

****  

    ```
    {
      "Version":"2012-10-17",		 	 	 
      "Statement": [
        {
          "Effect": "Allow",
          "Action": [
            "secretsmanager:CreateSecret"
          ],
          "Resource": "arn:aws:secretsmanager:*:*:secret:ApplicationInsights-*"
        }
      ]
    }
    ```

------
+ **Service-linked role** – Application Insights uses AWS Identity and Access Management (IAM) service-linked roles. A service-linked role is created for you when you create your first Application Insights application in the Application Insights console. For more information, see [Using service-linked roles for CloudWatch Application Insights](CHAP_using-service-linked-roles-appinsights.md).

## Set up your SAP HANA database for monitoring
Set up monitoring

Use the following steps to set up monitoring for your SAP HANA database

1. Open the [CloudWatch console](https://console.aws.amazon.com/cloudwatch).

1. From the left navigation pane, under **Insights**, choose **Application Insights**.

1. The **Application Insights** page displays the list of applications that are monitored with Application Insights, and the monitoring status for each application. In the upper right-hand corner, choose **Add an application**.

1. On the **Specify application details** page, from the dropdown list under **Resource group**, select the AWS resource group that contains your SAP HANA database resources. If you haven't created a resource group for your application, you can create one by choosing **Create new resource group** under the **Resource group** dropdown. For more information about creating resource groups, see the [https://docs.aws.amazon.com/ARG/latest/userguide/resource-groups.html](https://docs.aws.amazon.com/ARG/latest/userguide/resource-groups.html)

1. Under **Monitor CloudWatch Events**, select the check box to integrate Application Insights monitoring with CloudWatch Events to get insights from Amazon EBS, Amazon EC2, AWS CodeDeploy, Amazon ECS, AWS Health APIs and notifications, Amazon RDS, Amazon S3, and AWS Step Functions.

1. Under **Integrate with AWS Systems Manager OpsCenter**, select the check box next to **Generate AWS Systems Manager OpsCenter OpsItems for remedial actions** to view and get notifications when problems are detected for the selected applications. To track the operations that are performed to resolve operational work items, called OpsItems, that are related to your AWS resources, provide an SNS topic ARN. 

1. You can optionally enter tags to help you identify and organize your resources. CloudWatch Application Insights supports both tag-based and CloudFormation stack-based resource groups, with the exception of Application Auto Scaling groups. For more information, see [Tag Editor](https://docs.aws.amazon.com/ARG/latest/userguide/tag-editor.html) in the *AWS Resource Groups and Tags User Guide*. 

1. Choose **Next** to continue to set up monitoring.

1. On the **Review detected components** page, the monitored components and their workloads automatically detected by CloudWatch Application Insights are listed.

   1. To add workloads to a component that contains a detected SAP HANA single node workload, select the component, then choose **Edit component**.
**Note**  
Components that contain a detected SAP HANA multi node or HANA High Availability workload support only one workload on a component.  
![\[The review components for monitoring page of the CloudWatch Application Insights console: select component to edit.\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/appinsights-multiapp-hana-review.png)

   1. To add a new workload, choose **Add new workload**.  
![\[The edit component section of the CloudWatch Application Insights console: choose lower left button to add workload.\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/appinsights-multiapp-hana-edit.png)

   1. When you are finished editing workloads, choose **Save changes**.

1. Choose **Next**.

1. On the **Specify component details** page, enter the username and password.

1. Review your application monitoring configuration, and choose **Submit**.

1. The application details page opens, where you can view the **Application summary**, the list of **Monitored components and workloads**, and **Unmonitored components and workloads**. If you select the radio button next to a component or workload, you can also view the **Configuration history**, **Log patterns**, and any **Tags** that you have created. When you submit your configuration, your account deploys all of the metrics and alarms for your SAP HANA system, which can take up to 2 hours. 

## Manage monitoring of your SAP HANA database
Manage monitoring

You can manage user credentials, metrics, and log paths for your SAP HANA database by performing the following steps:

1. Open the [CloudWatch console](https://console.aws.amazon.com/cloudwatch).

1. From the left navigation pane, under **Insights**, choose **Application Insights**.

1. The **Application Insights** page displays the list of applications that are monitored with Application Insights, and the monitoring status for each application. 

1. Under **Monitored components**, select the radio button next to the component name. Then, choose **Manage monitoring**.

1. Under **EC2 instance group logs**, you can update the existing log path, log pattern set, and log group name. In addition, you can add up to three additional **Application logs**.

1. Under **Metrics**, you can choose the SAP HANA metrics according to your requirements. SAP HANA metric names are prefixed with `hanadb`. You can add up to 40 metrics per component.

1. Under **HANA configuration**, enter the password and user name for the SAP HANA database. This is the username and password that Amazon CloudWatch agent uses to connect to the SAP HANA database.

1. Under **Custom alarms**, you can add additional alarms to be monitored by CloudWatch Application Insights.

1. Review your application monitoring configuration and choose **Submit**. When you submit your configuration, your account updates all of the metrics and alarms for your SAP HANA system, which can take up to 2 hours.

## View and troubleshoot SAP HANA problems detected by CloudWatch Application Insights
Troubleshooting problems detected

The following sections provide steps to help you resolve common troubleshooting scenarios that occur when you configure monitoring for SAP HANA on Application Insights.

**Topics**
+ [

### SAP HANA database reaches memory allocation limit
](#appinsights-tutorial-sap-hana-troubleshooting-memory)
+ [

### Disk full event
](#appinsights-tutorial-sap-hana-troubleshooting-disk-full)
+ [

### SAP HANA backup stopped running
](#appinsights-tutorial-sap-hana-troubleshooting-backup-stopped)

### SAP HANA database reaches memory allocation limit
Memory allocation

**Description**  
Your SAP application that is backed by an SAP HANA database malfunctions because of high memory pressure, leading to application performance degradation.

**Resolution**  
You can identify the application layer that is causing the problem by checking the dynamically created dashboard, which shows the related metrics and log file snippets. In the following example, the problem may be because of a large data load in the SAP HANA system.

![\[Memory allocation exceeded.\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/appinsights-memory-allocation-1.png)


The used memory allocation exceeds the threshold of 80 percent of the total memory allocation limit.

![\[Log group showing out of memory.\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/appinsights-memory-allocation-2.png)


The log group shows the scheme `BNR-DATA` and table `IMDBMASTER_30003` ran out of memory. In addition, the log group shows the exact time of the issue, current global location limit, shared memory, code size, and OOM reservation allocation size.

![\[Log group text.\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/appinsights-memory-allocation-3.png)


### Disk full event
Disk full

**Description**  
Your SAP application that is backed by an SAP HANA database stops responding, which leads to an inability to access the database.

**Resolution**  
You can identify the database layer that is causing the problem by checking the dynamically created dashboard, which shows the related metrics and log file snippets. In the following example, the problem may be that the administrator failed to enable automatic log backup, which caused the sap/hana/log directory to fill up.

![\[Log group showing out of memory.\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/appinsights-disk-full-1.png)


The log group widget in the problem dashboard shows the `DISKFULL` event.

![\[Log group showing out of memory.\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/appinsights-disk-full-2.png)


### SAP HANA backup stopped running
Backup stopped running

**Description**  
Your SAP application that is backed by an SAP HANA database has stopped working.

**Resolution**  
You can identify the database layer that is causing the problem by checking the dynamically created dashboard, which shows the related metrics and log file snippets. 

The log group widget in the problem dashboard shows the `ACCESS DENIED` event. This includes additional information, such as the S3 bucket, the S3 bucket folder, and the S3 bucket Region.

![\[Log group showing out of memory.\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/appinsights-backup-stopped-2.png)


## Anomaly detection for SAP HANA
Anomaly detection

For specific SAP HANA metrics, such as the number of thread count, CloudWatch applies statistical and machine learning algorithms to define the threshold. These algorithms continuously analyze the metrics of the SAP HANA database, determine normal baselines, and surface anomalies with minimal user intervention. The algorithms generate an anomaly detection model, which generates a range of expected values that represent normal metric behavior.

Anomaly detection algorithms account for the seasonality and trend changes of metrics. The seasonality changes can be hourly, daily, or weekly, as shown in the following examples of the SAP HANA CPU usage.

![\[Log group showing out of memory.\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/appinsights-anomaly-detection.png)


After you create a model, CloudWatch anomaly detection continuously evaluates the model and makes adjustments to it to ensure that is it as accurate as possible. This includes retraining the model to adjust if the metric values evolve over time or experience sudden changes. It also includes predictors to improve the models for metrics that are seasonal, spiky, or sparse.

## Troubleshooting Application Insights for SAP HANA
Troubleshooting Application Insights

This section provides steps to help you resolve common errors returned by the Application Insights dashboard. 

### Unable to add more than 60 monitored metrics


The output shows the following error.

```
Component cannot have more than 60 monitored metrics
```

**Root cause** – The current metric limit is 60 monitored metrics per component.

**Resolution** – To stay under the limit, remove metrics that are not necessary.

### No SAP metrics appear after the onboarding process


Use the following information to find out why SAP metrics don't appear on the dashboard after the onboarding process. The first step is to troubleshoot why the SAP metrics don't appear using the AWS Management Console or Exporter logs from an Amazon EC2 instance. Next, review the error output to find a resolution.

#### Troubleshoot why SAP metrics don't appear after onboarding


You can use the AWS Management Console or exporter logs from an Amazon EC2 instance for troubleshooting.

------
#### [ AWS Management Console ]

**Troubleshoot no SAP metrics appear after onboarding using the console**

1. Open the AWS Systems Manager console at [https://console.aws.amazon.com/systems-manager/](https://console.aws.amazon.com/systems-manager/).

1. In the left navigation pane, choose **State Manager**.

1. Under **Associations**, check the status of the document `AWSEC2-ApplicationInsightsCloudwatchAgentInstallAndConfigure`. If the status is `Failed`, under **Execution id**, select the failed id and view the output.

1. Under **Associations**, check the status of the document `AWS-ConfigureAWSPackage`. If the status is `Failed`, under **Execution id**, select the failed id and view the output.

------
#### [ Exporter logs from Amazon EC2 instance ]

**Troubleshoot no SAP metrics appear after onboarding using exporter logs**

1. Connect to the Amazon EC2 instance where your SAP HANA database is running.

1. <a name="step-find-short-name"></a>Find the correct naming convention for `WORKLOAD_SHORT_NAME` using the following command. You will use this short name in the following two steps. 

   ```
   sudo systemctl | grep exporter
   ```
**Note**  
Application Insights adds a suffix, `WORKLOAD_SHORT_NAME` to the service name depending on the workload that is running. The short names for SAP HANA single node, multiple nodes, and high availability deployments are `HANA_SN`, `HANA_MN`, and `HANA_HA`.

1. To check for errors in the exporter manager service logs, run the following command replacing `WORKLOAD_SHORT_NAME` with the short name you found in [Step 2](#step-find-short-name).

   ```
   sudo journalctl -e --unit=prometheus-hanadb_exporter_manager_WORKLOAD_SHORT_NAME.service
   ```

1. If the exporter manager service logs do not show an error, check for errors in the exporter service logs by running the following command.

   ```
   sudo journalctl -e --unit=prometheus-hanadb_exporter_WORKLOAD_SHORT_NAME.service
   ```

------

#### Resolving the common root causes for SAP metrics not appearing after onboarding


The following examples describe how to resolve the common root causes of SAP metrics not appearing after onboarding.
+ The output shows the following error.

  ```
  Reading json config file path: /opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.d/default ...
  Reading json config file path: /opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.d/ssm_AmazonCloudWatch-ApplicationInsights-SSMParameterForTESTCWEC2INSTANCEi0d88867f1f3e36285.tmp ...
  2023/11/30 22:25:17 Failed to merge multiple json config files.
  2023/11/30 22:25:17 Failed to merge multiple json config files.
  2023/11/30 22:25:17 Under path : /metrics/append_dimensions | Error : Different values are specified for append_dimensions
  2023/11/30 22:25:17 Under path : /metrics/metrics_collected/disk | Error : Different values are specified for disk
  2023/11/30 22:25:17 Under path : /metrics/metrics_collected/mem | Error : Different values are specified for mem
  2023/11/30 22:25:17 Configuration validation first phase failed. Agent version: 1.0. Verify the JSON input is only using features supported by this version.
  ```

  **Resolution** – Application Insights is trying to configure the same metrics that are pre-configured as part of the existing CloudWatch agent configuration file. Remove the existing files under `/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.d/` or remove the metrics that are causing the conflict from the existing CloudWatch agent configuration file.
+ The output shows the following error.

  ```
  Unable to find a host with system database, for more info rerun using -v
  ```

  **Resolution** – The username, password, or database port may be incorrect. Verify that the username, password, and port are valid, then re-run the onboarding process.
+ The output shows the following error.

  ```
  This hdbcli installer is not compatible with your Python interpreter
  ```

  **Resolution** – Upgrade pip3 and wheel as shown in the following example for Python 3.6.

  ```
  python3.6 -m pip install --upgrade pip setuptools wheel
  ```
+ The output shows the following error.

  ```
  Unable to install hdbcli using pip3. Please try to install it
  ```

  **Resolution** – Ensure that you have followed the `hdbclient` prerequisites or install `hdbclient` manually under pip3.
+ The output shows the following error.

  ```
  Package 'boto3' requires a different Python: 3.6.15 not in '>= 3.7'
  ```

  **Resolution** – Python 3.8 or higher is required for this operating system version. Check the Python 3.8 prerequisites and install it.
+ The output shows one of the following installation errors.

  ```
  Can not execute `setup.py` since setuptools is not available in the build environment
  ```

  or

  ```
  [SSL: CERTIFICATE_VERIFY_FAILED]
  ```

  **Resolution** – Install Python using SUSE Linux commands as shown in the following example. The following example installs the latest version of [Python 3.8](https://www.python.org/downloads/).

  ```
  wget https://www.python.org/ftp/python/3.8.<LATEST_RELEASE>/Python-3.8.<LATEST_RELEASE>.tgz
  tar xf Python-3.*
  cd Python-3.*/
  sudo zypper install make gcc-c++ gcc automake autoconf libtool
  sudo zypper install zlib-devel
  sudo zypper install libopenssl-devel libffi-devel
  ./configure --with-ensurepip=install 
  sudo make
  sudo make install
  sudo su 
  python3.8 -m pip install --upgrade pip setuptools wheel
  ```

# Tutorial: Set up monitoring for SAP NetWeaver


This tutorial demonstrates how to configure Amazon CloudWatch Application Insights to set up monitoring for SAP NetWeaver. You can use CloudWatch Application Insights automatic dashboards to visualize problem details, accelerate troubleshooting, and reduce mean time to resolution (MTTR) for your SAP NetWeaver application servers.

**Topics**
+ [

## Supported environments
](#appinsights-tutorial-sap-netweaver-supported-environments)
+ [

## Supported operating systems
](#appinsights-tutorial-sap-netweaver-supported-os)
+ [

## Features
](#appinsights-tutorial-sap-netweaver-features)
+ [

## Prerequisites
](#appinsights-tutorial-sap-netweaver-prerequisites)
+ [Set up monitoring](#appinsights-tutorial-sap-netweaver-set-up)
+ [Manage monitoring](#appinsights-tutorial-sap-netweaver-manage)
+ [Troubleshooting problems](#appinsights-tutorial-sap-netweaver-troubleshooting)
+ [Troubleshooting Application Insights](#appinsights-tutorial-sap-netweaver-troubleshooting-health-dashboard)

## Supported environments


CloudWatch Application Insights supports the deployment of AWS resources for the following systems and patterns. 
+ **SAP NetWeaver Standard System Deployment.**
+ **SAP NetWeaver Distributed deployments on multiple Amazon EC2 instances.**
+ **Cross-AZ SAP NetWeaver high availability setup** – SAP NetWeaver with high availability configured across two Availability Zones using SUSE/RHEL clustering.

## Supported operating systems


CloudWatch Application Insights for SAP NetWeaver is supported on the following operating systems:
+ Oracle Linux 8
+ Red Hat Enterprise Linux 7.6
+ Red Hat Enterprise Linux 7.7
+ Red Hat Enterprise Linux 7.9
+ Red Hat Enterprise Linux 8.1
+ Red Hat Enterprise Linux 8.2
+ Red Hat Enterprise Linux 8.4
+ Red Hat Enterprise Linux 8.6
+ SUSE Linux Enterprise Server 15 for SAP
+ SUSE Linux Enterprise Server 15 SP1 for SAP
+ SUSE Linux Enterprise Server 15 SP2 for SAP
+ SUSE Linux Enterprise Server 15 SP3 for SAP
+ SUSE Linux Enterprise Server 15 SP4 for SAP
+ SUSE Linux Enterprise Server 12 SP4 for SAP
+ SUSE Linux Enterprise Server 12 SP5 for SAP
+ SUSE Linux Enterprise Server 15 except High Availability patterns
+ SUSE Linux Enterprise Server 15 SP1 except High Availability patterns
+ SUSE Linux Enterprise Server 15 SP2 except High Availability patterns
+ SUSE Linux Enterprise Server 15 SP3 except High Availability patterns
+ SUSE Linux Enterprise Server 15 SP4 except High Availability patterns
+ SUSE Linux Enterprise Server 12 SP4 except High Availability patterns
+ SUSE Linux Enterprise Server 12 SP5 except High Availability patterns

## Features


CloudWatch Application Insights for SAP NetWeaver 7.0x–7.5x (including ABAP Platform) provides the following features:
+ Automatic SAP NetWeaver workload detection 
+ Automatic SAP NetWeaver alarm creation based on static thresholds
+ Automatic SAP NetWeaver log pattern recognition 
+ Health dashboard for SAP NetWeaver
+ Problem dashboard for SAP NetWeaver

## Prerequisites


You must perform the following prerequisites to configure SAP NetWeaver with CloudWatch Application Insights:
+ **AWS Systems Manager enablement** – Install SSM Agent on your Amazon EC2 instances, and enable the instances for SSM. For information about how to install the SSM Agent, see [Setting up AWS Systems Manager](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-setting-up.html) in the *AWS Systems Manager User Guide*.
+ **Amazon EC2 instance roles** – You must attach the following Amazon EC2 instance roles to configure your SAP NetWeaver monitoring.
  + You must attach the `AmazonSSMManagedInstanceCore` role to enable Systems Manager. For more information, see [AWS Systems Manager identity-based policy examples](https://docs.aws.amazon.com/systems-manager/latest/userguide/auth-and-access-control-iam-identity-based-access-control.html).
  + You must attach the `CloudWatchAgentServerPolicy` policy to enable instance metrics and logs to be emitted through CloudWatch. For more information, see [Create IAM roles and users for use with CloudWatch agent](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/create-iam-roles-for-cloudwatch-agent.html).
+ **AWS resource groups** – You must create a resource group that includes all of the associated AWS resources used by your application stack to onboard your applications to CloudWatch Application Insights. This includes Amazon EC2 instances, Amazon EFS, and Amazon EBS volumes running your SAP NetWeaver application servers. If there are multiple SAP NetWeaver systems per account, we recommend that you create one resource group that includes the AWS resources for each SAP NetWeaver system. For more information about creating resource groups, see the *[AWS Resource Groups and Tags User Guide](https://docs.aws.amazon.com/ARG/latest/userguide/resource-groups.html)*.
+ **IAM permissions** – For users who don't have administrative access, you must create an AWS Identity and Access Management (IAM) policy that allows Application Insights to create a service-linked role and attach it to the user's identity. For more information about how to create the IAM policy, see [IAM policy](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/appinsights-iam.html).
+ **Service-linked role** – Application Insights uses AWS Identity and Access Management (IAM) service-linked roles. A service-linked role is created for you when you create your first Application Insights application in the Application Insights console. For more information, see [Using service-linked roles for CloudWatch Application Insights](CHAP_using-service-linked-roles-appinsights.md).
+ **Amazon CloudWatch agent** – Application Insights installs and configures the CloudWatch agent. If you have CloudWatch agent installed, Application Insights retains your configuration. To avoid a merge conflict, remove the configuration of resources that you want to use in Application Insights from the existing CloudWatch agent configuration file. For more information, see [Manually create or edit the CloudWatch agent configuration file](CloudWatch-Agent-Configuration-File-Details.md).

## Set up your SAP NetWeaver application servers for monitoring
Set up monitoring

Use the following steps to set up monitoring for your SAP NetWeaver application servers.

**To set up monitoring**

1. Open the [CloudWatch console](https://console.aws.amazon.com/cloudwatch).

1. From the left navigation pane, under **Insights**, select **Application Insights**.

1. The **Application Insights** page displays the list of applications that are monitored with Application Insights, and the monitoring status for each application. In the upper right-hand corner, select **Add an application**.

1. On the **Specify application details** page, from the dropdown list under **Resource group**, select the AWS resource group you created that contains your SAP NetWeaver resources. If you haven't created a resource group for your application, you can create one by choosing **Create new resource group** under the **Resource group** dropdown list. 

1. Under **Automatic monitoring of new resources**, select the check box to allow Application Insights to automatically monitor the resources that are added to the application's resource group after onboarding. 

1. Under **Monitor EventBridge events**, select the check box to integrate Application Insights monitoring with CloudWatch Events to get insights from Amazon EBS, Amazon EC2, AWS CodeDeploy, Amazon ECS, AWS Health APIs and notifications, Amazon RDS, Amazon S3, and AWS Step Functions.

1. Under **Integrate with AWS Systems Manager OpsCenter**, select the check box next to **Generate AWS Systems Manager OpsCenter OpsItems for remedial actions** to view and get notifications when problems are detected for the selected applications. To track the operations that are performed to resolve operational work items, called [OpsItems](https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-getting-started-sns.html), that are related to your AWS resources, provide an SNS topic ARN. 

1. You can optionally enter tags to help you identify and organize your resources. CloudWatch Application Insights supports both tag-based and CloudFormation stack-based resource groups, with the exception of Application Auto Scaling groups. For more information, see [Tag Editor](https://docs.aws.amazon.com/ARG/latest/userguide/tag-editor.html) in the *AWS Resource Groups and Tags User Guide*. 

1. To review detected components, choose **Next**.

1. On the **Review detected components** page, the monitored components and their workloads automatically detected by CloudWatch Application Insights are listed. 

   1. To edit the workload type and name, choose **Edit component**.
**Note**  
Components that contain a detected NetWeaver Distributed or NetWeaver High Availability workload support only one workload on a component.  
![\[The review detected components section of the CloudWatch Application Insights console: list of components that can be edited.\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/appinsights-multiapp-netweaver.png)

1. Choose **Next**.

1. On the **Specify component details** page, choose **Next**.

1. Review your application monitoring configuration, then choose **Submit**.

1. The application details page opens, where you can view the **Application summary**, **Dashboard**, **Components**, and **Workloads**. You can also view the **Configuration history**, **Log patterns**, and any **Tags** that you have created. After you submit your application, CloudWatch Application Insights deploys all of the metrics and alarms for your SAP NetWeaver system, which can take up to an hour.

## Manage monitoring of your SAP NetWeaver application servers
Manage monitoring

Use the following steps to manage monitoring of your SAP NetWeaver application servers.

**To manage monitoring**

1. Open the [CloudWatch console](https://console.aws.amazon.com/cloudwatch).

1. From the left navigation pane, under **Insights**, select **Application Insights**.

1. Choose the **List view** tab.

1. The **Application Insights** page displays the list of applications that are monitored with Application Insights, and the monitoring status for each application.

1. Select your application.

1. Choose the **Components** tab.

1. Under **Monitored components**, select the radio button next to the component name. Then, select **Manage monitoring**.

1. Under **Instance logs**, you can update the existing log path, log pattern set, and log group name. In addition, you can add up to three additional **Application logs**.

1. Under **Metrics**, you can select the SAP NetWeaver metrics according to your requirements. SAP NetWeaver metric names are prefixed with `sap`. You can add up to 40 metrics per component.

1. Under **Custom alarms**, you can add additional alarms to be monitored by CloudWatch Application Insights.

1. Review your application monitoring configuration and choose **Save**. When you submit your configuration, your account updates all of the metrics and alarms for your SAP NetWeaver systems.

## View and troubleshoot SAP NetWeaver problems detected by CloudWatch Application Insights
Troubleshooting problems

The following sections provide steps to help you resolve common troubleshooting scenarios that occur when you configure monitoring for SAP NetWeaver on Application Insights.

**Topics**
+ [

### SAP NetWeaver database connectivity issues
](#appinsights-tutorial-sap-netweaver-troubleshooting-database)
+ [

### SAP NetWeaver application availability issues
](#appinsights-tutorial-sap-netweaver-troubleshooting-availability)

### SAP NetWeaver database connectivity issues
Database connectivity issues

**Description**  
Your SAP NetWeaver application experiences database connectivity issues.

**Cause**  
You can identify the connectivity issue by going to the CloudWatch Application Insights console and checking the SAP NetWeaver Application Insights problem dashboard. Select the link under **Problem summary** to see the specific issue.

![\[Detected problems dashboard for CloudWatch Application Insights with further information under the Detected problems section in the Problem summary column.\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/appinsights-nw-database-connectivity-1.png)


In the following example, under **Problem summary**, SAP: Availability is the issue.

![\[Problem summary page for CloudWatch Application Insights under the Problem summary section.\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/appinsights-nw-database-connectivity-2.png)


Immediately following the **Problem summary**, the **Insight** section provides more context about the error and where you can get more information about the causes of the issue.

![\[Problem insight for CloudWatch Application Insights with additional information about the cause of the error.\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/appinsights-nw-database-connectivity-3.png)


On the same problem dashboard, you can view related logs and metrics that problem detection has grouped together to help you isolate the cause of the error. The `sap_alerts_Availability` metric tracks the availability of the SAP NetWeaver system over time. You can use historical tracking to correlate when the metric initiated an error state or breached the alarm threshold. In the following example, there is an availability issue with the SAP NetWeaver system. The example shows two alarms because there are two SAP application server instances and an alarm was created for each instance.

![\[SAP Availability metric for CloudWatch Application Insights with additional information about the history of when the error occurred.\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/appinsights-nw-database-connectivity-4.png)


For more information about each alarm, hover over the `sap_alerts_Availability` metric name.

![\[SAP Availability metric for CloudWatch Application Insights with additional details about the error.\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/appinsights-nw-database-connectivity-5.png)


In the following example, the `sap_alerts_Database` metric shows that the database layer has an issue or a failure. This alarm indicates that SAP NetWeaver had issues connecting to or communicating with its database. 

![\[SAP Database metric for CloudWatch Application Insights with additional history about when the error occurred.\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/appinsights-nw-database-connectivity-6.png)


Since the database is a key resource for SAP NetWeaver, you may get many related alarms when the database has an issue or failure. In the following example, the `sap_alerts_FrontendResponseTime` and `sap_alerts_LongRunners` metrics are initiated because the database is not available.

![\[Additional SAP Database metrics for CloudWatch Application Insights created because of a database failure.\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/appinsights-nw-database-connectivity-7.png)


**Resolution**  
Application Insights monitors the detected problem hourly. If there are no new related log entries in your SAP NetWeaver log files, the older log entries will be treated as resolved. You must fix any error conditions related to the CloudWatch alarms. After the error conditions are fixed, the alarm is resolved when the alarms and logs are recovered. When all of the CloudWatch log errors and alarms are resolved, Application Insights stops detecting errors and the problem is automatically resolved within an hour. We recommend that you resolve all log error conditions and alarms so that you have the latest problems on the problem dashboard.

In the following example, the SAP Availability issue is resolved.

![\[CloudWatch Application Insights problem dashboard with SAP Availability issue resolved.\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/appinsights-nw-database-connectivity-resolved.png)


### SAP NetWeaver application availability issues
Application availability issues

**Description**  
Your SAP NetWeaver High Availability Enqueue replication stopped working.

**Cause**  
You can identify the connectivity issue by going to the CloudWatch Application Insights console and checking the SAP NetWeaver Application Insights problem dashboard. Select the link under **Problem summary** to see the specific issue.

![\[Problem dashboard in CloudWatch Application Insights with more information under Problem summary.\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/appinsights-nw-app-availability-problem-dashboard.png)


In the following example, under **Problem summary**, High Availability Enqueue Replication is the issue.

![\[Problem summary in CloudWatch Application Insights with SAP Availability: Enqueue replication error listed.\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/appinsights-nw-app-availability-1.png)


Immediately following the **Problem summary**, the **Insight** section provides more context about the error and where you can get more information about the causes of the issue.

![\[Problem insight for CloudWatch Application Insights with additional information about the cause of the error.\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/appinsights-nw-app-availability-2.png)


The following example shows the problem dashboard where you view logs and metrics which are grouped to help you isolate the causes of the error. The `sap_enqueue_server_replication_state` metric tracks the value over time. You can use historical tracking to correlate when the metric initiated an error state or breached the alarm threshold.

![\[Enqueue server replication state metric on the problem dashboard with additional information about when the error occurred.\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/appinsights-nw-app-availability-3.png)


In the following example, the `ha_cluster_pacemaker_fail_count` metric shows that the high availability pacemaker cluster experienced a resource failure. The specific pacemaker resources that had a fail count greater than or equal to one are identified in the component dashboard.

![\[Application availability metric for CloudWatch Application Insights for pacemaker resource with fail count greater than or equal to one.\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/appinsights-nw-app-availability-4.png)


The following example shows the `sap_alerts_Shortdumps` metric, which indicates that the SAP application performance was reduced when the problem was detected.

![\[Application availability alert Shortdumps metric for CloudWatch Application Insights.\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/appinsights-nw-app-availability-5.png)


#### Logs
Application availability issues

The log entries are helpful to get a better understanding of issues that occurred at the SAP NetWeaver layer when the problem was detected. The log group widget in the problem dashboard shows the specific time of the issue.

![\[Log entries for CloudWatch Application Insights showing the exact time issues occurred.\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/appinsights-nw-app-availability-7.png)


To see detailed information about the logs, select the three vertical dots in the upper-right corner, and select **View in CloudWatch Logs Insights**.

![\[CloudWatch Application Insights details with View in CloudWatch Logs Insights.\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/appinsights-nw-app-availability-8.png)


Use the following steps to get more information about the metrics and alarms displayed in the problem dashboard.

**To get more information about metrics and alarms**

1. Open the [CloudWatch console](https://console.aws.amazon.com/cloudwatch).

1. In the left navigation pane, under **Insights**, select **Application Insights**. Then, choose the **List view** tab, and select your application.

1. Select the **Components** tab. Then, select the SAP NetWeaver component about which you want to get more information.

   The following example shows the **HA Metrics** section with the `ha_cluster_pacemaker_fail_count` metric that was displayed in the problem dashboard.  
![\[HA Metrics for CloudWatch Application Insights showing the pacemaker resources fail count.\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/appinsights-nw-app-availability-9.png)

**Resolution**  
Application Insights monitors the detected problem hourly. If there are no new related log entries in your SAP NetWeaver log files, the older log entries will be treated as resolved. You must fix any error conditions related to this problem.

For the `sap_alerts_Shortdumps` alarm, you must resolve the alert in the SAP NetWeaver system by using transaction code `RZ20 → R3Abap → Shortdumps` to navigate to the CCMS alert. For more information about CCMS alerts, see the [SAP website.](https://help.sap.com/docs/SAP_NETWEAVER_701/6f45651d6c4b1014a50f9ef0fc8df39d/408dc4a7c415437a9b91d2ef6caa9d7d.html) Resolve all of the CCMS alerts in the Shortdumps tree. After all of the alerts are resolved in the SAP NetWeaver system, CloudWatch no longer reports the metric in an alarm state.

When all of the CloudWatch log errors and alarms are resolved, Application Insights stops detecting errors and the problem is automatically resolved within an hour. We recommend that you resolve all log error conditions and alarms so that you have the latest problems on the problem dashboard. In the following example, the SAP Netweaver High Availability Enqueue Replication problem is resolved.

![\[Problem dashboard for CloudWatch Application Insights showing the SAP Availability: Enqueue Replication problem with a Status of Resolved.\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/appinsights-nw-app-availability-problem-resolved.png)


## Troubleshooting Application Insights for SAP NetWeaver
Troubleshooting Application Insights

This section provides steps to help you resolve common errors returned by the Application Insights dashboard.

### Unable to add more than 60 monitor metrics


**Error returned**: `Component cannot have more than 60 monitored metrics.`

**Root cause**: `The current metric limit is 60 monitor metrics per component.`

**Resolution**: Remove metrics that are not necessary to adhere to the limit.

### SAP metrics do not appear on the dashboard after the onboarding process


**Root cause**: Component Dashboard uses a five minute metric period to aggregate the data points.

**Resolution**: All metrics should show up on the dashboard after five minutes.

### SAP metrics and alarms don't appear on the dashboard


Use the following steps to identify why SAP metrics and alarms don't appear on the dashboard after the onboarding process. 

**To identify the issue with metrics and alarms**

1. Open the [CloudWatch console](https://console.aws.amazon.com/cloudwatch).

1. In the left navigation pane, under **Insights**, select **Application Insights**. Then, choose the **List view** tab, and select your application.

1. Choose the **Configuration history** tab.

1. If you see missing metrics datapoints, check for errors related to `prometheus-sap_host_exporter`.

1. If you don't find an error in the previous step, [Connect to your Linux instance](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstances.html). For High Availability deployments, connect to the primary cluster Amazon EC2 instance.

1. In your instance, verify that the exporter is running by using the following command. The default port is `9680`. If you are using a different port, replace `9680` with the port you are using.

   ```
   curl localhost:9680/metrics
   ```

   If no data is returned, then the exporter failed to start.

1. To find the correct naming convention to use for `WORKLOAD_SHORT_NAME` in the next two steps, run the following command.
**Note**  
Application Insights adds a suffix, `WORKLOAD_SHORT_NAME`, to the service name depending on the workload that is running. The short names for NetWeaver Distributed, Standard, and High Availability deployments are `SAP_NWD`, `SAP_NWS`, and `SAP_NWH`.

   ```
   sudo systemctl | grep exporter
   ```

1. To check for errors in the exporter service logs, run the following command:

   ```
   sudo journalctl -e --unit=prometheus-sap_host_exporter_WORKLOAD_SHORT_NAME.service
   ```

1. To check for errors in the exporter manager service logs, run the following command:

   ```
   sudo journalctl -e --unit=prometheus-sap_host_exporter_manager_WORKLOAD_SHORT_NAME.service
   ```
**Note**  
This service should be up and running at all times.

   If this command does not return an error, continue to the next step.

1. To manually start the exporter, run the following command. Then, check the exporter output.

   ```
   sudo /opt/aws/sap_host_exporter/sap_host_exporter
   ```

   You can exit the exporter process after you check for errors.

**Root cause**: There are several possible causes for this issue. A common cause is that the exporter is not able to connect to one of the application server instances.

**Resolution**

Use the following steps to connect the exporter to the application server instances. You will verify that the SAP application instance is running and use SAPControl to connect to the instance.

**To connect the exporter to the application server instances**

1. In your Amazon EC2 instance, run the following command to verify that the SAP application is running. 

   ```
   sapcontrol -nr <App_InstNo> -function GetProcessList
   ```

1. You must establish a working SAPControl connection. If the SAPControl connection doesn't work, find the root cause of the issue on the relevant SAP application instance.

1. To manually start the exporter after you fix the SAP Control connection issue, run the following command:

   ```
   sudo systemctl start prometheus-sap_host_exporter.service
   ```

1. If you can't resolve the SAPControl connection issue, use the following procedure as a temporary fix. 

   1. Open the [AWS Systems Manager console](https://console.aws.amazon.com/systems-manager).

   1. From the left navigation pane, choose **State Manager**.

   1. Under **Associations** search for the SAP NetWeaver system's association.

      ```
      Association Name: Equal: AWS-ApplicationInsights-SSMSAPHostExporterAssociationForCUSTOMSAPNW<SID>-1
      ```

   1. Select the **Association id**.

   1. Choose the **Parameters** tab and remove the application server number from **additionalArguments**.

   1. Choose **Apply Association Now**.
**Note**  
This is a temporary fix. If updates are made to the component's monitoring configurations, the instance will be added back.

# View and troubleshoot problems detected by Amazon CloudWatch Application Insights
View and troubleshoot Application Insights

The topics in this section provide detailed information about the detected problems and insights displayed by Application Insights. It also provides suggested resolutions for detected issues with your account or your configuration.

**Topics**
+ [

## CloudWatch console overview
](#appinsights-troubleshooting-overview)
+ [

## Application Insights problem summary page
](#appinsights-troubleshooting-problem-summary)
+ [

## CloudWatch agent merge conflict failures
](#cwagent-merge-conflicts)
+ [

## High CPU usage from CloudWatch agent log processing
](#cwagent-high-cpu-usage)
+ [

## Alarms are not created
](#alarms-not-created)
+ [

## Feedback
](#appinsights-troubleshooting-feedback)
+ [

## Configuration errors
](#appinsights-configuration-errors)

## CloudWatch console overview


An overview of problems that impact your monitored applications can be found under the CloudWatch Application Insights pane in the overview page of the [CloudWatch console](https://console.aws.amazon.com/cloudwatch).

The CloudWatch Application Insights overview pane displays the following:
+ The severity of the problems detected: High/Medium/Low
+ A short summary of the problem
+ The problem source
+ The time the problem started
+ The resolution status of the problem
+ The affected resource group

To view the details of a specific problem, under **Problem Summary**, select the description of the problem. A detailed dashboard displays insights into the problem and related metric anomalies and snippets of log errors. You can provide feedback on the relevance of the insight by selecting whether it is useful.

If a new resource is detected that is not configured, the problem summary description takes you to the **Edit configuration** wizard to configure your new resource. You can view or edit your resource group configuration by choosing **View/edit configuration** in the upper right‐hand corner of the detailed dashboard.

To return to the overview, choose **Back to overview**, which is next to the CloudWatch Application Insights detailed dashboard header.

## Application Insights problem summary page


**Application Insights problem summary page**  
CloudWatch Application Insights provides the following information about detected problems on the problem summary page:
+ A short summary of the problem
+ The start time and date of the problem
+ The problem severity: High/Medium/Low
+ The status of the detected problem: In‐progress/Resolved
+ Insights: Automatically generated insights on the detected problem and possible root cause
+ Feedback on insights: Feedback you have provided about the usefulness of the insights generated by CloudWatch Application Insights
+ Related observations: A detailed view of the metric anomalies and error snippets of relevant logs related to the problem across various application components

## CloudWatch agent merge conflict failures


CloudWatch Application Insights installs and configures the CloudWatch agent on customer instances. This includes creation of a CloudWatch agent configuration file with configurations for metrics or logs. A merge conflict can occur if a customer's instance already has a CloudWatch agent configuration file with different configurations defined for the same metrics or logs. To resolve the merge conflict, use the following steps:

1. Identify the CloudWatch agent configuration files on your system. For more information about the file locations, see [CloudWatch agent files and locations](troubleshooting-CloudWatch-Agent.md#CloudWatch-Agent-files-and-locations).

1. Remove the resource configurations that you want to use in Application Insights from the existing CloudWatch agent configuration file. If you want to only use Application Insights configurations, delete the existing CloudWatch agent configuration files.

## High CPU usage from CloudWatch agent log processing


CloudWatch Application Insights installs and configures the CloudWatch agent on customer instances. If an Amazon EC2 instance is configured with log paths that have large amounts of log data, the instance might experience increases in CPU usage while the CloudWatch agent processes the logs. To reduce CPU usage, remove the log path in the [Amazon EC2 instance component configuration](component-configuration-examples-ec2.md).

## Alarms are not created


For some metrics, Application Insights predicts the alarm threshold based on previous data points for the metric. To enable this prediction, the following criteria must be met.
+ **Recent data points** – There must be a minimum of 100 data points from the last 24 hours. The data points don't need to be continuous and can be scattered throughout the 24 hour time frame. 
+ **Historical data** – There must be a minimum of 100 data points spanning the time frame from 15 days before the current date to 1 day before the current date. The data points don't need to be continuous and can be scattered throughout the 15 day time frame. 

**Note**  
For some metrics, Application Insights delays the creation of alarms until the preceding conditions are met. In this case, you get a configuration history event that the metric lacks sufficient data points to establish the alarm threshold.

## Feedback


**Feedback**

You can provide feedback on the automatically generated insights on detected problems by designating them useful or not useful. Your feedback on the insights, along with your application diagnostics (metric anomalies and log exceptions), are used to improve the future detection of similar problems.

## Configuration errors


CloudWatch Application Insights uses your configuration to create monitoring telemetries for the components. When Application Insights detects an issue with your account or your configuration, information is provided in the **Remarks** field of the Application summary about how to resolve the configuration issue for your application. 

The following table shows suggested resolutions for specific remarks.


| Remarks | Suggested resolution | Additional notes  | 
| --- | --- | --- | 
|  The quota for CloudFormation has already been reached.  |  Application Insights creates one CloudFormation stack for each application to manage CloudWatch agent installation and configuration for all application components. By default, each AWS account can have 2000 stacks. See [CloudFormation Limits](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html). To resolve this, raise the limit for CloudFormation stacks.  | n/a | 
|  No SSM instance role on the following instances.  |  For Application Insights to be able to install and configure CloudWatch agent on application instances, AmazonSSMManagedInstanceCore and CloudWatchAgentServerPolicy policies must be attached to the instance role.   |  Application Insights calls the SSM [DescribeInstanceInformation API](https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_DescribeInstanceInformation.html) to get the list of instances with SSM permission. After the role is attached to the instance, it takes time for SSM to include the instance in the DescribeInstanceInformation result. Until SSM includes the instance in the result, NO\$1SSM\$1INSTANCE\$1ROLE error remains present for the application.  | 
|  New components may need configuration.  |  Application Insights detects that there are new components in the application Resource Group. To resolve this, configure the new components accordingly.  | n/a | 

# Logs and metrics supported by Amazon CloudWatch Application Insights
Supported logs and metrics

The following lists show the supported logs and metrics for Amazon CloudWatch Application Insights. 

**CloudWatch Application Insights supports the following logs:**
+ Microsoft Internet Information Services (IIS) logs
+ Error log for SQL Server on EC2
+ Custom .NET application logs, such as Log4Net
+ Windows Event logs, including Windows logs (System, Application, and Security) and Applications and Services log
+ Amazon CloudWatch Logs for AWS Lambda
+ Error log and slow log for RDS MySQL, Aurora MySQL, and MySQL on EC2
+ Postgresql log for PostgreSQL RDS and PostgreSQL on EC2
+ Amazon CloudWatch Logs for AWS Step Functions
+ Execution logs and access logs (JSON, CSV, and XML, but not CLF) for API Gateway REST API stages
+ Prometheus JMX exporter logs (EMF)
+ Alert logs and listener logs for Oracle on Amazon RDS and Oracle on Amazon EC2
+ Container logs routing from Amazon ECS containers to CloudWatch using [`awslogs` log driver](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_awslogs.html).
+ Container logs routing from Amazon ECS containers to CloudWatch using [FireLens container log router](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_firelens.html).
+ Container logs routing from Amazon EKS or Kubernetes running on Amazon EC2 to CloudWatch using [Fluent Bit or Fluentd log processor](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Container-Insights-EKS-logs.html) with Container Insights.
+ SAP HANA trace and error logs
+ HA Pacemaker logs
+ SAP ASE server logs
+ SAP ASE backup server logs
+ SAP ASE Replication server logs
+ SAP ASE RMA agent logs
+ SAP ASE Fault Manager logs
+ SAP NetWeaver dev trace logs
+ Process metrics for Windows processes using [proctstat plugin for CloudWatch agent](CloudWatch-Agent-procstat-process-metrics.md)
+ Public DNS query logs for hosted zone
+ Amazon Route 53 Resolver DNS query logs

**CloudWatch Application Insights supports the following log classes:**
+ **Standard** – Amazon CloudWatch Application Insights requires that log groups are configured with the [CloudWatch Logs Standard log class](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch_Logs_Log_Classes.html) to enable monitoring.

**Contents**
+ [

# Amazon Elastic Compute Cloud (EC2)
](appinsights-metrics-ec2.md)
  + [

## CloudWatch built-in metrics
](appinsights-metrics-ec2.md#appinsights-metrics-ec2-built-in)
  + [

## CloudWatch agent metrics (Windows server)
](appinsights-metrics-ec2.md#appinsights-metrics-ec2-windows)
  + [

## CloudWatch agent process metrics (Windows server)
](appinsights-metrics-ec2.md#appinsights-metrics-procstat-ec2-windows)
  + [

## CloudWatch agent metrics (Linux server)
](appinsights-metrics-ec2.md#appinsights-metrics-ec2-linux)
+ [

# Elastic Block Store (EBS)
](appinsights-metrics-ebs.md)
+ [

# Amazon Elastic File System (Amazon EFS)
](appinsights-metrics-efs.md)
+ [

# Elastic Load Balancer (ELB)
](appinsights-metrics-elb.md)
+ [

# Application ELB
](appinsights-metrics-app-elb.md)
+ [

# Amazon EC2 Auto Scaling groups
](appinsights-metrics-as.md)
+ [

# Amazon Simple Queue Server (SQS)
](appinsights-metrics-sqs.md)
+ [

# Amazon Relational Database Service (RDS)
](appinsights-metrics-rds.md)
  + [

## RDS Database instances
](appinsights-metrics-rds.md#appinsights-metrics-rds-instances)
  + [

## RDS Database clusters
](appinsights-metrics-rds.md#appinsights-metrics-rds-clusters)
+ [

# AWS Lambda function
](appinsights-metrics-lambda.md)
+ [

# Amazon DynamoDB table
](appinsights-metrics-dyanamodb.md)
+ [

# Amazon S3 bucket
](appinsights-metrics-s3.md)
+ [

# AWS Step Functions
](appinsights-metrics-step-functions.md)
  + [

## Execution-level
](appinsights-metrics-step-functions.md#appinsights-metrics-step-functions-execution)
  + [

## Activity
](appinsights-metrics-step-functions.md#appinsights-metrics-step-functions-activity)
  + [

## Lambda function
](appinsights-metrics-step-functions.md#appinsights-metrics-step-functions-lambda)
  + [

## Service integration
](appinsights-metrics-step-functions.md#appinsights-metrics-step-functions-service-integration)
  + [

## Step Functions API
](appinsights-metrics-step-functions.md#appinsights-metrics-step-functions-api)
+ [

# API Gateway REST API stages
](appinsights-metrics-api-gateway.md)
+ [

# SAP HANA
](appinsights-metrics-sap-hana.md)
+ [

# SAP ASE
](appinsights-metrics-sap-ase.md)
+ [

# SAP ASE High Availability on Amazon EC2
](appinsights-metrics-sap-ase-ha.md)
+ [

# SAP NetWeaver
](appinsights-metrics-sap-netweaver.md)
+ [

# HA Cluster
](appinsights-metrics-ha-cluster.md)
+ [

# Java
](appinsights-metrics-java.md)
+ [

# Amazon Elastic Container Service (Amazon ECS)
](appinsights-metrics-ecs.md)
  + [

## CloudWatch built-in metrics
](appinsights-metrics-ecs.md#appinsights-metrics-ecs-built-in-metrics)
  + [

## Container Insights metrics
](appinsights-metrics-ecs.md#appinsights-metrics-ecs-container-insights-metrics)
  + [

## Container Insights Prometheus metrics
](appinsights-metrics-ecs.md#appinsights-metrics-ecs-container-insights-prometheus)
+ [

# Kubernetes on AWS
](appinsights-metrics-kubernetes.md)
  + [

## Container Insights metrics
](appinsights-metrics-kubernetes.md#appinsights-metrics-kubernetes-container-insights-metrics)
  + [

## Container Insights Prometheus metrics
](appinsights-metrics-kubernetes.md#appinsights-metrics-kubernetes-container-insights-prometheus)
+ [

# Amazon FSx
](appinsights-metrics-fsx.md)
+ [

# Amazon VPC
](appinsights-metrics-vpc.md)
+ [

# Amazon VPC NAT gateways
](appinsights-metrics-nat-gateways.md)
+ [

# Amazon Route 53 health check
](appinsights-metrics-health-check.md)
+ [

# Amazon Route 53 hosted zone
](appinsights-metrics-hosted-zone.md)
+ [

# Amazon Route 53 Resolver endpoint
](appinsights-metrics-resolver-endpoint.md)
+ [

# AWS Network Firewall rule group
](appinsights-metrics-firewall-rule-group.md)
+ [

# AWS Network Firewall rule group association
](appinsights-metrics-firewall-rule-group-assoc.md)
+ [

# Metrics with data points requirements
](appinsights-metrics-datapoint-requirements.md)
  + [

## AWS/ApplicationELB
](appinsights-metrics-datapoint-requirements.md#appinsights-metrics-datapoint-requirements-app-elb)
  + [

## AWS/AutoScaling
](appinsights-metrics-datapoint-requirements.md#appinsights-metrics-datapoint-requirements-autoscaling)
  + [

## AWS/EC2
](appinsights-metrics-datapoint-requirements.md#appinsights-metrics-datapoint-requirements-ec2)
  + [

## Elastic Block Store (EBS)
](appinsights-metrics-datapoint-requirements.md#appinsights-metrics-datapoint-requirements-ebs)
  + [

## AWS/ELB
](appinsights-metrics-datapoint-requirements.md#appinsights-metrics-datapoint-requirements-elb)
  + [

## AWS/RDS
](appinsights-metrics-datapoint-requirements.md#appinsights-metrics-datapoint-requirements-rds)
  + [

## AWS/Lambda
](appinsights-metrics-datapoint-requirements.md#appinsights-metrics-datapoint-requirements-lambda)
  + [

## AWS/SQS
](appinsights-metrics-datapoint-requirements.md#appinsights-metrics-datapoint-requirements-sqs)
  + [

## AWS/CWAgent
](appinsights-metrics-datapoint-requirements.md#appinsights-metrics-datapoint-requirements-cwagent)
  + [

## AWS/DynamoDB
](appinsights-metrics-datapoint-requirements.md#appinsights-metrics-datapoint-requirements-dynamo)
  + [

## AWS/S3
](appinsights-metrics-datapoint-requirements.md#appinsights-metrics-datapoint-requirements-s3)
  + [

## AWS/States
](appinsights-metrics-datapoint-requirements.md#appinsights-metrics-datapoint-requirements-states)
  + [

## AWS/ApiGateway
](appinsights-metrics-datapoint-requirements.md#appinsights-metrics-datapoint-requirements-api-gateway)
  + [

## AWS/SNS
](appinsights-metrics-datapoint-requirements.md#appinsights-metrics-datapoint-requirements-sns)
+ [

# Recommended metrics
](application-insights-recommended-metrics.md)
+ [

# Performance Counter metrics
](application-insights-performance-counter.md)

# Amazon Elastic Compute Cloud (EC2)


CloudWatch Application Insights supports the following metrics:

**Topics**
+ [

## CloudWatch built-in metrics
](#appinsights-metrics-ec2-built-in)
+ [

## CloudWatch agent metrics (Windows server)
](#appinsights-metrics-ec2-windows)
+ [

## CloudWatch agent process metrics (Windows server)
](#appinsights-metrics-procstat-ec2-windows)
+ [

## CloudWatch agent metrics (Linux server)
](#appinsights-metrics-ec2-linux)

## CloudWatch built-in metrics


CPUCreditBalance

CPUCreditUsage

CPUSurplusCreditBalance

CPUSurplusCreditsCharged

CPUUtilization

DiskReadBytes

DiskReadOps

DiskWriteBytes

DiskWriteOps

EBSByteBalance%

EBSIOBalance%

EBSReadBytes

EBSReadOps

EBSWriteBytes

EBSWriteOps

NetworkIn

NetworkOut

NetworkPacketsIn

NetworkPacketsOut

StatusCheckFailed

StatusCheckFailed\$1Instance

StatusCheckFailed\$1System

## CloudWatch agent metrics (Windows server)


.NET CLR Exceptions \$1 of Exceps Thrown

.NET CLR Exceptions \$1 of Exceps Thrown/Sec

.NET CLR Exceptions \$1 of Filters/sec

.NET CLR Exceptions \$1 of Finallys/sec

.NET CLR Exceptions Throw to Catch Depth/sec

.NET CLR Interop \$1 of CCWs

.NET CLR Interop \$1 of Stubs

.NET CLR Interop \$1 of TLB exports/sec

.NET CLR Interop \$1 of TLB imports/sec

.NET CLR Interop \$1 of marshaling

.NET CLR Jit % Time in Jit

.NET CLR Jit Standard Jit Failures

.NET CLR Loading % Time Loading

.NET CLR Loading Rate of Load Failures

.NET CLR LocksAndThreads Contention Rate/sec

.NET CLR LocksAndThreads Queue Length/sec

.NET CLR Memory \$1 Total Committed Bytes

.NET CLR Memory % Time in GC

.NET CLR Networking 4.0.0.0 HttpWebRequest Average Queue Time

.NET CLR Networking 4.0.0.0 HttpWebRequests Aborted/sec

.NET CLR Networking 4.0.0.0 HttpWebRequests Failed/sec

.NET CLR Networking 4.0.0.0 HttpWebRequests Queued/sec

APP\$1POOL\$1WAS Total Worker Process Ping Failures

ASP.NET Application Restarts

ASP.NET Applications % Managed Processor Time (estimated)

ASP.NET Applications Errors Total/Sec

ASP.NET Applications Errors Unhandled During Execution/sec

ASP.NET Applications Requests in Application Queue

ASP.NET Applications Requests/Sec

ASP.NET Request Wait Time

ASP.NET Requests Queued

HTTP Service Request Queues CurrentQueueSize

LogicalDisk % Free Space

Memory % Committed Bytes In Use

Memory Available Mbytes

Memory Pages/sec

Network Interface Bytes Total/sec

Paging File % Usage

PhysicalDisk % Disk Time

PhysicalDisk Avg. Disk Queue Length

PhysicalDisk Avg. Disk sec/Read

PhysicalDisk Avg. Disk sec/Write

PhysicalDisk Disk Read Bytes/sec

PhysicalDisk Disk Reads/sec

PhysicalDisk Disk Write Bytes/sec

PhysicalDisk Disk Writes/sec

Processor % Idle Time

Processor % Interrupt Time

Processor % Processor Time

Processor % User Time

SQLServer:Access Methods Forwarded Records/sec

SQLServer:Access Methods Full Scans/sec

SQLServer:Access Methods Page Splits/sec

SQLServer:Buffer Manager Buffer cache hit ratio

SQLServer:Buffer Manager Page life expectancy

SQLServer:General Statistics Processes blocked

SQLServer:General Statistics User Connections

SQLServer:Latches Average Latch Wait Time (ms)

SQLServer:Locks Average Wait Time (ms)

SQLServer:Locks Lock Timeouts/sec

SQLServer:Locks Lock Waits/sec

SQLServer:Locks Number of Deadlocks/sec

SQLServer:Memory Manager Memory Grants Pending

SQLServer:SQL Statistics Batch Requests/sec

SQLServer:SQL Statistics SQL Compilations/sec

SQLServer:SQL Statistics SQL Re-Compilations/sec

System Processor Queue Length

TCPv4 Connections Established

TCPv6 Connections Established

W3SVC\$1W3WP File Cache Flushes

W3SVC\$1W3WP File Cache Misses

W3SVC\$1W3WP Requests/Sec

W3SVC\$1W3WP URI Cache Flushes

W3SVC\$1W3WP URI Cache Misses

Web Service Bytes Received/Sec

Web Service Bytes Sent/Sec

Web Service Connection attempts/sec

Web Service Current Connections

Web Service Get Requests/sec

Web Service Post Requests/sec

Bytes Received/sec

Normal Messages Queue Length/sec

Urgent Message Queue Length/sec

Reconnect Count

Unacknowledged Message Queue Length/sec

Messages Outstanding

Messages Sent/sec

Database Update Messages/sec

Update Messages/sec

Flushes/sec

Crypto Checkpoints Saved/sec

Crypto Checkpoints Restored/sec

Registry Checkpoints Restored/sec

Registry Checkpoints Saved/sec

Cluster API Calls/sec

Resource API Calls/sec

Cluster Handles/sec

Resource Handles/sec

## CloudWatch agent process metrics (Windows server)


Process metrics are collected using the [CloudWatch agent procstat plugin](CloudWatch-Agent-procstat-process-metrics.md). Only Amazon EC2 instances running Windows workloads support process metrics.

procstat cpu\$1time\$1system

procstat cpu\$1time\$1user

procstat cpu\$1usage

procstat memory\$1rss

procstat memory\$1vms

procstat read\$1bytes

procstat write\$1bytes

.procstat read\$1count

procstat write\$1count

## CloudWatch agent metrics (Linux server)


cpu\$1time\$1active

cpu\$1time\$1guest

cpu\$1time\$1guest\$1nice

cpu\$1time\$1idle

cpu\$1time\$1iowait

cpu\$1time\$1irq

cpu\$1time\$1nice

cpu\$1time\$1softirq

cpu\$1time\$1steal

cpu\$1time\$1system

cpu\$1time\$1user

cpu\$1usage\$1active

cpu\$1usage\$1guest

cpu\$1usage\$1guest\$1nice

cpu\$1usage\$1idle

cpu\$1usage\$1iowait

cpu\$1usage\$1irq

cpu\$1usage\$1nice

cpu\$1usage\$1softirq

cpu\$1usage\$1steal

cpu\$1usage\$1system

cpu\$1usage\$1user

disk\$1free

disk\$1inodes\$1free

disk\$1inodes\$1used

disk\$1used

disk\$1used\$1percent

diskio\$1io\$1time

diskio\$1iops\$1in\$1progress

diskio\$1read\$1bytes

diskio\$1read\$1time

diskio\$1reads

diskio\$1write\$1bytes

diskio\$1write\$1time

diskio\$1writes

mem\$1active

mem\$1available

mem\$1available\$1percent

mem\$1buffered

mem\$1cached

mem\$1free

mem\$1inactive

mem\$1used

mem\$1used\$1percent

net\$1bytes\$1recv

net\$1bytes\$1sent

net\$1drop\$1in

net\$1drop\$1out

net\$1err\$1in

net\$1err\$1out

net\$1packets\$1recv

net\$1packets\$1sent

netstat\$1tcp\$1close

netstat\$1tcp\$1close\$1wait

netstat\$1tcp\$1closing

netstat\$1tcp\$1established

netstat\$1tcp\$1fin\$1wait1

netstat\$1tcp\$1fin\$1wait2

netstat\$1tcp\$1last\$1ack

netstat\$1tcp\$1listen

netstat\$1tcp\$1none

netstat\$1tcp\$1syn\$1recv

netstat\$1tcp\$1syn\$1sent

netstat\$1tcp\$1time\$1wait

netstat\$1udp\$1socket

processes\$1blocked

processes\$1dead

processes\$1idle

processes\$1paging

processes\$1running

processes\$1sleeping

processes\$1stopped

processes\$1total

processes\$1total\$1threads

processes\$1wait

processes\$1zombies

swap\$1free

swap\$1used

swap\$1used\$1percent

# Elastic Block Store (EBS)


CloudWatch Application Insights supports the following metrics:

VolumeReadBytes

VolumeWriteBytes

VolumeReadOps

VolumeWriteOps

VolumeTotalReadTime 

VolumeTotalWriteTime 

VolumeIdleTime

VolumeQueueLength

VolumeThroughputPercentage

VolumeConsumedReadWriteOps

BurstBalance

# Amazon Elastic File System (Amazon EFS)


CloudWatch Application Insights supports the following metrics:

BurstCreditBalance

PercentIOLimit

PermittedThroughput

MeteredIOBytes

TotalIOBytes

DataWriteIOBytes

DataReadIOBytes

MetadataIOBytes

ClientConnections

TimeSinceLastSync

StorageBytes

Throughput

PercentageOfPermittedThroughputUtilization

ThroughputIOPS

 PercentThroughputDataReadIOByte

PercentThroughputDataWriteIOBytes

PercentageOfIOPSDataReadIOBytes

PercentageOfIOPSDataWriteIOBytes

AverageDataReadIOBytesSize

AverageDataWriteIOBytesSize

# Elastic Load Balancer (ELB)


CloudWatch Application Insights supports the following metrics:

EstimatedALBActiveConnectionCount

EstimatedALBConsumedLCUs

EstimatedALBNewConnectionCount

EstimatedProcessedBytes

HTTPCode\$1Backend\$14XX

HTTPCode\$1Backend\$15XX

HealthyHostCount

RequestCount

UnHealthyHostCount

# Application ELB


CloudWatch Application Insights supports the following metrics:

EstimatedALBActiveConnectionCount

EstimatedALBConsumedLCUs

EstimatedALBNewConnectionCount

EstimatedProcessedBytes

HTTPCode\$1Backend\$14XX

HTTPCode\$1Backend\$15XX

HealthyHostCount

Latency

RequestCount

SurgeQueueLength

UnHealthyHostCount

# Amazon EC2 Auto Scaling groups


CloudWatch Application Insights supports the following metrics:

CPUCreditBalance

CPUCreditUsage

CPUSurplusCreditBalance

CPUSurplusCreditsCharged

CPUUtilization

DiskReadBytes

DiskReadOps

DiskWriteBytes

DiskWriteOps

EBSByteBalance%

EBSIOBalance%

EBSReadBytes

EBSReadOps

EBSWriteBytes

EBSWriteOps

NetworkIn

NetworkOut

NetworkPacketsIn

NetworkPacketsOut

StatusCheckFailed

StatusCheckFailed\$1Instance

StatusCheckFailed\$1System

# Amazon Simple Queue Server (SQS)


CloudWatch Application Insights supports the following metrics:

ApproximateAgeOfOldestMessage

ApproximateNumberOfMessagesDelayed

ApproximateNumberOfMessagesNotVisible

ApproximateNumberOfMessagesVisible

NumberOfEmptyReceives

NumberOfMessagesDeleted

NumberOfMessagesReceived

NumberOfMessagesSent

# Amazon Relational Database Service (RDS)


CloudWatch Application Insights supports the following metrics:

**Topics**
+ [

## RDS Database instances
](#appinsights-metrics-rds-instances)
+ [

## RDS Database clusters
](#appinsights-metrics-rds-clusters)

## RDS Database instances


BurstBalance

CPUCreditBalance

CPUUtilization

DatabaseConnections

DiskQueueDepth

FailedSQLServerAgentJobsCount

FreeStorageSpace

FreeableMemory

NetworkReceiveThroughput

NetworkTransmitThroughput

ReadIOPS

ReadLatency

ReadThroughput

WriteIOPS

WriteLatency

WriteThroughput

## RDS Database clusters


ActiveTransactions

AuroraBinlogReplicaLag

AuroraReplicaLag

BackupRetentionPeriodStorageUsed

BinLogDiskUsage

BlockedTransactions

BufferCacheHitRatio

CPUUtilization

CommitLatency

CommitThroughput

DDLLatency

DDLThroughput

DMLLatency

DMLThroughput

DatabaseConnections

Deadlocks

DeleteLatency

DeleteThroughput

EngineUptime

FreeLocalStorage

FreeableMemory

InsertLatency

InsertThroughput

LoginFailures

NetworkReceiveThroughput

NetworkThroughput

NetworkTransmitThroughput

Queries

ResultSetCacheHitRatio

SelectLatency

SelectThroughput

SnapshotStorageUsed

TotalBackupStorageBilled

UpdateLatency

UpdateThroughput

VolumeBytesUsed

VolumeReadIOPs

VolumeWriteIOPs

# AWS Lambda function


CloudWatch Application Insights supports the following metrics:

Errors

DeadLetterErrors

Duration

Throttles

IteratorAge

ProvisionedConcurrencySpilloverInvocations

# Amazon DynamoDB table


CloudWatch Application Insights supports the following metrics:

SystemErrors

UserErrors

ConsumedReadCapacityUnits

ConsumedWriteCapacityUnits

ReadThrottleEvents

WriteThrottleEvents

TimeToLiveDeletedItemCount

ConditionalCheckFailedRequests

TransactionConflict

ReturnedRecordsCount

PendingReplicationCount

ReplicationLatency

# Amazon S3 bucket


CloudWatch Application Insights supports the following metrics:

ReplicationLatency

BytesPendingReplication

OperationsPendingReplication

4xxErrors

5xxErrors

AllRequests

GetRequests

PutRequests

DeleteRequests

HeadRequests

PostRequests

SelectRequests

ListRequests

SelectScannedBytes

SelectReturnedBytes

FirstByteLatency

TotalRequestLatency

BytesDownloaded

BytesUploaded

# AWS Step Functions


CloudWatch Application Insights supports the following metrics:

**Topics**
+ [

## Execution-level
](#appinsights-metrics-step-functions-execution)
+ [

## Activity
](#appinsights-metrics-step-functions-activity)
+ [

## Lambda function
](#appinsights-metrics-step-functions-lambda)
+ [

## Service integration
](#appinsights-metrics-step-functions-service-integration)
+ [

## Step Functions API
](#appinsights-metrics-step-functions-api)

## Execution-level


ExecutionTime

ExecutionThrottled

ExecutionsFailed

ExecutionsTimedOut

ExecutionsAborted

ExecutionsSucceeded

ExecutionsStarted

## Activity


ActivityRunTime

ActivityScheduleTime

ActivityTime

ActivitiesFailed

ActivitiesHeartbeatTimedOut

ActivitiesTimedOut

ActivitiesScheduled

ActivitiesSucceeded

ActivitiesStarted

## Lambda function


LambdaFunctionRunTime

LambdaFunctionScheduleTime

LambdaFunctionTime

LambdaFunctionsFailed

LambdaFunctionsTimedOut

LambdaFunctionsScheduled

LambdaFunctionsSucceeded

LambdaFunctionsStarted

## Service integration


ServiceIntegrationRunTime

ServiceIntegrationScheduleTime

ServiceIntegrationTime

ServiceIntegrationsFailed

ServiceIntegrationsTimedOut

ServiceIntegrationsScheduled

ServiceIntegrationsSucceeded

ServiceIntegrationsStarted

## Step Functions API


ThrottledEvents

ProvisionedBucketSize

ProvisionedRefillRate

ConsumedCapacity

# API Gateway REST API stages


CloudWatch Application Insights supports the following metrics:

4XXError

5XXError

IntegrationLatency

Latency

CacheHitCount

CacheMissCount

# SAP HANA


**Note**  
CloudWatch Application Insights supports only single SID HANA environments. If multiple HANA SIDs are attached, monitoring will be set up for only the first detected SID.

CloudWatch Application Insights supports the following metrics:

hanadb\$1every\$1service\$1started\$1status

hanadb\$1daemon\$1service\$1started\$1status

hanadb\$1preprocessor\$1service\$1started\$1status

hanadb\$1webdispatcher\$1service\$1started\$1status

hanadb\$1compileserver\$1service\$1started\$1status

hanadb\$1nameserver\$1service\$1started\$1status

hanadb\$1server\$1startup\$1time\$1variations\$1seconds

hanadb\$1level\$15\$1alerts\$1count

hanadb\$1level\$14\$1alerts\$1count

hanadb\$1out\$1of\$1memory\$1events\$1count

hanadb\$1max\$1trigger\$1read\$1ratio\$1percent

hanadb\$1max\$1trigger\$1write\$1ratio\$1percent

hanadb\$1log\$1switch\$1wait\$1ratio\$1percent

hanadb\$1log\$1switch\$1race\$1ratio\$1percent

hanadb\$1time\$1since\$1last\$1savepoint\$1seconds

hanadb\$1disk\$1usage\$1highlevel\$1percent

hanadb\$1max\$1converter\$1page\$1number\$1count

hanadb\$1long\$1running\$1savepoints\$1count

hanadb\$1failed\$1io\$1reads\$1count

hanadb\$1failed\$1io\$1writes\$1count

hanadb\$1disk\$1data\$1unused\$1percent

hanadb\$1current\$1allocation\$1limit\$1used\$1percent

hanadb\$1table\$1allocation\$1limit\$1used\$1percent

hanadb\$1host\$1total\$1physical\$1memory\$1mb

hanadb\$1host\$1physical\$1memory\$1used\$1mb

hanadb\$1host\$1physical\$1memory\$1free\$1mb

hanadb\$1swap\$1memory\$1free\$1mb

hanadb\$1swap\$1memory\$1used\$1mb

hanadb\$1host\$1allocation\$1limit\$1mb

hanadb\$1host\$1total\$1memory\$1used\$1mb

 hanadb\$1host\$1total\$1peak\$1memory\$1used\$1mb

hanadb\$1host\$1total\$1allocation\$1limit\$1mb

hanadb\$1host\$1code\$1size\$1mb

hanadb\$1host\$1shared\$1memory\$1allocation\$1mb

hanadb\$1cpu\$1usage\$1percent

hanadb\$1cpu\$1user\$1percent

hanadb\$1cpu\$1system\$1percent

hanadb\$1cpu\$1waitio\$1percent

hanadb\$1cpu\$1busy\$1percent

hanadb\$1cpu\$1idle\$1percent

hanadb\$1long\$1delta\$1merge\$1count

hanadb\$1unsuccessful\$1delta\$1merge\$1count

hanadb\$1successful\$1delta\$1merge\$1count

hanadb\$1row\$1store\$1allocated\$1size\$1mb

hanadb\$1row\$1store\$1free\$1size\$1mb

hanadb\$1row\$1store\$1used\$1size\$1mb

hanadb\$1temporary\$1tables\$1count

hanadb\$1large\$1non\$1compressed\$1tables\$1count

hanadb\$1total\$1non\$1compressed\$1tables\$1count

hanadb\$1longest\$1running\$1job\$1seconds

hanadb\$1average\$1commit\$1time\$1milliseconds

hanadb\$1suspended\$1sql\$1statements\$1count

hanadb\$1plan\$1cache\$1hit\$1ratio\$1percent

hanadb\$1plan\$1cache\$1lookup\$1count

hanadb\$1plan\$1cache\$1hit\$1count

hanadb\$1plan\$1cache\$1total\$1execution\$1microseconds

hanadb\$1plan\$1cache\$1cursor\$1duration\$1microseconds

hanadb\$1plan\$1cache\$1preparation\$1microseconds

hanadb\$1plan\$1cache\$1evicted\$1count

hanadb\$1plan\$1cache\$1evicted\$1microseconds

hanadb\$1plan\$1cache\$1evicted\$1preparation\$1count

hanadb\$1plan\$1cache\$1evicted\$1execution\$1count

hanadb\$1plan\$1cache\$1evicted\$1preparation\$1microseconds

hanadb\$1plan\$1cache\$1evicted\$1cursor\$1duration\$1microseconds

hanadb\$1plan\$1cache\$1evicted\$1total\$1execution\$1microseconds

hanadb\$1plan\$1cache\$1evicted\$1plan\$1size\$1mb

hanadb\$1plan\$1cache\$1count

hanadb\$1plan\$1cache\$1preparation\$1count

hanadb\$1plan\$1cache\$1execution\$1count

hanadb\$1network\$1collision\$1rate

hanadb\$1network\$1receive\$1rate

hanadb\$1network\$1transmit\$1rate

hanadb\$1network\$1packet\$1receive\$1rate

hanadb\$1network\$1packet\$1transmit\$1rate

hanadb\$1network\$1transmit\$1error\$1rate

hanadb\$1network\$1receive\$1error\$1rate

hanadb\$1time\$1until\$1license\$1expires\$1days

hanadb\$1is\$1license\$1valid\$1status

hanadb\$1local\$1running\$1connections\$1count

hanadb\$1local\$1idle\$1connections\$1count

hanadb\$1remote\$1running\$1connections\$1count

hanadb\$1remote\$1idle\$1connections\$1count

hanadb\$1last\$1full\$1data\$1backup\$1age\$1days

hanadb\$1last\$1data\$1backup\$1age\$1days

hanadb\$1last\$1log\$1backup\$1age\$1hours

hanadb\$1failed\$1data\$1backup\$1past\$17\$1days\$1count

hanadb\$1failed\$1log\$1backup\$1past\$17\$1days\$1count

hanadb\$1oldest\$1backup\$1in\$1catalog\$1age\$1days

hanadb\$1backup\$1catalog\$1size\$1mb

hanadb\$1hsr\$1replication\$1status

hanadb\$1hsr\$1log\$1shipping\$1delay\$1seconds

hanadb\$1hsr\$1secondary\$1failover\$1count

hanadb\$1hsr\$1secondary\$1reconnect\$1count

hanadb\$1hsr\$1async\$1buffer\$1used\$1mb

hanadb\$1hsr\$1secondary\$1active\$1status

hanadb\$1handle\$1count

hanadb\$1ping\$1time\$1milliseconds

hanadb\$1connection\$1count

hanadb\$1internal\$1connection\$1count

hanadb\$1external\$1connection\$1count

hanadb\$1idle\$1connection\$1count

hanadb\$1transaction\$1count

hanadb\$1internal\$1transaction\$1count

hanadb\$1external\$1transaction\$1count

hanadb\$1user\$1transaction\$1count

hanadb\$1blocked\$1transaction\$1count

hanadb\$1statement\$1count

hanadb\$1active\$1commit\$1id\$1range\$1count

hanadb\$1mvcc\$1version\$1count

hanadb\$1pending\$1session\$1count

hanadb\$1record\$1lock\$1count

hanadb\$1read\$1count

hanadb\$1write\$1count

hanadb\$1merge\$1count

hanadb\$1unload\$1count

hanadb\$1active\$1thread\$1count

hanadb\$1waiting\$1thread\$1count

hanadb\$1total\$1thread\$1count

hanadb\$1active\$1sql\$1executor\$1count

hanadb\$1waiting\$1sql\$1executor\$1count

hanadb\$1total\$1sql\$1executor\$1count

hanadb\$1data\$1write\$1size\$1mb

hanadb\$1data\$1write\$1time\$1milliseconds

hanadb\$1log\$1write\$1size\$1mb

hanadb\$1log\$1write\$1time\$1milliseconds

hanadb\$1data\$1read\$1size\$1mb

hanadb\$1data\$1read\$1time\$1milliseconds

hanadb\$1log\$1read\$1size\$1mb

hanadb\$1log\$1read\$1time\$1milliseconds

hanadb\$1data\$1backup\$1write\$1size\$1mb

hanadb\$1data\$1backup\$1write\$1time\$1milliseconds

hanadb\$1log\$1backup\$1write\$1size\$1mb

hanadb\$1log\$1backup\$1write\$1time\$1milliseconds

hanadb\$1mutex\$1collision\$1count

hanadb\$1read\$1write\$1lock\$1collision\$1count

hanadb\$1admission\$1control\$1admit\$1count

hanadb\$1admission\$1control\$1reject\$1count

hanadb\$1admission\$1control\$1queue\$1size\$1mb

hanadb\$1admission\$1control\$1wait\$1time\$1milliseconds

# SAP ASE


CloudWatch Application Insights supports the following metrics:

asedb\$1database\$1availability

asedb\$1trunc\$1log\$1on\$1chkpt\$1enabled

asedb\$1last\$1db\$1backup\$1age\$1in\$1days

asedb\$1last\$1transaction\$1log\$1backup\$1age\$1in\$1hours

asedb\$1suspected\$1database

asedb\$1db\$1space\$1usage\$1percent

asedb\$1db\$1log\$1space\$1usage\$1percent

asedb\$1locked\$1login

asedb\$1has\$1mixed\$1log\$1and\$1data

asedb\$1runtime\$1for\$1open\$1transactions

asedb\$1data\$1cache\$1hit\$1ratio

asedb\$1data\$1cache\$1usage

asedb\$1sql\$1cache\$1hit\$1ratio

asedb\$1cache\$1usage

asedb\$1run\$1queue\$1length

asedb\$1number\$1of\$1rollbacks

asedb\$1number\$1of\$1commits

asedb\$1number\$1of\$1transactions

asedb\$1outstanding\$1disk\$1io

asedb\$1percent\$1io\$1busy

asedb\$1percent\$1system\$1busy

asedb\$1percent\$1locks\$1active

asedb\$1scheduled\$1jobs\$1failed\$1percent

asedb\$1user\$1connections\$1percent

asedb\$1query\$1logical\$1reads

asedb\$1query\$1physical\$1reads

asedb\$1query\$1cpu\$1time

asedb\$1query\$1memory\$1usage

# SAP ASE High Availability on Amazon EC2


CloudWatch Application Insights supports the following metrics:

asedb\$1ha\$1replication\$1state

asedb\$1ha\$1replication\$1mode

asedb\$1ha\$1replication\$1latency\$1in\$1minutes

# SAP NetWeaver


CloudWatch Application Insights supports the following metrics:


| Metric | Description | 
| --- | --- | 
| sap\$1alerts\$1ResponseTime |  The SAP response time alert from CCMS (RZ20)>R3Services>Dialog>ResponseTime.  | 
|  sap\$1alerts\$1ResponseTimeDialog  | The SAP response time dialog alert from CCMS (RZ20)>R3Services>Dialog> ResponseTimeDialog. | 
| sap\$1alerts\$1ResponseTimeDialogRFC | The SAP response time alert from CCMS (RZ20)>R3Services> Dialog>ResponseTimeDialogRFC. | 
| sap\$1alerts\$1DBRequestTime | The SAP response time alert from CCMS (RZ20)>R3Services>Dialog>DBRequestTime. | 
| sap\$1alerts\$1FrontendResponseTime | The SAP response time alert from CCMS (RZ20)>R3Services > Dialog>FrontEndResponseTime. | 
| sap\$1alerts\$1Database  | The SAP system has logged database-related errors. Alert from SM21 or CCMS (RZ20)>R3Syslog>Database. | 
| sap\$1alerts\$1QueueTime  | The SAP queue time alert from CCMS (RZ20)>R3Services>Dialog>QueueTime. | 
| sap\$1alerts\$1AbortedJobs | Failed background jobs in SAP system. Alert from (RZ20)>R3Services > Background>AbortedJobs. | 
| sap\$1alerts\$1BasisSystem | SAP system logged system-level errors. Alert from SM21 or CCMS (RZ20)>R3Syslog>BasisSystem. | 
| sap\$1alerts\$1Security  | The SAP system logged security-related messages. Alert from SM21 or CCMS (RZ20)>R3Syslog>Security. | 
| sap\$1alerts\$1System  | The SAP system logged security or audit-related messages. Alert from SM21 or CCMS (RZ20)>Security>System. | 
| sap\$1alerts\$1LongRunners  | There are long running programs in your SAP system. Alert from CCMS (RZ20)>R3Services > Dialog>LongRunners. | 
| sap\$1alerts\$1SqlError  | There are SAP database client layer error logs. Alert from CCMS(RZ20)>DatabaseClient>AbapSql>SqlError. | 
| sap\$1alerts\$1State  | State alert from CCMS (RZ20)>OS Collector>State. | 
| sap\$1alerts\$1Shortdumps  | Shortdumps alert from ST22 and CCMS (RZ20)>R3Abap>Shortdumps. | 
| sap\$1alerts\$1Availability  | Availability alert for SAP application server instance from SM21, SM50, SM51, SM66, and CCMS (RZ20)>InstanceAsTask>Availability. | 
| sap\$1dispatcher\$1queue\$1high | The SAPControl Web Service function GetQueueStatistic provides the dispatcher queue high count.  | 
| sap\$1dispatcher\$1queue\$1max | The SAPControl Web Service function GetQueueStatistic provides the dispatcher queue max count.  | 
| sap\$1dispatcher\$1queue\$1now | The SAPControl Web Service function GetQueueStatistic provides the dispatcher queue now count. | 
| sap\$1dispatcher\$1queue\$1reads | The SAPControl Web Service function GetQueueStatistic provides the dispatcher queue reads count.  | 
| sap\$1dispatcher\$1queue\$1writes | The SAPControl Web Service function GetQueueStatistic provides the dispatcher queue writes count.  | 
| sap\$1enqueue\$1server\$1arguments\$1high  | The SAPControl Web Service function EnqGetStatistic provides the enqueue arguments high. | 
| sap\$1enqueue\$1server\$1arguments\$1max  | The SAPControl Web Service function EnqGetStatistic provides the enqueue arguments max. | 
| sap\$1enqueue\$1server\$1arguments\$1now | The SAPControl Web Service function EnqGetStatistic provides the enqueue arguments now. | 
| sap\$1enqueue\$1server\$1arguments\$1state | The SAPControl Web Service function EnqGetStatistic provides the enqueue arguments state. | 
| sap\$1enqueue\$1server\$1backup\$1requests | The SAPControl Web Service function EnqGetStatistic provides the enqueue backup requests. | 
| sap\$1enqueue\$1server\$1cleanup\$1requests | The SAPControl Web Service function EnqGetStatistic provides the enqueue cleanup requests.  | 
| sap\$1enqueue\$1server\$1dequeue\$1all\$1requests | The SAPControl Web Service function EnqGetStatistic provides the dequeue all requests. | 
| sap\$1enqueue\$1server\$1dequeue\$1errors | The SAPControl Web Service function EnqGetStatistic provides the dequeue errors.  | 
| sap\$1enqueue\$1server\$1dequeue\$1requests  | The SAPControl Web Service function EnqGetStatistic provides the dequeue requests. | 
| sap\$1enqueue\$1server\$1enqueue\$1errors | The SAPControl Web Service function EnqGetStatistic provides the enqueue errors. | 
| sap\$1enqueue\$1server\$1enqueue\$1rejects  | The SAPControl Web Service function EnqGetStatistic provides the enqueue rejects. | 
| sap\$1enqueue\$1server\$1enqueue\$1requests | The SAPControl Web Service function EnqGetStatistic provides the enqueue requests. | 
| sap\$1enqueue\$1server\$1lock\$1time | The SAPControl Web Service function EnqGetStatistic provides the enqueue lock time. | 
| sap\$1enqueue\$1server\$1lock\$1wait\$1time | The SAPControl Web Service function EnqGetStatistic provides the enqueue lock wait time. | 
| sap\$1enqueue\$1server\$1locks\$1high | The SAPControl Web Service function EnqGetStatistic provides the enqueue locks high. | 
| sap\$1enqueue\$1server\$1locks\$1max | The SAPControl Web Service function EnqGetStatistic provides the enqueue locks max. | 
| sap\$1enqueue\$1server\$1locks\$1now | The SAPControl Web Service function EnqGetStatistic provides the enqueue locks now. | 
| sap\$1enqueue\$1server\$1locks\$1state | The SAPControl Web Service function EnqGetStatistic provides the enqueue locks state. | 
| sap\$1enqueue\$1server\$1owner\$1high | The SAPControl Web Service function EnqGetStatistic provides the enqueue owner high. | 
| sap\$1enqueue\$1server\$1owner\$1max | The SAPControl Web Service function EnqGetStatistic provides the enqueue owner max. | 
| sap\$1enqueue\$1server\$1owner\$1now | The SAPControl Web Service function EnqGetStatistic provides the enqueue owner now. | 
| sap\$1enqueue\$1server\$1owner\$1state | The SAPControl Web Service function EnqGetStatistic provides the enqueue owner state. | 
| sap\$1enqueue\$1server\$1replication\$1state  | The SAPControl Web Service function EnqGetStatistic provides the enqueue replication state status. | 
| sap\$1enqueue\$1server\$1reporting\$1requests | The SAPControl Web Service function EnqGetStatistic provides the reqporting requests status. | 
| sap\$1enqueue\$1server\$1server\$1time | The SAPControl Web Service function EnqGetStatistic provides the enqueue server time. | 
| sap\$1HA\$1check\$1failover\$1config\$1state | The SAPControl Web Service function HACheckFailoverConfig provides the SAP High Availability status. | 
| sap\$1HA\$1get\$1failover\$1config\$1HAActive | The SAPControl Web Service function HAGetFailoverConfig provides the SAP High Availability Cluster configuration and status. | 
| sap\$1start\$1service\$1processes  | The SAPControl Web Service function GetProcessList provides the disp\$1work, IGS, gwrd, icman, message server, and enqueue server processes status. | 

# HA Cluster


CloudWatch Application Insights supports the following metrics:

ha\$1cluster\$1pacemaker\$1stonith\$1enabled 

ha\$1cluster\$1corosync\$1quorate

hanadb\$1webdispatcher\$1service\$1started\$1status

ha\$1cluster\$1pacemaker\$1nodes 

ha\$1cluster\$1corosync\$1ring\$1errors

ha\$1cluster\$1pacemaker\$1fail\$1count 

# Java


CloudWatch Application Insights supports the following metrics:

java\$1lang\$1memory\$1heapmemoryusage\$1used

java\$1lang\$1memory\$1heapmemoryusage\$1committed

java\$1lang\$1operatingsystem\$1openfiledescriptorcount

java\$1lang\$1operatingsystem\$1maxfiledescriptorcount

java\$1lang\$1operatingsystem\$1freephysicalmemorysize

java\$1lang\$1operatingsystem\$1freeswapspacesize

java\$1lang\$1threading\$1threadcount

java\$1lang\$1threading\$1daemonthreadcount

java\$1lang\$1classloading\$1loadedclasscount

java\$1lang\$1garbagecollector\$1collectiontime\$1copy

java\$1lang\$1garbagecollector\$1collectiontime\$1ps\$1scavenge

java\$1lang\$1garbagecollector\$1collectiontime\$1parnew

java\$1lang\$1garbagecollector\$1collectiontime\$1marksweepcompact

java\$1lang\$1garbagecollector\$1collectiontime\$1ps\$1marksweep

java\$1lang\$1garbagecollector\$1collectiontime\$1concurrentmarksweep

java\$1lang\$1garbagecollector\$1collectiontime\$1g1\$1young\$1generation

java\$1lang\$1garbagecollector\$1collectiontime\$1g1\$1old\$1generation

java\$1lang\$1garbagecollector\$1collectiontime\$1g1\$1mixed\$1generation

java\$1lang\$1operatingsystem\$1committedvirtualmemorysize

# Amazon Elastic Container Service (Amazon ECS)


CloudWatch Application Insights supports the following metrics:

**Topics**
+ [

## CloudWatch built-in metrics
](#appinsights-metrics-ecs-built-in-metrics)
+ [

## Container Insights metrics
](#appinsights-metrics-ecs-container-insights-metrics)
+ [

## Container Insights Prometheus metrics
](#appinsights-metrics-ecs-container-insights-prometheus)

## CloudWatch built-in metrics


CPUReservation

CPUUtilization

MemoryReservation

MemoryUtilization

GPUReservation

## Container Insights metrics


ContainerInstanceCount

CpuUtilized

CpuReserved

DeploymentCount

DesiredTaskCount

MemoryUtilized

MemoryReserved

NetworkRxBytes

NetworkTxBytes

PendingTaskCount

RunningTaskCount

ServiceCount

StorageReadBytes

StorageWriteBytes

TaskCount

TaskSetCount

instance\$1cpu\$1limit

instance\$1cpu\$1reserved\$1capacity

instance\$1cpu\$1usage\$1total

instance\$1cpu\$1utilization

instance\$1filesystem\$1utilization

instance\$1memory\$1limit

instance\$1memory\$1reserved\$1capacity

instance\$1memory\$1utilization

instance\$1memory\$1working\$1set

instance\$1network\$1total\$1bytes

instance\$1number\$1of\$1running\$1tasks

## Container Insights Prometheus metrics


**Java JMX metrics**

java\$1lang\$1memory\$1heapmemoryusage\$1used

java\$1lang\$1memory\$1heapmemoryusage\$1committed

java\$1lang\$1operatingsystem\$1openfiledescriptorcount

java\$1lang\$1operatingsystem\$1maxfiledescriptorcount

java\$1lang\$1operatingsystem\$1freephysicalmemorysize

java\$1lang\$1operatingsystem\$1freeswapspacesize

java\$1lang\$1threading\$1threadcount

java\$1lang\$1classloading\$1loadedclasscount

java\$1lang\$1threading\$1daemonthreadcount

java\$1lang\$1garbagecollector\$1collectiontime\$1copy

java\$1lang\$1garbagecollector\$1collectiontime\$1ps\$1scavenge

java\$1lang\$1garbagecollector\$1collectiontime\$1parnew

java\$1lang\$1garbagecollector\$1collectiontime\$1marksweepcompact

java\$1lang\$1garbagecollector\$1collectiontime\$1ps\$1marksweep

java\$1lang\$1garbagecollector\$1collectiontime\$1concurrentmarksweep

java\$1lang\$1garbagecollector\$1collectiontime\$1g1\$1young\$1generation

java\$1lang\$1garbagecollector\$1collectiontime\$1g1\$1old\$1generation

java\$1lang\$1garbagecollector\$1collectiontime\$1g1\$1mixed\$1generation

java\$1lang\$1operatingsystem\$1committedvirtualmemorysize

# Kubernetes on AWS


CloudWatch Application Insights supports the following metrics:

**Topics**
+ [

## Container Insights metrics
](#appinsights-metrics-kubernetes-container-insights-metrics)
+ [

## Container Insights Prometheus metrics
](#appinsights-metrics-kubernetes-container-insights-prometheus)

## Container Insights metrics


cluster\$1failed\$1node\$1count

cluster\$1node\$1count

namespace\$1number\$1of\$1running\$1pods

node\$1cpu\$1limit

node\$1cpu\$1reserved\$1capacity

node\$1cpu\$1usage\$1total

node\$1cpu\$1utilization

node\$1filesystem\$1utilization

node\$1memory\$1limit

node\$1memory\$1reserved\$1capacity

node\$1memory\$1utilization

node\$1memory\$1working\$1set

node\$1network\$1total\$1bytes

node\$1number\$1of\$1running\$1containers

node\$1number\$1of\$1running\$1pods

pod\$1cpu\$1reserved\$1capacity

pod\$1cpu\$1utilization

pod\$1cpu\$1utilization\$1over\$1pod\$1limit

pod\$1memory\$1reserved\$1capacity

pod\$1memory\$1utilization

pod\$1memory\$1utilization\$1over\$1pod\$1limit

pod\$1network\$1rx\$1bytes

pod\$1network\$1tx\$1bytes

service\$1number\$1of\$1running\$1pods

## Container Insights Prometheus metrics


**Java JMX metrics**

java\$1lang\$1memory\$1heapmemoryusage\$1used

java\$1lang\$1memory\$1heapmemoryusage\$1committed

java\$1lang\$1operatingsystem\$1openfiledescriptorcount

java\$1lang\$1operatingsystem\$1maxfiledescriptorcount

java\$1lang\$1operatingsystem\$1freephysicalmemorysize

java\$1lang\$1operatingsystem\$1freeswapspacesize

java\$1lang\$1threading\$1threadcount

java\$1lang\$1classloading\$1loadedclasscount

java\$1lang\$1threading\$1daemonthreadcount

java\$1lang\$1garbagecollector\$1collectiontime\$1copy

java\$1lang\$1garbagecollector\$1collectiontime\$1ps\$1scavenge

java\$1lang\$1garbagecollector\$1collectiontime\$1parnew

java\$1lang\$1garbagecollector\$1collectiontime\$1marksweepcompact

java\$1lang\$1garbagecollector\$1collectiontime\$1ps\$1marksweep

java\$1lang\$1garbagecollector\$1collectiontime\$1concurrentmarksweep

java\$1lang\$1garbagecollector\$1collectiontime\$1g1\$1young\$1generation

java\$1lang\$1garbagecollector\$1collectiontime\$1g1\$1old\$1generation

java\$1lang\$1garbagecollector\$1collectiontime\$1g1\$1mixed\$1generation

java\$1lang\$1operatingsystem\$1committedvirtualmemorysize

# Amazon FSx


CloudWatch Application Insights supports the following metrics:

DataReadBytes

DataWriteBytes

DataReadOperations

DataWriteOperations

MetadataOperations

FreeStorageCapacity

FreeDataStorageCapacity

LogicalDiskUsage

PhysicalDiskUsage

# Amazon VPC


CloudWatch Application Insights supports the following metrics:

NetworkAddressUsage

NetworkAddressUsagePeered

VPCFirewallQueryVolume

# Amazon VPC NAT gateways


CloudWatch Application Insights supports the following metrics:

ErrorPortAllocation

IdleTimeoutCount

# Amazon Route 53 health check


CloudWatch Application Insights supports the following metrics:

ChildHealthCheckHealthyCount

ConnectionTime

HealthCheckPercentageHealthy

HealthCheckStatus

SSLHandshakeTime 

TimeToFirstByte

# Amazon Route 53 hosted zone


CloudWatch Application Insights supports the following metrics:

DNSQueries

DNSSECInternalFailure

DNSSECKeySigningKeysNeedingAction

DNSSECKeySigningKeyMaxNeedingActionAge

DNSSECKeySigningKeyAge

# Amazon Route 53 Resolver endpoint


CloudWatch Application Insights supports the following metrics:

EndpointHealthyENICount

EndpointUnHealthyENICount

InboundQueryVolume

OutboundQueryVolume

OutboundQueryAggregateVolume

# AWS Network Firewall rule group


CloudWatch Application Insights supports the following metrics:

FirewallRuleGroupQueryVolume

# AWS Network Firewall rule group association


CloudWatch Application Insights supports the following metrics:

FirewallRuleGroupVpcQueryVolume

# Metrics with data points requirements


For metrics without an obvious default threshold to alarm on, Application Insights waits until the metric has enough data points to predict a reasonable threshold to alarm on. The metric data points requirement that CloudWatch Application Insights checks before an alarm is created are: 
+ The metric has at least 100 data points from the past 15 to the past 2 days.
+ The metric has at least 100 data points from the last day.

The following metrics follow these data points requirements. Note that CloudWatch agent metrics require up to one hour to create alarms. 

**Topics**
+ [

## AWS/ApplicationELB
](#appinsights-metrics-datapoint-requirements-app-elb)
+ [

## AWS/AutoScaling
](#appinsights-metrics-datapoint-requirements-autoscaling)
+ [

## AWS/EC2
](#appinsights-metrics-datapoint-requirements-ec2)
+ [

## Elastic Block Store (EBS)
](#appinsights-metrics-datapoint-requirements-ebs)
+ [

## AWS/ELB
](#appinsights-metrics-datapoint-requirements-elb)
+ [

## AWS/RDS
](#appinsights-metrics-datapoint-requirements-rds)
+ [

## AWS/Lambda
](#appinsights-metrics-datapoint-requirements-lambda)
+ [

## AWS/SQS
](#appinsights-metrics-datapoint-requirements-sqs)
+ [

## AWS/CWAgent
](#appinsights-metrics-datapoint-requirements-cwagent)
+ [

## AWS/DynamoDB
](#appinsights-metrics-datapoint-requirements-dynamo)
+ [

## AWS/S3
](#appinsights-metrics-datapoint-requirements-s3)
+ [

## AWS/States
](#appinsights-metrics-datapoint-requirements-states)
+ [

## AWS/ApiGateway
](#appinsights-metrics-datapoint-requirements-api-gateway)
+ [

## AWS/SNS
](#appinsights-metrics-datapoint-requirements-sns)

## AWS/ApplicationELB


ActiveConnectionCount

ConsumedLCUs

HTTPCode\$1ELB\$14XX\$1Count

HTTPCode\$1Target\$12XX\$1Count

HTTPCode\$1Target\$13XX\$1Count

HTTPCode\$1Target\$14XX\$1Count

HTTPCode\$1Target\$15XX\$1Count

NewConnectionCount

ProcessedBytes

TargetResponseTime

UnHealthyHostCount

## AWS/AutoScaling


GroupDesiredCapacity

GroupInServiceInstances

GroupMaxSize

GroupMinSize

GroupPendingInstances

GroupStandbyInstances

GroupTerminatingInstances

GroupTotalInstances

## AWS/EC2


CPUCreditBalance

CPUCreditUsage

CPUSurplusCreditBalance

CPUSurplusCreditsCharged

CPUUtilization

DiskReadBytes

DiskReadOps

DiskWriteBytes

DiskWriteOps

EBSByteBalance%

EBSIOBalance%

EBSReadBytes

EBSReadOps

EBSWriteBytes

EBSWriteOps

NetworkIn

NetworkOut

NetworkPacketsIn

NetworkPacketsOut

## Elastic Block Store (EBS)


VolumeReadBytes 

VolumeWriteBytes 

VolumeReadOps

VolumeWriteOps

VolumeTotalReadTime 

VolumeTotalWriteTime 

VolumeIdleTime

VolumeQueueLength

VolumeThroughputPercentage

VolumeConsumedReadWriteOps

BurstBalance

## AWS/ELB


EstimatedALBActiveConnectionCount

EstimatedALBConsumedLCUs

EstimatedALBNewConnectionCount

EstimatedProcessedBytes

HTTPCode\$1Backend\$14XX

HTTPCode\$1Backend\$15XX

HealthyHostCount

Latency

RequestCount

SurgeQueueLength

UnHealthyHostCount

## AWS/RDS


ActiveTransactions

AuroraBinlogReplicaLag

AuroraReplicaLag

BackupRetentionPeriodStorageUsed

BinLogDiskUsage

BlockedTransactions

CPUCreditBalance

CommitLatency

CommitThroughput

DDLLatency

DDLThroughput

DMLLatency

DMLThroughput

DatabaseConnections

Deadlocks

DeleteLatency

DeleteThroughput

DiskQueueDepth

EngineUptime

FreeLocalStorage

FreeStorageSpace

FreeableMemory

InsertLatency

InsertThroughput

LoginFailures

NetworkReceiveThroughput

NetworkThroughput

NetworkTransmitThroughput

Queries

ReadIOPS

ReadThroughput

SelectLatency

SelectThroughput

SnapshotStorageUsed

TotalBackupStorageBilled

UpdateLatency

UpdateThroughput

VolumeBytesUsed

VolumeReadIOPs

VolumeWriteIOPs

WriteIOPS

WriteThroughput

## AWS/Lambda


Errors

DeadLetterErrors

Duration

Throttles

IteratorAge

ProvisionedConcurrencySpilloverInvocations

## AWS/SQS


ApproximateAgeOfOldestMessage

ApproximateNumberOfMessagesDelayed

ApproximateNumberOfMessagesNotVisible

ApproximateNumberOfMessagesVisible

NumberOfEmptyReceives

NumberOfMessagesDeleted

NumberOfMessagesReceived

NumberOfMessagesSent

## AWS/CWAgent


LogicalDisk % Free Space

Memory % Committed Bytes In Use

Memory Available Mbytes

Network Interface Bytes Total/sec

Paging File % Usage

PhysicalDisk % Disk Time

PhysicalDisk Avg. Disk sec/Read

PhysicalDisk Avg. Disk sec/Write

PhysicalDisk Disk Read Bytes/sec

PhysicalDisk Disk Reads/sec

PhysicalDisk Disk Write Bytes/sec

PhysicalDisk Disk Writes/sec

Processor % Idle Time

Processor % Interrupt Time

Processor % Processor Time

Processor % User Time

SQLServer:Access Methods Forwarded Records/sec

SQLServer:Access Methods Page Splits/sec

SQLServer:Buffer Manager Buffer cache hit ratio

SQLServer:Buffer Manager Page life expectancy

SQLServer:Database Replica File Bytes Received/sec

SQLServer:Database Replica Log Bytes Received/sec

SQLServer:Database Replica Log remaining for undo

SQLServer:Database Replica Log Send Queue

SQLServer:Database Replica Mirrored Write Transaction/sec

SQLServer:Database Replica Recovery Queue

SQLServer:Database Replica Redo Bytes Remaining

SQLServer:Database Replica Redone Bytes/sec

SQLServer:Database Replica Total Log requiring undo

SQLServer:Database Replica Transaction Delay

SQLServer:General Statistics Processes blocked

SQLServer:SQL Statistics Batch Requests/sec

SQLServer:SQL Statistics SQL Compilations/sec

SQLServer:SQL Statistics SQL Re-Compilations/sec

System Processor Queue Length

TCPv4 Connections Established

TCPv6 Connections Established

## AWS/DynamoDB


ConsumedReadCapacityUnits

ConsumedWriteCapacityUnits

ReadThrottleEvents

WriteThrottleEvents

TimeToLiveDeletedItemCount

ConditionalCheckFailedRequests

TransactionConflict

ReturnedRecordsCount

PendingReplicationCount

ReplicationLatency

## AWS/S3


ReplicationLatency

BytesPendingReplication

OperationsPendingReplication

4xxErrors

5xxErrors

AllRequests

GetRequests

PutRequests

DeleteRequests

HeadRequests

PostRequests

SelectRequests

ListRequests

SelectScannedBytes

SelectReturnedBytes

FirstByteLatency

TotalRequestLatency

BytesDownloaded

BytesUploaded

## AWS/States


ActivitiesScheduled

ActivitiesStarted

ActivitiesSucceeded

ActivityScheduleTime

ActivityRuntime

ActivityTime

LambdaFunctionsScheduled

LambdaFunctionsStarted

LambdaFunctionsSucceeded

LambdaFunctionScheduleTime

LambdaFunctionRuntime

LambdaFunctionTime

ServiceIntegrationsScheduled

ServiceIntegrationsStarted

ServiceIntegrationsSucceeded

ServiceIntegrationScheduleTime

ServiceIntegrationRuntime

ServiceIntegrationTime

ProvisionedRefillRate

ProvisionedBucketSize

ConsumedCapacity

ThrottledEvents

## AWS/ApiGateway


4XXError 

IntegrationLatency

Latency

DataProcessed

CacheHitCount

CacheMissCount

## AWS/SNS


NumberOfNotificationsDelivered

NumberOfMessagesPublished

NumberOfNotificationsFailed

NumberOfNotificationsFilteredOut

NumberOfNotificationsFilteredOut-InvalidAttributes

NumberOfNotificationsFilteredOut-NoMessageAttributes

NumberOfNotificationsRedrivenToDlq

NumberOfNotificationsFailedToRedriveToDlq

SMSSuccessRate

# Recommended metrics


The following table lists the recommended metrics for each component type.

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/application-insights-recommended-metrics.html)

The following table lists the recommended processes and process metrics for each component type. CloudWatch Application Insights does not recommend process monitoring for processes that do not run on an instance.

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/application-insights-recommended-metrics.html)

# Performance Counter metrics


Performance Counter metrics are recommended for instances only when the corresponding Performance Counter sets are installed on the Windows instances.


| Performance Counter metric name | Performance Counter set name | 
| --- | --- | 
| .NET CLR Exceptions \$1 of Exceps Thrown | .NET CLR Exceptions | 
| .NET CLR Exceptions \$1 of Exceps Thrown/Sec  | .NET CLR Exceptions | 
| .NET CLR Exceptions \$1 of Filters/Sec  | .NET CLR Exceptions | 
| .NET CLR Exceptions \$1 of Finallys/Sec  | .NET CLR Exceptions | 
| .NET CLR Exceptions Throw to Catch Depth/Sec  | .NET CLR Exceptions | 
| .NET CLR Interop \$1 of CCWs  | .NET CLR Interop  | 
| .NET CLR Interop \$1 of Stubs  | .NET CLR Interop  | 
| .NET CLR Interop \$1 of TLB exports/Sec  | .NET CLR Interop  | 
| .NET CLR Interop \$1 of TLB imports/Sec  | .NET CLR Interop  | 
| .NET CLR Interop \$1 of Marshaling  | .NET CLR Interop  | 
| .NET CLR Jit % Time in Jit  | .NET CLR Jit  | 
| .NET CLR Jit Standard Jit Failures  | .NET CLR Jit  | 
| .NET CLR Loading % Time Loading  | .NET CLR Loading  | 
| .NET CLR Loading Rate of Load Failures  | .NET CLR Loading  | 
| .NET CLR LocksAndThreads Contention Rate/Sec  | .NET CLR LocksAndThreads  | 
| .NET CLR LocksAndThreads Queue Length/Sec  | .NET CLR LocksAndThreads  | 
| .NET CLR Memory \$1 Total Committed Bytes  | .NET CLR Memory | 
| .NET CLR Memory % Time in GC | .NET CLR Memory | 
| .NET CLR Networking 4.0.0.0 HttpWebRequest Average Queue Time  | .NET CLR Networking 4.0.0.0  | 
| .NET CLR Networking 4.0.0.0 HttpWebRequests Aborted/Sec  | .NET CLR Networking 4.0.0.0  | 
| .NET CLR Networking 4.0.0.0 HttpWebRequests Failed/Sec  | .NET CLR Networking 4.0.0.0  | 
| .NET CLR Networking 4.0.0.0 HttpWebRequests Queued/Sec  | .NET CLR Networking 4.0.0.0  | 
| APP\$1POOL\$1WAS Total Worker Process Ping Failures | APP\$1POOL\$1WAS | 
| ASP.NET Application Restarts  | ASP.NET  | 
| ASP.NET Requests Rejected | ASP.NET | 
| ASP.NET Worker Process Restarts | ASP.NET | 
| ASP.NET Applications Cache API trims | ASP.NET Applications | 
| ASP.NET Applications % Managed Processor Time (estimated) | ASP.NET Applications | 
| ASP.NET Applications Errors Total/Sec | ASP.NET Applications | 
|  ASP.NET Applications Errors Unhandled During Execution/Sec  |  ASP.NET Applications  | 
|  ASP.NET Applications Requests in Application Queue  |  ASP.NET Applications  | 
|  ASP.NET Applications Requests/Sec  |  ASP.NET Applications  | 
| ASP.NET Request Wait Time  | ASP.NET  | 
| ASP.NET Requests Queued  | ASP.NET  | 
| Database ==> Instances Database Cache % Hit | Database ==> Instances | 
| Database ==> Instances I/O Database Reads Average Latency | Database ==> Instances | 
| Database ==> Instances I/O Database Reads/sec | Database ==> Instances | 
| Database ==> Instances I/O Log Writes Average Latency | Database ==> Instances | 
| DirectoryServices DRA Pending Replication Operations | DirectoryServices | 
| DirectoryServices DRA Pending Replication Synchronizations | DirectoryServices | 
| DirectoryServices LDAP Bind Time | DirectoryServices | 
| DNS Recursive Queries/sec | DNS | 
| DNS Recursive Query Failure/sec | DNS | 
| DNS TCP Query Received/sec | DNS | 
| DNS Total Query Received/sec | DNS | 
| DNS Total Response Sent/sec | DNS | 
| DNS UDP Query Received/sec | DNS | 
| HTTP Service Request Queues CurrentQueueSize  | HTTP Service Request Queues  | 
|  LogicalDisk % Free Space  |  LogicalDisk  | 
| LogicalDisk Avg. Disk sec/Write | LogicalDisk | 
| LogicalDisk Avg. Disk sec/Read | LogicalDisk | 
| LogicalDisk Avg. Disk Queue Length | LogicalDisk | 
|  Memory % Committed Bytes In Use  | Memory | 
|  Memory Available Mbytes  |  Memory  | 
| Memory Pages/Sec  |  Memory  | 
| Memory Long-Term Average Standby Cache Lifetime (s) | Memory | 
|  Network Interface Bytes Total/Sec  | Network Interface | 
| Network Interface Bytes Received/sec | Network Interface | 
| Network Interface Bytes Sent/sec | Network Interface | 
| Network Interface Current Bandwidth | Network Interface | 
|  Paging File % Usage  |  Paging File  | 
| PhysicalDisk % Disk Time | PhysicalDisk | 
| PhysicalDisk Avg. Disk Queue Length | PhysicalDisk | 
| PhysicalDisk Avg. Disk Sec/Read | PhysicalDisk | 
| PhysicalDisk Avg. Disk Sec/Write | PhysicalDisk | 
| PhysicalDisk Disk Read Bytes/Sec | PhysicalDisk | 
| PhysicalDisk Disk Reads/Sec | PhysicalDisk | 
| PhysicalDisk Disk Write Bytes/Sec | PhysicalDisk | 
| PhysicalDisk Disk Writes/Sec | PhysicalDisk | 
|  Processor % Idle Time  | Processor | 
| Processor % Interrupt Time |  Processor  | 
| Processor % Processor Time |  Processor  | 
| Processor % User Time |  Processor  | 
| SharePoint Disk-Based Cache Blob Cache fill ratio  | SharePoint Disk-Based Cache  | 
| SharePoint Disk-Based Cache Blob cache flushes / second  | SharePoint Disk-Based Cache  | 
| SharePoint Disk-Based Cache Blob cache hit ratio  | SharePoint Disk-Based Cache  | 
| SharePoint Disk-Based Cache Total number of cache compactions | SharePoint Disk-Based Cache  | 
| SharePoint Foundation Executing Time/Page Request | SharePoint Foundation | 
| SharePoint Publishing Cache Publishing cache flushes / second | SharePoint Publishing Cache | 
| Security System-Wide Statistics Kerberos Authentications | Security System-Wide Statistics | 
| Security System-Wide Statistics NTLM Authentications | Security System-Wide Statistics | 
| SQLServer:Access Methods Forwarded Records/Sec |  SQLServer:Access Methods  | 
| SQLServer:Access Methods Full Scans/Sec |  SQLServer:Access Methods  | 
| SQLServer:Access Methods Page Splits/Sec |  SQLServer:Access Methods  | 
| SQLServer:Buffer Manager Buffer cache hit Ratio |  SQLServer:Buffer Manager  | 
| SQLServer:Buffer Manager Page life Expectancy |  SQLServer:Buffer Manager  | 
| SQLServer:Database Replica File Bytes Received/sec | SQLServer:Database Replica | 
| SQLServer:Database Replica Log Bytes Received/sec | SQLServer:Database Replica | 
| SQLServer:Database Replica Log remaining for undo | SQLServer:Database Replica | 
| SQLServer:Database Replica Log Send Queue | SQLServer:Database Replica | 
| SQLServer:Database Replica Mirrored Write Transaction/sec | SQLServer:Database Replica | 
| SQLServer:Database Replica Recovery Queue | SQLServer:Database Replica | 
| SQLServer:Database Replica Redo Bytes Remaining | SQLServer:Database Replica | 
| SQLServer:Database Replica Redone Bytes/sec | SQLServer:Database Replica | 
| SQLServer:Database Replica Total Log requiring undo | SQLServer:Database Replica | 
| SQLServer:Database Replica Transaction Delay | SQLServer:Database Replica | 
| SQLServer:General Statistics Processes Blocked |  SQLServer:General Statistics  | 
| SQLServer:General Statistics User Connections | SQLServer:General Statistics | 
| SQLServer:Latches Average Latch Wait Time (ms)  | SQLServer:Latches  | 
| SQLServer:Locks Average Wait Time (ms)  | SQLServer:Locks  | 
| SQLServer:Locks Lock Timeouts/Sec  | SQLServer:Locks  | 
| SQLServer:Locks Lock Waits/Sec  | SQLServer:Locks  | 
| SQLServer:Locks Number of Deadlocks/Sec  | SQLServer:Locks  | 
| SQLServer:Memory Manager Memory Grants Pending  | SQLServer:Memory Manager  | 
| SQLServer:SQL Statistics Batch Requests/Sec | SQLServer:SQL Statistics | 
| SQLServer:SQL Statistics SQL Compilations/Sec | SQLServer:SQL Statistics | 
| SQLServer:SQL Statistics SQL Re-Compilations/Sec |  SQLServer:SQL Statistics  | 
| System Processor Queue Length |  System  | 
| TCPv4 Connections Established | TCPv4 | 
| TCPv6 Connections Established | TCPv6 | 
| W3SVC\$1W3WP File Cache Flushes  | W3SVC\$1W3WP  | 
| W3SVC\$1W3WP File Cache Misses  | W3SVC\$1W3WP  | 
| W3SVC\$1W3WP Requests/Sec  | W3SVC\$1W3WP  | 
| W3SVC\$1W3WP URI Cache Flushes  | W3SVC\$1W3WP  | 
| W3SVC\$1W3WP URI Cache Misses  | W3SVC\$1W3WP  | 
| Web Service Bytes Received/Sec |  Web Service  | 
| Web Service Bytes Sent/Sec |  Web Service  | 
|  Web Service Connection Attempts/Sec   |  Web Service  | 
| Web Service Current Connections  |  Web Service  | 
| Web Service Get Requests/Sec  |  Web Service  | 
| Web Service Post Requests/Sec  |  Web Service  | 