Easy ReviewDOP-C02
Monitoring and Logging13

Managed Prometheus

Store Prometheus metrics, choose collectors, query with PromQL, and route rule-based alerts to SNS.

Este conteúdo de estudo ainda não foi traduzido, então aparece em inglês. Ajude a traduzir

Amazon Managed Service for Prometheus manages metrics storage and querying. Collectors supply the metrics; workspace rules and alert manager turn them into notifications.

Workspaces, ingestion, and PromQL

Amazon Managed Service for Prometheus (AMP) stores and queries Prometheus-compatible metricsA metric is a variable measured as data points over time. without requiring you to operate storage servers. A metric is a measured value over time; PromQLPromQL is the query language used to select and combine Prometheus metrics. is the language used to select and combine those values.

How it works

  1. Send metrics into a workspaceA workspace is the AMP destination that stores ingested metrics for queries and rules., the destination where AMP stores them.
  2. AMP replicates the data across three Availability Zones within one Region. An Availability ZoneAn Availability Zone is an isolated location within an AWS Region. is an isolated location within a Region.
  3. Use PromQL to filter and aggregate the stored metrics. Managed Grafana can query the workspace for dashboards.
  4. Set the retention periodA retention period is how long metrics remain stored before deletion., the time metrics remain stored before automatic deletion.

Exam cues

  • If the question says keep PromQL and stop maintaining metrics storage servers, think AMP, because it provides managed Prometheus-compatible ingestion, storage, and querying.
  • If the question says retain metrics beyond 150 days, think workspace retention configuration, because 150 days is the default rather than the maximum.
  • If the question says shared AMP dashboards with workforce sign-in, think Managed Grafana with IAM Identity Center or SAML, because dashboard authentication uses those identity providers.

Remember

  • Replication: three Availability Zones in the same Region.
  • Retention: 150 days by default; maximum 1095 days.
  • Ingest metrics before querying or alerting on them.

Trap: Three Availability Zones do not mean three Regions. Workspace replication stays within one Region.

Da documentação da AWS (10)
  • AMP manages ingestion, storage, and queries for Prometheus-compatible metrics without servers for the customer to operate.
  • Metrics in a workspace are replicated across three Availability Zones in the same Region.
  • Workspace metrics are retained for 150 days by default and then deleted.
  • Workspace retention can be configured up to 1095 days.
  • AMP uses PromQL, the Prometheus query language, to filter and aggregate metrics.
  • Metrics must be ingested into a workspace before they can be queried or used for alerts.
  • Amazon Managed Grafana can use AMP as a data source for dashboards.
  • Managed Grafana users sign in through IAM Identity Center, SAML 2.0, or both, rather than IAM user authentication.
  • A metric is a variable measured as data points over time.
  • An Availability Zone is an isolated location within an AWS Region.

Managed collectors and remote write

Collectors move application metricsA metric is a variable measured as data points over time. into AMP. ScrapingScraping pulls metric values from endpoints that expose them. means pulling values from a metrics endpoint; remote writeRemote write sends collected Prometheus metrics to a remote destination. is the protocol that sends those collected values to the workspaceA workspace is the AMP destination that stores ingested metrics for queries and rules..

How it works

  1. Choose who operates the collector.

    Collector Who operates it What it does
    AWS managed collector AWS Discovers and scrapes supported sources
    Prometheus collector Your team Scrapes metrics and sends remote write requests
    ADOT collector Your team Receives Prometheus metrics and exports remote write requests
  2. For EKS managed collection, select subnets. The collector creates an elastic network interfaceAn elastic network interface provides a virtual network connection inside a VPC., a virtual network connection, in each selected subnet.

  3. The managed EKS collector sends samples through a VPC endpointA VPC endpoint provides a private connection from a VPC to a supported service., a private connection to the service, without using the public internet.

  4. For ADOT, connect the Prometheus receiver to the remote write exporter and enable the SigV4SigV4 signs AWS API requests using AWS credentials. authentication extension. SigV4 signs requests using AWS credentials.

Exam cues

  • If the question says collect EKS metrics with no scraper to patch, think AWS managed collector, because AWS operates the scraper for EC2 and Fargate clusters.
  • If the question says ADOT scrapes successfully but AMP rejects writes, think SigV4 and IAM permissions, because scraping and authorized export are separate parts of the pipeline.
  • If the question says managed collection from MSK or OpenSearch Service, think the matching managed integration, because managed collection extends beyond EKS; OpenSearch requires VPC access.

Remember

  • ADOT needs a receiver, a remote write exporter, and a SigV4 extension.
  • ADOT signing service: aps; write permission: aps:RemoteWrite.
  • The private path described here is the managed EKS collector path.

