Set up Dynatrace SaaS for AWS monitoring
You can integrate Dynatrace with Amazon Web Services (AWS) for intelligent monitoring of services running in the Amazon Cloud. AWS integration helps you stay on top of the dynamics of your data center in the cloud.
Dynatrace can be deployed with or without an Environment ActiveGate. Configuring role-based access differs for Dynatrace deployments that use an Environment ActiveGate.
Overview
Follow these basic steps to integrate Dynatrace SaaS with Amazon Web Services (AWS):
-
Choose an access method:
- Key-based access.
- Role-based access.
If you choose role-based access, use the appropriate procedure for your deployment scenario:
You must install and configure an Environment ActiveGate if you want to monitor either or both of the following:
- More than 2,000 AWS resources (AWS service instances)
- AWS Cloud Services
All cloud services consume Davis data units (DDUs). The amount of DDU consumption per service instance depends on the number of monitored metrics and their dimensions (each metric dimension results in the ingestion of 1 data point; 1 data point consumes 0.001 DDUs).
AWS costs
Dynatrace makes Amazon API requests every 5 minutes. In addition to CloudWatch API calls, Dynatrace makes API calls to the monitored AWS services in order to learn about their instances, tags, etc. The list of called services and actions is available below in the Create the monitoring policy section. Here's a rough estimate of AWS monitoring costs:
AWS service | Number of metrics | Daily cost per instance (USD) |
---|---|---|
Elastic Compute Cloud (EC2) | 7 | $0.02016 |
Elastic Block Store (EBS) | 10 | $0.02304 |
Elastic Load Balancer (ELB) | 11 | $0.03168 |
Relational Database Service (RDS) | 11 | $0.03168 |
DynamoDB | 15 | $0.06912 |
Lambda | 4 | $0.01152 |
Amazon will charge about $0.01 per 1,000 metrics requested from the CloudWatch API and include the cost in the bill for the AWS account you use with Dynatrace.
AWS monitoring policy
The AWS monitoring policy defines the minimum scope of permissions you need to give to Dynatrace to monitor the services running in your AWS account. Create it once and use anytime when enabling Dynatrace access to your AWS account.
AWS IAM permission boundaries may prohibit AWS actions required by Dynatrace. If you use IAM permission boundary on your AWS account, make sure that actions from policy are allowed in all AWS regions within permission boundary.
-
Go to Identity and Access Management (IAM) in your Amazon Console.
-
Go to Policies and select Create policy.
-
Select the JSON tab, and paste the predefined policy from the box below.
-
Give the policy a name. For example
Dynatrace_monitoring_policy
. Type it in the Name field. -
Select Create policy.
Access methods
To get the information required for comprehensive AWS cloud-computing monitoring, Dynatrace needs to identify all the virtualized infrastructure components in your AWS environment and collect performance metrics related to those components. We use this information to understand the context of your applications, services, and hosts. For this to happen, you need to authorize Dynatrace to access your Amazon metrics.
You can enable Dynatrace access to your AWS metrics by either using a private access key (key-based access) or defining a special role for Dynatrace (role-based access). In all the cases, make sure that your Environment ActiveGate has a working connection to AWS. Configure your proxy for ActiveGate, or allow access to *.amazonaws.com
in your firewall settings.
As a best practice, use temporary security credentials (IAM roles) instead of access keys, and disable any AWS account root user access keys.
Key-based access
If you decide to use the key-based authentication, remember to rotate the keys periodically. Keep in mind that you need to perform this procedure each time you change the key.
Prerequisites for key-based access
- Rights to create a new AWS user
- Your AWS account ID
- Your Amazon Access key ID and Secret access key
Enable access to your Amazon account using key-based access
Dynatrace can use access keys to make secure REST or Query protocol requests to the AWS service API. You'll need to generate an Access key ID and a Secret access key that Dynatrace can use to get metrics from Amazon Web Services.
-
In your Amazon Console, go to Users and select Add User.
-
Enter a name for the key you want to create (for example,
Dynatrace_monitoring_user
). In Select AWS access type, select Programmatic access, and then select Next:Permissions. -
Select Attach existing policies directly and choose the monitoring policy you defined (for example,
Dynatrace_monitoring_policy
), and then select Next: Review. -
Review the user details and select Create user.
-
Store the Access Key ID name (AKID) and Secret access key values.
You can either download the user credentials or copy the credentials displayed online (select Show).
Connect your Amazon account to Dynatrace using key-based access
Once you've granted AWS access to Dynatrace, it's time to connect Dynatrace to your Amazon AWS account.
-
In the Dynatrace menu, go to Settings > Cloud and virtualization > AWS and select Connect new instance.
-
Select Key-based authentication method.
- Create a name for this connection. This is mandatory. Dynatrace needs this name to identify and display the connection.
- In the Access key ID field, paste the identifier of the key you created in Amazon for Dynatrace access.
- In the Secret access key field, paste the value of the key you created in Amazon for Dynatrace access.
- Select Connect to verify and save the connection.
-
Once the connection is successfully verified and saved, your AWS account will be listed in the Cloud and virtualization settings page. You should soon begin to see AWS cloud monitoring data.
Role-based access
Dynatrace SaaS deployments might vary. Integrating Dynatrace SaaS with AWS is different when deployment includes an Environment ActiveGate. Select the appropriate set up procedure for your Dynatrace SaaS deployment scenario.
If you configure a role-based integration in an AWS Region that must be manually activated for use with AWS STS, for example Hong Kong, you must change Region compatibility of session tokens for global endpoint to be valid in all AWS Regions. For more information, see Managing AWS STS in an AWS Region in AWS docs.
Role-based access for SaaS deployments with Environment ActiveGate
The instructions below apply whether or not the account hosting your ActiveGate is the same as your monitored account.
In a typical setup, you need to create two CloudFormation stacks using CloudFormation templates:
- A CloudFormation stack from the account hosting your ActiveGate, containing the following resources:
- A role for your Environment ActiveGate hosted in your AWS infrastructure, on an AWS EC2 host.
- Its attached policy, defining the monitored account permissions.
- A CloudFormation stack from the monitored account, containing the following resources:
- A dedicated monitoring role for Dynatrace in your AWS account.
- Its attached policy, defining the Dynatrace authentication permissions to your AWS environment.
Note: To monitor multiple accounts, add all resources to the Resource array in the template in Step 1 and repeat Step 2 to create a stack for each monitored account.
Prerequisites for role-based access, with Environment ActiveGate
-
Environment ActiveGate installed on an AWS EC2 host. It must be able to assume a role within your AWS account that allows it to read the Dynatrace monitoring data.
-
The ID of the AWS account that hosts the ActiveGate (for example, the account that hosts your Dynatrace components, which in this case is the one hosting Environment ActiveGate).
-
The Amazon Web Services monitored account ID (the account you want to monitor).
-
The name of the role with which your Environment ActiveGate was started.
-
The External ID.
To enable access to your Amazon account using role-based access, follow the steps below.
Step 1. Create a role for ActiveGate on the account that hosts ActiveGate
-
Create a YAML file and paste the content from github
role_based_access_AG_account_template.yml
.For multiple monitored accountsFor each account you want to monitor, add a new item to the
!Sub
array in the Resource section of the template above, in the following format:'arn:aws:iam::<new_monitored_account_id>:role/<new_monitoring_role_name>'
.Note: Be sure to replace the placeholders (
<new_monitored_account_id>
,<new_monitoring_role_name>
) with your own values. -
Create the stack in your Amazon Console or using the CLI.
-
Go to the Amazon EC2 console, right-click an instance hosting your Environment ActiveGate, and select Security > Modify IAM role.
-
Select the role you created at step 1 (for example, Dynatrace_ActiveGate_role), and select Apply.
Step 2. Create a monitoring role for Dynatrace on your monitored account
After the Dynatrace_ActiveGate_role
is created on the account hosting the ActiveGate, create a role for the account to be monitored.
-
Create a YAML file and paste the content from the github
role_based_access_monitored_account_template.yml
. -
Create the stack in your Amazon Console or using the CLI.
Step 3. Modify ActiveGate configuration
Starting with ActiveGate version 1.217, AWS monitoring is enabled by default. For configuration details, see Customize ActiveGate properties. The following configuration settings refer to earlier ActiveGate versions.
-
Edit the
custom.properties
file of your Environment ActiveGate. -
Set the following properties as below:
ActiveGate version 1.183 or earlier[aws_monitoring] use_aws_proxy_role = false aws_monitoring_enabled = true
[vertical.topology] use_aws_proxy_role = false
[aws_monitoring] aws_monitoring_enabled = true
If the ActiveGate is dedicated to AWS monitoring, you must also set the
MSGrouter
property tofalse
:[collector] MSGrouter = false
Remove
aws_proxy_account
andaws_proxy_role
properties. -
Save the file and restart the ActiveGate main service.
Role-based access for SaaS deployments without Environment ActiveGate
To give Dynatrace SaaS role-based monitoring access to your AWS account, you need to create a CloudFormation stack using a CloudFormation template containing the following resources:
- A dedicated monitoring role for Dynatrace in your AWS account.
- Its attached policy, defining the Dynatrace authentication permissions to your AWS environment. For multiple accounts, you need to repeat the following steps for every account that you want to monitor.
Note: You won't be able to monitor AWS Cloud Services without an AWS-hosted Environment ActiveGate.
Prerequisites for role-based access, without Environment ActiveGate
-
Your Amazon Web Services account ID
-
Rights to assign role-based access to your AWS account
-
The External ID.
Create a monitoring role for Dynatrace in your AWS account
-
Create a YAML file and paste the content from the github
role_based_access_no_AG_template.yml
. -
Create the stack in your Amazon Console or using the CLI.
Connect your Amazon account to Dynatrace using role-based access
After you've granted AWS access to Dynatrace, it's time to connect Dynatrace to your Amazon AWS account.
-
In Dynatrace, go to Settings > Cloud and virtualization > AWS and select Connect new instance.
-
Enter a name for this connection. If you leave it empty, the name Role will be used on Dynatrace pages to define this connection.
-
Select Role based authentication and enter configuration details:
- Enter the name of the role you created in Amazon for Dynatrace (for example,
Dynatrace_monitoring_role
). - Enter your Amazon account ID (the account you want Dynatrace to pull metrics from).
- Select Connect to verify and save the connection.
- Enter the name of the role you created in Amazon for Dynatrace (for example,
-
After the connection is verified and saved, your AWS account is listed on the Cloud and virtualization settings page. You should soon begin to see AWS cloud monitoring data.
Select your AWS partition
If your AWS account is on a different partition than the default aws
partition, you can select it and Dynatrace will connect to it instead.
To change your AWS partition
- In the Dynatrace menu, go to Settings and select Cloud and virtualization > AWS.
- Find the instance where you want to change the partition and select
to edit the instance.
- In the AWS partition list, select your partition.
- Select Save.
Adjust monitoring to your needs
You can alter the scope and content of your monitoring depending on your preferences by using tags and listing services needed.
Limit monitored resources using tags
We recommend that you limit the scope of your AWS monitoring and reduce the number API calls to Amazon. You can use tagging to limit the AWS resources (AWS service instances) that are monitored by Dynatrace.
Set up metric events for alerting
To configure metric events for alerting
- In the Dynatrace menu, go to Settings > Cloud and virtualization > AWS.
- Under Metric events for alerting, select Manage alerting rules.
- On the Metric events for alerting page, you can create, enable/disable, and configure recommended alerting rules.
For an overview of all recommended alerting rules for all supporting services, see the list below.
The number of recommended alerting rules depends on the number of your monitored supporting services.
To add recommended alerting rules for a new supporting service, you first need to add the new service to monitoring.
Note that not all supporting services have their own predefined alerting rules.
-
Create and enable alerting rules.
To enable recommended alerting rules, you first need to create them. You can create alerting rules and automatically enable them, or (if you clear Automatically enable created rules) create them and manually enable them after possible configuration changes.
For example, you can create and automatically enable a first batch of alerts. When you start monitoring new services, you can create alerts for these new services without automatically enabling them (because you want to configure them first).
-
Configure alerting rules. How you edit rules depends on whether you chose to automatically enable alerts.
-
If you chose to automatically enable alerts when creating them, go to Adjust recommended alerting rules, expand Enabled recommended alerting rules, and select any rule. This takes you to Edit custom event for alerting, where you can change the configuration rules for that specific service.
-
If you didn't choose to automatically enable alerts when creating them, go to Enable recommended alerting rules, expand Disabled recommended alerting rules, and select any of the disabled rules. This takes you to the same Edit custom event for alerting page.
-
-
Disable alerting rules.
-
You can disable all alerting rules, or disable or delete them selectively.
- To disable all alerting rules, go to Adjust recommended alerting rules and select Disable all enabled recommended alerting rules.
- To disable or delete alerting rules selectively, go to Adjust recommended alerting rules and select Custom events for alerting. On the Custom events for alerting page, you can disable an alert by turning it off in the On/Off column, or you can delete it by selecting
x
in the Delete column.
Note: If you disable any or all of the alerting rules, you can always re-enable them.
Choose Cloud services to be monitored
Once your credentials are saved, you can decide which services will be monitored. To select your preferred services
- In the Dynatrace menu, go to Settings and select Cloud and virtualization > AWS.
- Find the instance where you want to perform your monitoring and select
to edit the instance.
- In the Services section, select Manage services.
- The following services are added by default: Amazon EC2, Amazon Lambda, Amazon RDS, Amazon DynamoDB, Amazon ALB, Amazon ELB, Amazon S3, and Amazon EBS. You can extend this list by selecting the Add more icon and choosing services from the dropdown menu. The full list of services is also available at AWS cloud services.
- Select Add service and Save changes.