

# External metrics ingestion
External metrics ingestion

You can use the external metrics ingestion feature to configure AWS Compute Optimizer to ingest EC2 memory utilization metrics from one of the four observability products: Datadog, Dynatrace, Instana, and New Relic. When you enable external metrics ingestion, Compute Optimizer analyzes your external EC2 memory utilization metrics in addition to your CPU, disk, network, IO, and throughput data to generate EC2 rightsizing recommendations. These recommendations can provide you with additional savings and enhanced performance. For more information, see [Configuring external metrics ingestion](configure-external-metrics-ingestion.md).

**Note**  
External metrics ingestion doesn't support EC2 instances that are part of EC2 Auto Scaling groups.

## Metric requirements


To generate EC2 rightsizing recommendations with external memory utilization metrics, Compute Optimizer requires at least 30 consecutive hours of memory utilization metrics from your observability product. If you don’t have enough hours of external memory utilization metrics, Compute Optimizer analyzes and generates recommendations from your CloudWatch metrics until you reach the external memory metric requirements.

**Note**  
When external metrics ingestion is enabled, Compute Optimizer prioritizes your external memory utilization metrics over your CloudWatch memory data. If you opt out of external metrics ingestion, Compute Optimizer defaults back to analyze and generate recommendations based on your CloudWatch metrics.

## Organization and account level


You can configure external metric ingestion at both the organization and account level. If you're a member account of an AWS organization that configured external metrics ingestion, you can opt out of this feature. For more information, see [Opting out of external metrics ingestion](deactivate-external-metrics-ingestion.md).

Suppose that you're a new member of an AWS organization that already configured external metrics ingestion. Then, you must configure external metrics ingestion for your AWS account manually. For more information, see [Configuring external metrics ingestion](configure-external-metrics-ingestion.md).

## Next steps


For instructions on how to configure external metric ingestion, see [Configuring external metrics ingestion](configure-external-metrics-ingestion.md).

# Configuring external metrics ingestion


This section provides you with instructions on how to configure external metric ingestion. You can configure external metric ingestion using the Compute Optimizer console or the AWS CLI.

## Prerequisites


Make sure that you understand the metric requirments in order for Compute Optimizer to generate EC2 rightsizing recommendations with external memory utilization. For more information, see [Metric requirements](external-metrics-ingestion.md#external-metrics-ingestion-metrics).

## Procedure


------
#### [ Console ]

**To configure external metrics ingestion**

1. Open the Compute Optimizer console at [https://console.aws.amazon.com/compute-optimizer/](https://console.aws.amazon.com/compute-optimizer/).

1. Choose **General** in the navigation pane. Then, choose the **External metrics ingestion** tab.

1. If you’re an individual AWS account holder, skip to step 4.

   If you’re the account manager or delegated administrator of your organization, you can opt-in all member accounts or an individual member account for external metrics ingestion. 
   + To opt-in all member accounts, choose **All opted-in accounts** from the Preference level dropdown. 
   + To opt-in an individual member account, choose **Choose account** from the Preference level dropdown. In the prompt that appears, select the account you want to opt-in. Then, choose **Set account level**.  
![\[Choose preference level\]](http://docs.aws.amazon.com/compute-optimizer/latest/ug/images/external-metrics-preference.png)

1. Choose **Edit**.

1. In the prompt that appears, select your external metrics provider for EC2 instances. Then, choose **Enable**.

1. Navigate to your external metrics provider's website. To do this, choose **Configure with provider** or the external metrics source link.  
![\[Choose metrics source link\]](http://docs.aws.amazon.com/compute-optimizer/latest/ug/images/external-metrics-choose.png)

1.  Complete the configuration process on your external metrics provider’s website. 
**Important**  
If you don't complete the configuration process with your external metrics provider, Compute Optimizer can't receive your external metrics.

------
#### [ CLI ]

**To configure external metrics ingestion**

1. Open a terminal or command prompt window.

1. Call the following API operation.
   + Replace *myRegion* with the source AWS Region.
   + Replace *123456789012* with your account ID.
   + Replace *ExternalMetricsProvider* with your external metrics provider.

   ```
   aws compute-optimizer put-recommendation-preferences --region myRegion --resource-type=Ec2Instance --scope='{"name":"AccountId", "value":"123456789012"}' --external-metrics-preference='{"source":"ExternalMetricsProvider"}'
   ```

1. Open the Compute Optimizer console at [https://console.aws.amazon.com/compute-optimizer/](https://console.aws.amazon.com/compute-optimizer/).

1. Choose **Accounts** in the navigation pane.

1. In the **Organization-level preferences for external metrics ingestion** or the **Account-level preferences for external metrics ingestion** section, navigate to your external metrics provider's website. To do this, choose **Configure with provider** or the external metrics source link.  
![\[Choose metrics source link\]](http://docs.aws.amazon.com/compute-optimizer/latest/ug/images/external-metrics-choose.png)

1.  Complete the configuration process on your external metrics provider’s website. 
**Important**  
If you don't complete the configuration process with your external metrics provider, Compute Optimizer can't receive your external metrics.

------

## Additional resources

+ [Opting out of external metrics ingestion](deactivate-external-metrics-ingestion.md)
+ [External metrics ingestion](external-metrics-ingestion.md)

# Opting out of external metrics ingestion


This section provides you with instructions on how to opt out of external metric ingestion. You can opt out external metric ingestion using the Compute Optimizer console or the AWS CLI.

## Procedure


------
#### [ Console ]

**To opt out of external metric ingestion**

1. Open the Compute Optimizer console at [https://console.aws.amazon.com/compute-optimizer/](https://console.aws.amazon.com/compute-optimizer/).

1. Choose **General** in the navigation pane. Then, choose the **External metrics ingestion** tab.

1. If you’re an individual AWS account holder, skip to step 4.

   If you’re the account manager or delegated administrator of your organization, you can opt out all member accounts or an individual member account for external metrics ingestion. 
   + To opt out all member accounts, choose **All opted-in accounts** from the Preference level dropdown. 
   + To opt out an individual member account, choose **Choose account** from the Preference level dropdown. In the prompt that appears, select the account you want to opt out. Then, choose **Set account level**.

1. Choose **Edit**.

1. In the prompt that appears, select **No external metrics provider**. Then, choose **Confirm**.

------
#### [ CLI ]

**To opt out of external metric ingestion**

1. Open a terminal or command prompt window.

1. Call the following API operation.
   + Replace *myRegion* with the source AWS Region.
   + Replace *123456789012* with your account ID.

   ```
   aws compute-optimizer delete-recommendation-preferences --region myRegion --resource-type=Ec2Instance --recommendation-preference-names='["ExternalMetricsPreference"]' --scope='{"name":"AccountId", "value":"123456789012"}'
   ```

------

## Additional resources

+ [Configuring external metrics ingestion](configure-external-metrics-ingestion.md)
+ [External metrics ingestion](external-metrics-ingestion.md)