Trap: A working metrics receiver does not prove that the exporter has signed and authorized its AMP requests.

Managed EKS collection path
123EKS metricsiManaged scraperiVPC endpointiAMP workspacei
  1. The managed scraper pulls metrics from EKS.

  2. Collected metrics use the private VPC endpoint path.

  3. Remote write sends the metrics into the workspace.

Detalhes das caixas (4)
EKS metrics

EKS workloads expose Prometheus-compatible metrics.

Managed scraper

AWS operates discovery and scraping through network interfaces in selected subnets.

VPC endpoint

The collector sends metrics without using the public internet.

AMP workspace

Remote write delivers the collected metrics.

Da documentação da AWS (11)
  • AMP accepts remote write from AWS managed collectors, customer-managed Prometheus collectors, and AWS Distro for OpenTelemetry collectors.
  • The AWS managed collector discovers and scrapes Prometheus-compatible metrics without customer-operated scraper agents.
  • Managed collectors support EKS clusters using EC2 or Fargate.
  • For EKS, the managed collector creates an elastic network interface in each selected subnet and remote writes through a VPC endpoint without using the public internet.
  • ADOT collection uses a Prometheus receiver, a Prometheus remote write exporter, and a SigV4 authentication extension.
  • The ADOT exporter signs requests using AWS SigV4 with service name aps and credentials authorized for aps:RemoteWrite.
  • AWS managed collectors can collect metrics from Amazon MSK.
  • AWS managed collectors support OpenSearch Service domains with VPC access, but not public-access domains.
  • Scraping pulls Prometheus-compatible metrics from exposed metrics endpoints.
  • An elastic network interface is a virtual network card in a VPC.
  • A VPC endpoint provides private access to a supported AWS service.

Alerting rules and SNS

AMP rules turn stored metricsA metric is a variable measured as data points over time. into computed values or alerts. Alert manager handles notification routing after an alerting rule fires; the SNS topic then carries the notification to its subscribers.

How it works

  1. Ingest metrics into the workspaceA workspace is the AMP destination that stores ingested metrics for queries and rules.. A managed EKS collector can scrapeScraping pulls metric values from endpoints that expose them. and send them over a VPC endpointA VPC endpoint provides a private connection from a VPC to a supported service.; Managed Grafana can query the same workspace.
  2. Create rules in a YAML rules file. Recording rules save computed time seriesA time series contains successive values of a metric over time., meaning measured values indexed by time. Alerting rules evaluate PromQLPromQL is the query language used to select and combine Prometheus metrics. conditions.
  3. Put dependent rules in one group, with the producer before the rule that uses its output.
  4. Configure alert manager routes and an SNS Standard receiver using topic_arn and sigv4.region. Alert manager groups related alerts and removes duplicates.
  5. Grant the AMP service principalA service principal identifies an AWS service in a permissions policy., the identity AWS uses for the service, access in the topic policy. Restrict that permission to the workspace and account.
  6. For an encrypted topic, grant the service access to the KMS encryption key too.

Exam cues

  • If the question says an AMP rule fires but SNS gets no message, think receiver configuration and topic access policy, because AMP needs permission to publish.
  • If the question says notifications stopped after SNS encryption, think KMS key policy, because topic permission alone does not authorize use of the encryption key.
  • If the question says expensive repeated PromQL calculation, think recording ruleA recording rule saves an expression result as time series that later queries can reuse., because it stores the result for reuse.

Remember

  • Topic actions: sns:Publish and sns:GetTopicAttributes for aps.amazonaws.com in the same Region.
  • Restrict access with aws:SourceArn and aws:SourceAccount.
  • KMS actions: kms:GenerateDataKey* and kms:Decrypt.
  • Rule order is guaranteed within one rule group, not across groups or files.

Trap: Adding SNS permissions to an EKS workload role does not grant the AMP service principal access to the topic.

EKS metrics to Prometheus, Grafana and SNS alerts
scrape12rule fires3notify4PromQL5EKS clusterPrometheus metricsiManaged collectoragentless scraperiAMP workspacePromQL storageiAlert managerrules + receiversiSNS topicnotificationsiManaged Grafanadashboardsi
  1. The managed collector discovers and scrapes Prometheus metrics from the EKS cluster.

  2. It pushes the samples to the AMP workspace with remote_write over a VPC endpoint, so data does not cross the public internet.

  3. An alerting rule evaluated on the workspace's metrics fires.

  4. The alert manager sends the notification to the SNS topic, which needs a resource policy for aps.amazonaws.com.

  5. Managed Grafana queries the same workspace with PromQL for dashboards.

Detalhes das caixas (6)
EKS cluster

