

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 將指標擷取到您的 Amazon Managed Service for Prometheus 工作區
<a name="AMP-ingest-methods"></a>

您必須先將指標擷取到您的 Amazon Managed Service for Prometheus 工作區，才能查詢或提醒這些指標。本節說明如何設定擷取指標至工作區。

**注意**  
擷取到工作區的指標預設會儲存 150 天，然後自動刪除。您可以將工作區設定為最長 1095 天 （三年），以調整保留期間。如需詳細資訊，請參閱[設定工作區](https://docs.aws.amazon.com/prometheus/latest/userguide/AMP-workspace-configuration.html)。

有兩種方法可將指標擷取至 Amazon Managed Service for Prometheus 工作區。
+ **使用 AWS 受管收集器** – Amazon Managed Service for Prometheus 提供全受管、無代理程式的抓取器，可自動從 Amazon Elastic Kubernetes Service (Amazon EKS) 叢集*抓取*指標。抓取會自動從與 Prometheus 兼容的端點中提取指標。
+ **使用客戶管理的收集器**：您有許多管理自己收集器的選項。要使用的兩個最常見收集器是安裝您自己的 Prometheus 執行個體、在代理程式模式下執行，或使用 AWS Distro for OpenTelemetry。下節會詳細說明這些內容。

  收集器會使用 Prometheus 遠端寫入功能，將指標傳送至 Amazon Managed Service for Prometheus。您可以使用 Prometheus 遠端寫入您自己的應用程式，將指標直接傳送至 Amazon Managed Service for Prometheus。有關直接使用遠端寫入和遠端寫入組態的更多詳細資訊，請參閱 Prometheus 說明文件中的 [remote\_write](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#remote_write)。

**Topics**
+ [使用 AWS 受管收集器擷取指標](AMP-collector.md)
+ [客戶受管收集器](self-managed-collectors.md)