EKS exposes Prometheus-compatible metrics.

Managed collector

AWS operates the EKS scraper and sends metrics through a VPC endpoint.

AMP workspace

The workspace stores ingested metrics for queries and rules.

Alert manager

Alerting rules send alerts to alert manager, which groups and routes notifications.

SNS topic

The topic policy authorizes aps.amazonaws.com to publish and read topic attributes. An encrypted topic also needs KMS key permissions.

Managed Grafana

Managed Grafana can query AMP as a data source.

Da documentação da AWS (12)
  • An alerting rule evaluates a PromQL condition and sends a triggered alert to alert manager.
  • A recording rule stores a precomputed expression as a new set of time series.
  • Rules in one rule group run from top to bottom; ordering is not guaranteed across separate rule groups or files.
  • Alert manager de-duplicates, groups, and routes alerts to receivers.
  • Configure an SNS Standard topic receiver with topic_arn and sigv4.region in the alert manager definition.
  • For a same-Region SNS topic, authorize aps.amazonaws.com for sns:Publish and sns:GetTopicAttributes in the topic access policy.
  • Restrict the SNS topic permission using the workspace ARN in aws:SourceArn and its account in aws:SourceAccount.
  • An encrypted SNS topic needs a KMS key policy granting aps.amazonaws.com kms:GenerateDataKey* and kms:Decrypt.
  • The managed EKS collector scrapes metrics and remote writes through a VPC endpoint.
  • Managed Grafana supports AMP as a dashboard data source.
  • A service principal identifies an AWS service in a resource policy.
  • A time series is an ordered set of metric values over time.

Flashcards

toque para virar
Resposta

·

Todos os 13 flashcards em lista

What does Amazon Managed Service for Prometheus store, and what are its replication and retention settings?

Prometheus-compatible metrics, replicated across three Availability Zones in one Region. Retention defaults to 150 days and can be configured up to 1095 days.

A team needs PromQL queries for container metrics without maintaining the metrics storage servers. Which AWS service fits?

Amazon Managed Service for Prometheus. It manages metrics ingestion, storage, and queries and supports PromQL.

An AMP workspace must retain metrics for two years. Must the team export them after 150 days?

No. Configure workspace retention above the 150-day default, up to 1095 days.

A team has AMP metrics and needs shared dashboards with workforce sign-in. What can it use?

Amazon Managed Grafana with AMP as a data source, and IAM Identity Center or SAML 2.0 for user sign-in.

Which collectors can send Prometheus metrics to an AMP workspace?

AWS managed collectors, a customer-managed Prometheus collector, or an AWS Distro for OpenTelemetry (ADOT) collector using remote write.

An EKS team uses EC2 and Fargate and wants AMP metrics without installing or patching scrapers. What should it use?

The AWS managed collector. It discovers and scrapes metrics, uses network interfaces in selected subnets, and remote writes through a VPC endpoint.

An ADOT collector can scrape metrics but AMP rejects its remote write requests for authentication. What should the team check?

Configure the SigV4 authentication extension, set the signing service to aps, and use credentials allowed to call aps:RemoteWrite.

Which three ADOT components collect and send Prometheus metrics to AMP?

Prometheus receiver, Prometheus remote write exporter, and SigV4 authentication extension.

Can an AMP managed collector scrape an OpenSearch Service domain that has only public access?

No. The managed integration requires a domain with VPC access.

Engineers need AMP alert notifications in an SNS topic in the same Region. What must they configure?

An alerting rule, an alert manager definition with the SNS Standard topic receiver and sigv4.region, and a topic policy allowing aps.amazonaws.com to call sns:Publish and sns:GetTopicAttributes. Restrict it to the workspace and account.

AMP notifications to an unencrypted SNS topic work, but fail after topic encryption is enabled. What additional permissions are needed?

The KMS key policy must grant aps.amazonaws.com kms:GenerateDataKey* and kms:Decrypt. The SNS topic policy is still required.

How can Amazon Managed Service for Prometheus send notifications when a PromQL condition is met?

Configure an alerting rule and an alert manager receiver for an SNS Standard topic. The rule sends triggered alerts to alert manager for routing.

An AMP alerting rule depends on a recording rule result. How should the rules be arranged for ordered evaluation?

Place the recording rule before the alerting rule within the same rule group. Do not rely on ordering across groups or files.

Você concluiu todos os tópicos da DOP-C02!

Seu badge ficou dourado. Próximo passo: agendar a prova na AWS. Depois de passar, adicione-se ao Quem passou.

Compartilhar

Conte que você concluiu esta certificação

Concluí todos os tópicos da AWS Certified DevOps Engineer - Professional (DOP-C02) no Easy Review. Venha estudar também!